Results 1 to 3 of 3

Thread: Design Questions

  1. #1
    Join Date
    Aug 2004
    Location
    St. Louis, MO
    Posts
    39

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Los Angeles, USA
    Posts
    62

    Default

    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.

  3. #3
    Join Date
    Aug 2004
    Location
    Herndon, Virginia
    Posts
    28

    Default Re: Design Questions

    Quote 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.
    ---------------------------------
    David H. McCoy


    ----------------------------------

Similar Threads

  1. Replies: 2
    Last Post: Jun 20th, 2005, 02:15 AM
  2. Generic Querying Design Questions
    By soniks in forum Data
    Replies: 4
    Last Post: Jun 7th, 2005, 04:37 AM
  3. newbe questions
    By jboring in forum Swing
    Replies: 2
    Last Post: Dec 21st, 2004, 11:28 AM
  4. Replies: 2
    Last Post: Dec 20th, 2004, 03:43 PM
  5. Replies: 6
    Last Post: Oct 8th, 2004, 02:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •