The DAO pattern would contain classes like LixenseDAO, ApplicantDAO
etc. along the lines of the DAO pattern mentioned in the Core J2EE
pattern book.
(I am using Hibernate as the O/R mapping tool.)
The other alternative I am considering is based on the GoF Command
pattern,
Here I will have Command interface with a method named execute. This
will be implemented by classes like FindCommand, UpdateCommand,
InsertCommand etc. I will be using reflection to copy values to the
Database.
Which one would you reccomend?.
The performance requirement for this application is 4 transactions per
second.
thanks,
Arun
http://www.eventhelix.com/RealtimeMantra/PatternCatalog/protocol_layer.htm
Deepa
--
http://www.EventHelix.com/EventStudio
EventStudio 2.5 - Automate sequence diagram generation
When using a tool like Hibernate, your DAO encapsulates the call to
Hibernate.
In your case, you can define a command interface for each of your DAO
(LixenseDAO, ApplicantDAO, etc.). Then provide a concrete
implementation of each that wrap the call to Hibernate. Make sure
nothing references the concrete class except a factory or a higher
level class that injects the concrete implementation into whatever
invokes the DAO. This way, you can create Test concrete implementations
of each of these DAO classes to decouple your test cases from the the
database.
Kirk Knoernschild
www.kirkk.com
www.extensiblejava.com