• Post Reply Bookmark Topic Watch Topic
  • New Topic

Data Access Beans  RSS feed

 
Riju Das
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was reading the j2EE manual for ibm visual age for java 4.0-just wondering what data acess beans were-i know what session and entity beans are. will only know what/how many types of EJBs are needed for a particular proj once i can differentiate between all the different types.
thanks.
 
Ritesh Gupta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think you are talking about Data Access Objects. These objects are used within Enterprise beans to minimize remote calls (which are expensive). Using them the call is reduced to a single object get/set call instead of the individual get/set methods for each attribute in the EJB. Do not confuse them for a different type of EJBs.
Hope that clarifies your doubt.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure you're not talking about Value Objects instead of Data Accesss Objects, which are supposed to contain the logic for managing/abstracting the underlying datasource?
 
Ruilin Yang
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Data access object is normally not a EJB. It is a just a normal java class (or java bean) to used to assist a EJB.
Please do not confuse with EJB.
regards
Ruilin
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Riju,
Data Access Bean is something PROPRIETARY to IBM.
It is a kind of Data Access Object which inherit from an IBM class.
If you use them, you won't be able to deploy on a app server but IBM WebSphere....
So... As it was said before, Data Access Bean is not part of the EJB spec.
Be aware you'll be stucked forever with IBM if you use them

My 2 cents...
 
Elizabeth Reynolds
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Data Access Beans employ the (com.ibm.db.dbbeans?), which is a package that just extends the functionality of the java.sql package adding methods for more flexibility and optimization.
But the concept is different from a DAO. I think of data access beans, which you can write without the IBM extensions, as a means of managing data sources without using RMI-IIOP. In this sense, they are not entity beans and I believe they are probably just applicable to web servers.
However, I still find the terminology confusing. Can one of the local gurus around here provide a more precise definition (i.e, would it be appropriate to call them JDBC session beans?).
[ July 23, 2002: Message edited by: Elizabeth Reynolds ]
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only the original poster can add more clarity to the discussion by quoting more references. However, I can add my two cents worth by explaining what Data Access Object pattern is in the context of EJB development.
DAO ( aka Data Access Command Bean ) encapsulates the logic to talk to the database using JDBC. It has a bunch of attributes that can be set using setters and four main commands - update(), delete(), select() and insert() that can be invoked to talk to the database. DAOs can be very useful if you perform direct JDBC calls for reading and use EJB layer if you need transaction capabilities. Since the JDBC-calls and ResultSet manipulation is common between the two scenarios, it makes sense to encapsulate the common logic in a domain-centric DAO( one for each domain object ) and make use of it both for plain JDBC calls as well as from the entity beans layer. It is, according to Floyd Marinscu, the author of famous "EJB Desing Patterns" book, one of the early lifecycle component that you design and write before writing the EJB layer.
Hope that helps!
 
Arijit Ghosh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you package the Data Access Objects ?
 
Ruilin Yang
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I package the DAO with EJB which use it in the same component.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!