This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes  DTOFactory using DAO Factory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark " DTOFactory using DAO Factory " Watch " DTOFactory using DAO Factory " New topic
Author

DTOFactory using DAO Factory

sunil g nair
Greenhorn

Joined: Jun 03, 2002
Posts: 14
This is a copy of the patter I sumbitted on TheServerSide.com. This is a really nice store house for enterprise design patterns.

This pattern is a combination of three established patterns.
1. Data transfer object factory
2. Command pattern
3. Data access objects (using abstract factory)
The Data transfer object factory (Implemented as a Session EJB) is the interface to the business client. The only alteration being that the Data transfer object factory does not create any data transfer object as such. The Data transfer object factory in turn uses a command pattern to invoke the specific command that will handle the DTO creation.
The DTO Specific command will have all the entity relationship info needed to create the DTO. It will then invoke the Data access objects abstract factory to get the appropriate factory and then it will call that factory to get the DAO from which it gets the entity values.
The Data access objects (using abstract factory) strategy will ensure that your data source can be anything. It could also be a good way to abstract the business logic from persistence technologies like ORM, EJB (Entity) or Data Objects.
Further clarifications:
DTO Factory is required to be a stateless session bean only if the clients are non-EJB.
You are right it does use the container features of the app server for non-EJB clients.
The DTO Factory is different from the session fa�ade since the fa�ade is just a fa�ade to your persistence framework (entity EJB) and it typically includes business logic. Whereas the DTO Factory in my case is just a routing controller, which uses command pattern to route to, the appropriate command which will handle the DTO creation. (You got this right too)
The Business logic to create the DTO is typically embedded in the command. So the DTO Factory is not cluttered and the commands are free to inherit from a command specific base class other than the DTO Factory.
Ideally speaking the DTO Factory should be called a command controller rather than a factory. But the client side interface to the business clients will be very similar to a DTO Factory. I used the DTO factory term because of this similarity in objectives and thus make it easier for people who are already familiar to DTO Factory pattern.
[LIST]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DTOFactory using DAO Factory
 
Similar Threads
Value Object (VO) vs. Transfer Object (TO) vs. Data Transfer Object (DTO)
some unsure questions on phase 1
Can EJBActions be used for application client
Domain Objects and Service Oriented Design Pattern
Passed SCEA Part 2 - My experience