• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DAO doubt

 
Aditya Kumar
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi fellow ranchers,

A group of systems (data repositories) is accessible only via the web service interface. The access provided is only read-only in nature. In such a scenario, we can still use the DAO for accessing the system, correct?

As I understand the idea behind the DAO is that it hides the implementation details of accessing the data from the rest of the system. Agreed that in most cases the DAO would be interacting with a RDBMS but the data source could also be a Web-Service, which is the only interface provided by the RDBMS?

So in this case the flow could be like Stateless Session bean -> DAO -> Web Service.

Am I right in my understanding?

Thanks!

ak
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes on all except where you said "So in this case the flow could be like Stateless Session bean -> DAO -> Web Service. ". You don't really need a Stateless Session Bean in there.
It will more be like Business Delegate-> DAO -> Web Service or Business Delegate-> DAO -> SLEJB or Business Delegate-> DAO -> JDBC classes. As you can see here the DAO will hide whether an EJB (with JPA APIs) is used to access the database or a web service or some other data access mechanism. It's not uncommon to see the Business Delegate and DAO collapsed into one unit though.
 
Aditya Kumar
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear E Armitage,
Thank you for your reply. I understand what you said. In case of fetching data via the DAO (which will then fetch if from the WS), we do not need Stateless Session Bean.
I think, however, in case when I am trying to accomplish a business transaction (which may require access to Data via DAO), this could be acceptable?

Presentation Layer->Business Delegate -> Stateless Session Bean-> DAO

Thank you again,
ak
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic