Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Part II : CMP Vs Session Bean and DAO  RSS feed

 
Sudhansu Pati
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I read the following discussion about CMP Vs Session Bean and DAO.

http://www.coderanch.com/t/149754/java-Architect-SCEA/certification/DAO-SCJEA-Assignment

Does CMP really introduce manageability issues and has a tight coupling with the Database ?

I thought BMP had those issues. In BMP you basically have to write the SQL queries within the entity bean itself. The only benefit of using using BMP is you may get faster performance and it is easier to work with complex datatypes using BMP.

But with the EJB 2.0 specifications, you can create CMR between multiple tables. Almost every application server today support caching mechanism and connection pooling which makes the database operations from the application server to the Database is even faster.

In the Part II assignment, I have seen everyone using DAO and session bean. I think it is probably easier for the assignment purpose so that you don't have to show so many entity beans and the relationship between them.
But would you really recommend someone to use Session Bean and DAO for a real project ?

Another quick question is, if I use CMP entity beans, how do I show their relationship in the Sequence Diagram ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!