• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP Beans  RSS feed

 
Kodo Tan
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
When we use CMP entity beans to model records in relational database, we do not need the DAO, right ? (please correct me if I'm wrong).
However, how do we implement CMP entity beans if our datasource is not relational database (e.g OO db) or some legacy system (using Connectors ?) ?
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
According to sun j2ee patterns, if you�re using the new Local interfaces to implement your entity beans than you coul�d skip building the DAOs as you�re gonna do local calls on the beans, but if you�re using the remote interfaces entity beans from ejb 1.1 specifications you should consider building some DAOs to avoid the remote calls in some cases.
The next text was taken from the sun catalog:
Using lightweight entity beans under the EJB 2.0 specification. The EJB 2.0 specification introduces the notion of local interfaces, which allow clients to use entity beans without making a remote method invocation. Under this specification, a data access object can be implemented as a lightweight entity bean, whose local interface abstracts data access functionality.

you can read more at:
http://java.sun.com/blueprints/patterns/j2ee_patterns/data_access_object/index.html
regards.
 
Matjaz Juric
Author
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kodo,
Originally posted by Kodo Tan:
When we use CMP entity beans to model records in relational database, we do not need the DAO, right ? (please correct me if I'm wrong).

Correct.
Originally posted by Kodo Tan:
However, how do we implement CMP entity beans if our datasource is not relational database (e.g OO db) or some legacy system (using Connectors ?) ?

You have to use BMP.
Cheers,
Matjaz
 
Ruilin Yang
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought CMP should be able to use OO database ?
Maybe not now ? But definitely it will be able to connect to an OO database. Conceptually, it is more straight forward to use OO database.
Thanks
Ruilin
[ February 05, 2002: Message edited by: Rulin Yang ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!