Re: Domain Model and Service Layer



Responding to Mikeon...

Hello!

I'm working on a domain model (accorting to DDD) where I represent a user as an entity.
Creation of a user is handled by a factory i.e.:
UserFactory uf = GetFactory();
User user = uf.CreateUser("name", "login", "email");

There are lots of possible solutions. Here's one...

[Client]
| *
|
| R1
|
| invokes
| 1 1 R3 invokes
[UserFactory] ------------------- [Notification]
| 1 + sendEmail(...)
|
| R2
|
| creates
| 1
[User]

Here the factory invokes Notification::sendEmail with the appropriate [User] data when a User is created. The Notification formats the eMail message sends it off the someone else (perhaps in a network service subsystem) who handles the grunt work of dumping it on the 'net.

The main point is that the Factory has to notify somebody who understands eMail messages when it creates a User object. Whether that "somebody" delegates the details of internet message protocols or not depends on what sort of implementation environment one has.


*************
There is nothing wrong with me that could
not be cured by a capful of Drano.

H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@xxxxxxxxxxxxxxxxx for your copy.
Pathfinder is hiring: http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH



.