• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Package EJB & DAO classes

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The concept of a DAO(Data Access Object) as i understand is to decouple the business logic and data access mechanism, so that any change to the data access mechanism can be done independent of the business logic changes. Doesnt this mean that the DAO class and the ejb classes should be a part of two different jar files each of which can be independently deployed?
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Generally it does not unless you ship jar with DAO seprately from EJBs.
 
PN Kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My question here is - doesnt the packaging of DAO classes and the ejb jars together defeat the very purpose of DAO classes ?
 
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No it will not defeat the purpose of DAO. WE make DAO for the ease of maintainability and extensibility.Packaging both together will still make them two different class.And it also depend on your project architecture.I dont think you will be using same Database for two different project.
Ultimately its your architecture decision.But it will not defeat the purpose of DAO
Regards,
kundan
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
DAO should be seperate from EJB package as logically speaking. Since normally while pakaging all EJB are put in one jar for applciation server to load all EJB's while starting the application server. But DAO classes whould be under ../WEB-INF/classes, so for this reason we should seperate DAO/ EJB classes jar file.

Still for the question, it is not defating the purpose of DAO but as per standard it is not advisable.
 
Are we home yet? Wait, did we forget the tiny ad?
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic