Well there has been a late of controversy within my group regarding the Platform independancy of CMP and BMP. the two points here are. 1. CMP is platform independant based on the fact that they take more deployment time as on changing the app server the deployment descriptors have to be varied. 2. BMPs are DB dependant. Could someone throw some light on this please. Thanx in advance. Prince of Pune.
1. CMP is platform independant based on the fact that they take more deployment time as on changing the app server the deployment descriptors have to be varied.
This is true. It does take a lot more deployment. Although if you use XDoclet, this becomes less true. The advantages of CMP/CMR and EJB QL outweigh the extra deployment information needed. What is your question?
2. BMPs are DB dependant.
I would say much more so than CMP. In the BMP case, the independence is left up to you. On a large project, you will see less than 5% SQL code that you will have to maintain the differences (in my experience for the BMP case). There are some limits to CMP and there will be times when you have to use BMP. But the benefits of CMP outweigh the difficulties. For new projects, I strongly recommend tyring out CMP. Please read this link.... : EJB 2.0: EJB QL + XDoclet = using EJB on more projects!
Of particular interest in developer productivity with EJB is CMR, EJB QL and XDoclet (EJBDoclet). Basically, the productivity and utility of these tools have to exceed the inherent difficulties in using EJB in order for EJB to be considered on a project. These tools lower the bar while increasing the utility and make more projects candidates for EJB.
XDoclet, and open source project, simplifies EJB development by using JavaDoc API and some additional APIs as a code generator so that a developer only has to maintain one file instead of 5 or more files (,i.e., deployment descriptor, local interface and/or remote interface class files, local home and/or remote home class files, vendor deployment descriptors and/or conf files, bean implementation, primary key class files, value class files and more.)
There is a significant increase in productivity by using select methods and EJB QL. Code that use to take 10, 20, 30 lines of code can be written in just a few lines of code by mastering EJB QL.
When you combine XDoclet simplification with EJB-QL and CMR, you can use EJB on a lot more projects.
With CMR it is really easy to work with the standard collections API (which we all know and love) when dealing with one-to-many and many-to-many relationships between entities. ... If you have not tried CMR or EJB QL, I wrote a tutorial on CMP/CMR and EJB QL that I think you should check out. The tutorial is on IBM developerWorks. Please go to this link to find out more information on this tutorial series and related articles.