mercredi 4 février 2015

Coupling and Responsibilities of DAO and Entity Model

I've spent the lunch hour reading:



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