In my previous post I stated that I *think* I'm starting to move toward the Manager Model. One of the reasons for this is because I want consistency in my API's. I don't want some actions to be performed via a entity object, and other actions to be performed through a Manager. If I do fully embrace the Manager Model the question now becomes do I complete abandon my domain model, or does it just become lighter? My initial thought is that it just becomes lighter. The business logic and workflow for the actions that I perform within my applications will move out of the domain model and into the manager model. The thing I struggle with is the amount of behavior to pull out of my entity objects. I've grown somewhat attached to the behavior, the ability to call .Save(), .Delete(), .FindOne(), .FindAll() right off my entity objects is something I like. Besides just being something I like, the existing behavior also would make the implementation of my Manager (we're really talking about services here so why do I keep calling them managers?) Service a lot easier.
public class CustomerService {
public CustomerSaveResponse SaveCustomer(Customer aCustomer) {
if(aCustomer.Save()) {
/// blah blah
}
return new CustomerSaveResponse();
}
}
Should behavior on my entity objects stay or go?