I finally got around to reading some of the follow up comments to Frans “Does SOA require Object Message Mappers? It depends.” post. The comments can be summed up as follows:
+1 for Domain
- Jimmy Nilsson
- Mats Helender
- Yves Reynhout
+1 for Manager
- Frans Bouma
- Jimmy Nilsson
- Udi Dahan
- Andres Aguiar
- Mats Helender
- Yves Reynhout
Where exactly do I fall in the voting? While I'm still trying to figure it out for sure, I think I fall somewhere in the middle. On the one hand I like having behavior on my entity objects. When I need to save a Customer I like being able to do customer.Save(). When I need to give an employee a raise I like employee.Raise(.50). With that said I think I'm slowly moving toward a Manager model, here's why:
- Certain business actions need to go through a manager. To stay consistent using a manager for everything may make more sense.
- Managers allow you to separate the business logic from the entities. This allows you to apply different business rules depending on the operation.
- Managers allow you to apply aspects easier. Introducing logic to apply aspects within my entity objects is not something I'm comfortable with.
- Business processes that involve many different entities make more sense in a manager then in your entity objects. Coupling is bad, right?
- It's more in line with SOA, after all a manager model could also be called a service model.
What's your vote?