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

  • Design Questions

    Ok, I have some general 'best practice' type questions for you guys/gals. When you create a data access layer, do you create it in it's own project (and if so, where do you put the definitions for the dao/service beans - the data project or the web) or do you just put the data access stuff in the web project?

    Also, how do you structure your data access stuff? I typically have a data access object for each propogated object and then a service layer on top of that, but I see more and more examples with just the service layer. What about you?

    Discuss!

  • #2
    I am not sure what you mean with "project" but normally I recomend to have some layering within your packages so that you make a destinction between the three tiers; web, service, and domain. This is not a technical requirement but a best practice that helps to logically separate classes in the right tier.

    Having "just" a service layer makes no sense to me when you communicate with an EIS. The amount of code in the data layer is often reduced with the help of frameworks like Spring and Hibernate but this does not mean that the line between the domain and service layer should blur. If not, you might as well attack a database right from your JSP's.

    Comment


    • #3
      Re: Design Questions

      Originally posted by ryan.tyer
      Ok, I have some general 'best practice' type questions for you guys/gals. When you create a data access layer, do you create it in it's own project (and if so, where do you put the definitions for the dao/service beans - the data project or the web) or do you just put the data access stuff in the web project?

      Also, how do you structure your data access stuff? I typically have a data access object for each propogated object and then a service layer on top of that, but I see more and more examples with just the service layer. What about you?

      Discuss!

      I have a persistence package that has a dao package for interfaces and a hibernate package that has hibernate implementations of those DAO interfaces.

      Persistence also contains PersistenceService interfaces with spring specific implementations in a spring directory. The persistence services are functional groups of specific functions.

      In essence the persistence services use several different DAOs to handle DB access.

      Comment

      Working...
      X