Jul 19th, 2007, 12:27 AM
Well, the object at hand should not know, but that does not mean that the domain model as such is agnostic. If it is part of the usecase to prevent duplicates on user creation (which usually is the case), then that fact has to be represented in the domain model (usually in some repository class).
Originally Posted by aks
So you should not just pass in an object in a generic method that invokes makePersistent() but use a dedicates service method that inserts a new user and performs the necessary checks to prevent duplicates.
I would guess that ROO does support this, but I do not know the details (yet).
Jul 19th, 2007, 01:27 AM
I think this is what Eric Evans calls Domain Service in his DDD book. The domain service can in turn talk to repositories.
Originally Posted by Andreas Senft
Jul 19th, 2007, 03:30 AM
Yep. That was the background of my suggestion. And that is why I suspect that it should be achievable with ROO.
Originally Posted by debasishg