I've spent the lunch hour reading:
- Difference between Active Record and DAO?
- DAO pattern and model objects
- Difference between Data Access Layer and Model in MVC
- DAO classes with CRUD methods VS. DAO classes with entity-specific methods
While these have helped me understand the differences between the design patterns, I am no closer to answering my implementation questions.
Assuming I have an Entity Model (User) and DAO (UserDAO), the following is still unclear:
- How are the Entity Model and DAO coupled? If dependency injection, then what object binds them together?
- Should the DAO only be accessed through the model, or can other objects access it directly (e.g. from Controller under MVC).
- In the same vein, should entity specific methods (e.g.
getActiveUsers) be on the model or DAO.
I know this topic is broad, and open for a debate, I would appreciate supported answers.
Aucun commentaire:
Enregistrer un commentaire