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).
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).
Regards,
Andreas



Reply With Quote