• Post Reply Bookmark Topic Watch Topic
  • New Topic

Package EJB & DAO classes  RSS feed

 
PN Kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • 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?
 
Slava Imeshev
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • 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
  • 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 ?
 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • 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
 
Natarajan Shankar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!