I'm not confident that mixing BMP with CMP will result in portable beans
today. The reason lies in the finder methods. The EJB spec implies that
you should not implement finder methods if you're using CMP. Because of
this, not all EJB servers will delegate home object finder methods to your
custom implementations.
IMHO, we need to make a decision: is mixing BMP and CMP allowed? If so, it
should be stated in the EJB specification, and we need to thoroughly think
about the right way of specifying how BMP and CMP should be toggled.
I think mixing BMP with CMP has a single advantage: flexibility. If you're
writing beans that require a complex mapping to databases, those beans will
not be portable across all EJB servers, since not every EJB server supports
complex mapping. Until the EJB spec mandates that vendors support entity
bean relationships, a standard way to specify an entity-database mapping,
and complex mapping, people are going to rely on BMP if they want the most
portability. The disadvantage of mixing BMP with CMP is your beans are no
longer database-independent.
And if you want my personal opinion, I don't believe there should be two
types of entity beans. I think it confuses people and makes the EJB
programming model too complex (compared to COM+). I believe there should be
one type of entity bean. You should specify deployment descriptor settings
that toggle BMP/CMP on a per-method level. This will simplify the EJB
programming model and give us the same functionality we have today, as well
as the ability to mix BMP with CMP.
Thoughts?
--
Ed Roman
CEO, The Middleware Company
Author, "Mastering Enterprise JavaBeans and the Java 2 Platform, Enterprise
Edition"
(published by John Wiley & Sons, 1999)
http://www.middleware-company.com
[EMAIL PROTECTED]
>
> Well, you can mix if you want. There's no rule saying that you're
> not allowed to make SQL calls in a CMP bean. What CMP provides is
> Container Managed Persistence. That's it. It's mostly there for
> convenience reasons. If you want something more than that you can
> use SQL-calls in your CMP bean.
>
> /Rickard
>
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> Homepage: http://www-und.ida.liu.se/~ricob684
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".