Announcement Announcement Module
Collapse
No announcement yet.
Design issues about DAO Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Design issues about DAO

    Hi there,

    The project I am taking part in uses spring with hibernate for data access. We are trying to design the project according to common patterns. We have Transfer Objects (with hibernate and ejb3 edr1 annotations for schema generation), Data Access Objects interfaces and implementations of those using hibernate as lower layer data access (as in jpetstore dao and dao.ibatis). We have defined Service interfaces and implementations of those (like jpetstore's domain.logic), which use more than one DAO interface in a DAO-implementation independent fasion. One of the questions that arised is the following: Should we use solely the Service interfaces for data access, or both Services and DAO's? Former would mean that most of DAO's methods should be "proxied" through respective service methods.

    Thanks in advance,
    Dimo

  • #2
    Should we use solely the Service interfaces for data access, or both Services and DAO's?
    It's generally better design to apply your transaction boundary at one level, but I hear what your saying. Also, it might be a bit confusing to mix usage of transactional and non-transactional DAOs (inside of and outside of the service layer).

    Comment


    • #3
      Regarding transactions and DAO's, I think this is a useful post to read:
      - http://forum.springframework.org/viewtopic.php?t=4438

      Decide upon this. :-)

      Rgds, Ales

      Comment

      Working...
      X