• Post Reply Bookmark Topic Watch Topic
  • New Topic

BMP - does anyone use it?

 
Robert Edmonston
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what I can see - almost everybody out there doing EJB work is using CMP. It seems to make sense from a specialization of labor perspective - let the vendors or the open source groups deal with the often time consuming details of persistence management. I'm wondering - is anyone out there using BMP and if so what are your reasons for doing so? Thanks!
 
norman richards
Author
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've used both BMP and CMP - on the same project no less. We use CMP for the beans the sit behind session facades and service web requests. We were looking for the simplest most flexible solution. Combined with XDoclet, CMP beans can be rapidly developed and easily changed.
The BMP beans were used on our "back end" which had extreme performance requirements and rigid database schema requirements. The back end is contacted by the session facade but is also used by other high performance systems. With BMP we can fine tune the database access in ways that you can't with CMP. Additionally, believe it or not, BMP is more easily ported to new app servers. The back end portion sometimes needs to live on the customer's app server and CMP requires a lot of tuning and configuration to move. With BMP we have to work harder at development time but have less pain at deployment time.
BMP does have uses, but it should definitely be the exception and not the rule.
 
Avianu Sud
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have had a different experience. We did a lot of work with CMP's but the production performance was quite poor. The 2nd big issue was all the expressions for the Finders. They can get complex, cumbersome and inflexible to maintain.
Thus, most of our code was converted to BMP, and some to JDO's.
In my experience BMP gives far better performance, and JDO's are better persistence mechanism.
EJB's are still very useful for Container Managed Transactions, remote access to EJB's from multiple Applications, Database Connection Pooling, and SessionBeans. No CMP for me!
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
BMP is an excellent way of interacting with directory naming services like LDAP since it gives you control over when and how data is persisted to the directory service. The problem I've encountered in using CMP with LDAP is that LDAP is optimized for heavy reading but is not optimized for writing. Hence, CMP can seriously impact LDAP performance since it continually persists information to the LDAP service at various times throughout the EJB lifecycle.
Darryl
 
norman richards
Author
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Avianu Sud:
We have had a different experience. We did a lot of work with CMP's but the production performance was quite poor. The 2nd big issue was all the expressions for the Finders. They can get complex, cumbersome and inflexible to maintain.

For most applications, I believe CMP performance is more than acceptable. It does depend on what you are doing, and more importantly HOW you are doing it. To give you an example, one project I worked on converted hand written DAO accessors used by a session bean (not even entity beans, just plain DAOs) to local entity beans with CMP. The result was a net performance INCREASE? Why? They code was using a really inefficient value object strategy. In the conversion, we used XDoclet to generate much better performing value objects. The point isn't to criticize or praise CMP or BMP strategies, but to say that there are a lot of design factors and usage pattern factors that might be getting in your way.
I think it's actually quite rare when you REALLY need BMP over CMP for performance, except to compensate for architecture problems. In the case I cited in a prior message on this thread, this was only needed for one small subsytem that had unusually high performance requirements. Your mileage may vary, but most simple web apps will perform quite well with CMP. (in my experience)
Oh, and on the finders issue. I love EJBQL. I dread touching our hand-coded SQL accessors. Making changes can be quite painful. If you use XDoclet to generate your finder methods, you can do a complete finder in a couple lines. (no need to write interfaces or mess with the deployment descriptor)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!