This is true and with enterprise applications it irritates me quite a lot.Originally Posted by rebornspirit
Personally I would use the ServiceLocator to get my dependencies. Your design won`t be damaged as much as the anemic domain model (putting all the logic in service-like objects).I agree that this is the best way, the problem is that Spring has no nice way to handle this and I cannot use the solution in the sandbox.Code:class Employee{ void setSalary(int amount){ Validator validator = ... retrieve salary validator validator.validate(amount); _amount = amount; } }
So I guess that you would move the validation to the service, corect?


Reply With Quote
Enterprise problems are difficult enough, but creating so many names for the same thing, or one name for thing that have a different meaning (depending on who said it) doesn`t make it any easier. It would be nice if someone wrote a nice article about the unification of PEAA en DDD.
