Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP and BMP  RSS feed

 
Anthony Karta
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after reading some articles, I still cannot figure out when to use CMP or BMP otherwise. anyone can help?
thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no experience in the field, but I'd say that you'd probably not bother with BMP.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes mapping tools have trouble with certain database schemas, especially overly complex ones. In those cases, BMPs are often the only choice. That was a common use a few years ago, especially when VisualAge for Java had trouble with even many to many relationships. Many of those problems have gone away.

Sometimes developers see opportunities for custom designs which might optimize data access, which normal CMP mapping wouldn't take advantage of. In those cases, you may see BMPs being used. Also, sometimes data isn't in a normal, relational database, which makes BMPs another options.

CMPs are typically easier to develop, easier to maintain, and easier to code (since they don't really have any code.) CMPs tend to create a more flexible and maintanable solution, which in typical scenarios, makes them a better choice, but of course, your mileage may vary.

Cheers!

-Cameron McKenzie
 
Debu Panda
author
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are starting your project, I would recommend to look at EJB 3 JPA rather than looking at EJB 2 CMP or BMP. Both are dead technologies.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both are dead technologies.

I'm studying dead technologies.
I would not say there are "dead", as too many projects are still using it.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:

I'm studying dead technologies.
I would not say there are "dead", as too many projects are still using it.


Yes I agree. I think I would be working on EJB 2.0 for 2 more years.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you like to make use of alredy existing stored procedure then BMP is the way to go. May be you dont trust the app server generated SQL queries and you have db experts working in your company.
 
Anthony Karta
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Debu Panda:
If you are starting your project, I would recommend to look at EJB 3 JPA rather than looking at EJB 2 CMP or BMP. Both are dead technologies.


I just about to ask it. it's great if they're gone.

are there Home and Local interfaces in EJB 3?

thanks
 
Sunil Dixit
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think discussion is going on wrong direction, Anthony has asked a simple question regarding CMP and BMP and rather than giving the answer, somebody is saying these tech are dead
As per my best knowledge CMP gives you standard and not tightly coupled (i.e. you can changed database table/column name without changing the code) persistence way.It also requires less code as compared to BMP. But CMP also has some problem as far as select/create query are concern.
Using CMP you can't load huge data like bib images into database and if you are using CMP than you have use QL for select statement, sometime some select clause is not supported by QL e.g. CMP 2.0 QL spec doesn't support COUNT, but these thing can vary container to container.
BMP provides persistence way in which you can control the Tx as per your requirement but it is tightly coupled with your database structure.
CMP also has home business method, which is light weight while BMP doesn't have home business methods.
Hope that this will clear you when to use CMP and BMP.

Cheers,
Sunil
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using CMP you can't load huge data like bib images into database and if you are using CMP than you have use QL for select statement, sometime some select clause is not supported by QL e.g. CMP 2.0 QL spec doesn't support COUNT, but these thing can vary container to container.


Why would anyone use EJB for loading images ? COUNT is supported in EJB 2.1.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Anthony Karta:


I just about to ask it. it's great if they're gone.

are there Home and Local interfaces in EJB 3?

thanks


Yes they still exist but the good thing is you don't write them.
 
Debu Panda
author
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, there are a bunch of applications using EJB 2 BMP and CMP and they will live until venodors start desupporting it. I think there is a proposal to remove EJB 2 CMP from the next EJB / Java EE specifications. Typically new applications go live after 10-12 months after you start building it. So what I'm suggesting that you should not start developing new applications that you know is going away and avoid any maintainence problem associated with it.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, there are some vendors who still don't have full production support for EJB3, and only fully support EJB 2.x

So, I wouldn't call EJB 2.x a dead technology, but then again, maybe I've Been Mislead.

-Cameron McKenzie
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!