| Article: |
Wiring Your Web Application with Open Source Java | |
| Subject: | Not a good template for building a domain layer | |
| Date: | 2004-04-27 09:29:50 | |
| From: | thlee | |
|
Response to: Not a good template for building a domain layer
|
||
|
IMHO the separation of domain model and business logic has became an inevitable trend in most business application development.
|
||
Showing messages 1 through 4 of 4.
-
Not a good template for building a domain layer
2004-05-24 22:06:55 lachlanj [View]
-
Not a good template for building a domain layer
2004-05-24 22:09:50 lachlanj [View]
Sorry, I meant to say...
"Anything related to the application (technical stuff) like transaction management, message sending, logging etc should be in the service layer" :)
-
Not a good template for building a domain layer
2004-04-28 12:53:42 gaoy [View]
No DTOs (data transfer objects) are maintained. This may be feasible for certain type of domain models, such as without inheritance and polymorphism. If it is running on a rich client such as Swing or C#, or B2B through web services, I wonder one can avoid using DTOs. Are there frameworks facilitating management of DTOs?
Very nice article, and good usage of Spring IoC for decoupling layers via interfaces.
-
Not a good template for building a domain layer
2005-01-01 18:18:31 wrschneider99 [View]
I stand corrected on my original comment;
Hibernate does indeed let you persist private fields, and this feature can be used to move business rules into the domain layer when appropriate.
Also, I have contributed to an XDoclet module to generate DTOs from metadata in the domain model, called XSnapshot.



Basically anything related to the problem domain, e.g. entities, value objects & the business rules related to them should go into the domain layer. This allows you to express domain concepts including business rules through objects.
Anything related to the application (technical stuff) like transaction management, message sending, logging etc should not be in the service layer (sometimes application layer). This layer uses the domain layer to call the business rules. This layer can also be used to integrate with other applications.
I think it is very important to make a clear separation between the two, after all they are two completely different things when you think about it. One is related to technical related implementation specific stuff, and the other is related directly to the problem domain in which the application is trying to solve.
Without this separation it becomes too difficult to extend a system that has complex business rules and thus eliminates any of the benefits of using OOP.
Check out http://www.domaindrivendesign.org/ for detailed information about why domain models are so important.
Lachlan
Lachlan