Yuriy Skripnik
Yuriy Skripnik

Reputation: 15

Domain services in DDD and how do not repeat Simple Domain Model

Let's go throught example. I have a main system object "Vehicle" and I a have a loooot of logic around, even inside "Create" function like some conditions related on VehicleSetting, VehicleOwner, Brand, etc. So I have a lot of dependencies between my entities and in DDD you should use Domain Services to perform some business logic with this dependencies.

And a lot of my entities in entire application have dependencies between each other. So, when I am using Domain Services it seems like I'm actually returning in Simple Domain Model, maybe with slight improvement in OOP. And this necessity relates for other functions in my Vehicle Entity, even simple functions like update price.

Yes, maybe I can use a lot of domain events after and a lot of parameters in ctor or in Create function to perform code outside to make it more purity and create requires before creating process, but I really don't see enough profit in this approach in general, when we are talking about huge business logic - only time sacrificing to endeavor strict rules.

Maybe I'm thinking wrong and someone can help me see the truth, thanks for that.

Upvotes: 0

Views: 61

Answers (0)

Related Questions