• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • paul wheaton
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
  • Himai Minh
Bartenders:

CMP vs BMP

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
folks

when comparing CMP and BMP which one is better for

(a) Database vendor independence
(b) application server independence.

quite a few mock test carried the answer as CMP is better for both (a) and (b)

Isn't that not so true. Have you tried to use a CMP code generated by websphere for instance to run in Weblogic. Its not plug and play definitely.

Alternatively if ansi-sql is used in bmp, then bmp is more portable for both (a) and (b)

what are your thoughts ?

thanks
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by suekar meredilko:
folks

when comparing CMP and BMP which one is better for

(a) Database vendor independence
(b) application server independence.

quite a few mock test carried the answer as CMP is better for both (a) and (b)

Isn't that not so true. Have you tried to use a CMP code generated by websphere for instance to run in Weblogic. Its not plug and play definitely.

Alternatively if ansi-sql is used in bmp, then bmp is more portable for both (a) and (b)

what are your thoughts ?

thanks



Suekar,

You're partially right in say that BMP could be more portable than CMP, since in order to use the CMP features of an specific application server, there are many descriptors (XML) vendor specific.

If you really use only Ansi-SQL, you could achieve the same portability offered by CMP model.

But, there are anothers reasons to say that CMP is much more better that BMP, for example:

- CMP offers CMR's for CMP fields: This feature offers much more integrity for the application, and provides performance by the use of local interfaces (EJB 2.0)
- Because the Entity beans are controlled by the container, it can take the control about the resources used to maintain the persistence, like: Sinchronization, Connection Factories, Etc. Many programmers do not carry about this issues, creating potentials scalability bottlenecks.
- The EJB container can ensure the system scalability using CMT transactions. Since Entity beans MUST use CMT model, the container can control how the transactions are used over the application. A very common mistake done by many programmers, is make an inapropriated use of UserTransaction interface (JTA).

Transactions must be focused, and more shortest as possible. I have seen many programmers starting transactions, and create ilogical conditions to terminate them, using commits or rollbacks the take a very long time to occur. This bad management of transactions, is the primary factor to decrease the application scalability (because to much resources are being used) and the application performance (At EJB 2.0, do not exist any nested transaction feature, so, the container must use the FIFO strategy to demand aplication requests).

When an architect decided to use CMP, he should think primarily in this points, and for last, worry about the database | application server independence. The reason for this is, there are too many ways to achieve this independence, such as:

- Use the Data Access Object Pattern
- Use O-R Mappings Frameworks like JDO, Hibernate, Toplink, iBatis

And do not forget one of the most importante architectural non functional requirements: The application code must be easy to maintain (Maintainability). So, you the programmer hard code SQL at the code, the maintainence to fix some code problem or implement new features (anyway, every kind of potencial change request), will be very hard.

Good Luck!
 
suekar meredilko
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I agree with the reasons.

But my question is specific to the mock test's question i.e. Is CMP or BMP better with regard to (a) DB vendor (b) app server independence.

Agree that CMP has been matured, v2.0 onwards and one must use it for the all the right reasons you have mentioned.

thanks for the help, though
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic