How are DAOs usually designed for the typical business application ? Does one class or pattern dialogue with the data source or do you simply have a separate DAO for each Entity ?
+1
A:
I recommend reading Fowler's Patterns of Enterprise Application Architecture. For example, you can use a Table Data Gateway, Row Data Gateway, Active Record, or Data Mapper.
Most projects out there are using an ORM like Hibernate or IBatis, which adapt to the domain model as opposed to using transaction scripts.
MattMcKnight
2009-12-10 05:49:36
A:
In Java Class as DAO
DAO of similar entities should be consolidated in one. The smaller entities are encapsulated as inner classes. However, if the entity is large enough you should have different DAO for each entity.
DKSRathore
2009-12-10 06:30:22