• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Basic DAO question

 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that DAO can be used as follows :
EJB > DAO > Database.
Can it be used as follows. Is this right ??:
EJB > DAO > Some other External System
Examples of external systems are like SMTP/another application.
 
James Ward
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that
EJB > DAO > External System
can also be
EJB > External System
What criteria would decide whether i should use DAO or not.
Would it be terribly wrong to use DAO always as a practice, when accessing any external system/data-source irrespective of whether you want to read or write ?
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should always decouple the EIS tier (database, legacy systems e.g. ERP, CRM, ...) from the EJB tier. The reason is: Don't intermingle proprietary integration code with EJB code (EJB business components) -> Maintainability.
For integrating databases you should either use BMP-DAO or CMP, for integrating systems like Siebel or SAP/R3 there are resource adapters according to the Java Connector Architecture. If you have to integrate a legacy system for which there is no resource adapter available, you can either write your own adapter or write integration code in an appropriate DAO.
 
reply
    Bookmark Topic Watch Topic
  • New Topic