Loïc,

I both agree and disagree with your response to Shadi.

With EJB 1.1 CMP, about all entity beans are good for is modeling your
database schema, one class per table. Maybe this will improve in EJB 2.0.

On the other hand, modeling your domain as a set of simple relational
objects is a terrible use of the object-oriented paradigm that Java
embodies. You should model your domain based on business entities and use
cases, not on the storage requirements of relational databases.

The problem is how to take a rich OO domain and map it into a relational
database. Such O/R mapping is really difficult and entity beans don't help
very much; at best, you have to resort to a lot of BMP code. You either need
to spend a lot of time trying to get it to work with an O/R mapping tool
like Cocobase or TopLink, and accept the inevitable runtime performance hit.
Or you need to use an object database like Versant or GemStone/J's PCA
(persistent cache architecture).

Better yet, use an application server which is both an EJB container and
provides object persistence. I only know of one such product: GemStone/J.

I think that's a fair summarization of technology best practices and
marketplace realities.

Bobby

-----
Bobby Woolf
Senior Architect
GemStone Systems, a Brokat company
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 06, 2001 09:21
To: [EMAIL PROTECTED]
Subject: Re: [EJB-INT] ??SessionBean to Manage Relation between Entity
Bean


Shadi,

First of all to define entity beans for each database table you have
is a pretty bad approach (the least I can say). The need for
entity beans must come from your problem analysis and not from
your DB model.

Try to isolate your objects from your db with views for example and
Data Access Objects (see Sun blueprints or pet store application).

For the second point, the answer is yes but you can achieve the
same goal with CMT.

Loïc


> ----------
> From:         SoftFrance MOODAD Shadi[SMTP:[EMAIL PROTECTED]]
> Reply To:     A mailing list for Enterprise JavaBeans development
> Sent:         Tuesday, February 06, 2001 15:08
> To:   [EMAIL PROTECTED]
> Subject:      ??SessionBean to Manage Relation between Entity Bean
>
> Hi everybody
>
> I'm trying to map database to object and i'm creating for each table a
> ContainerManaged EntityBean and i implement the relation as cmr field
>
>    * but what if -in futur time- i need to implement another relation,
>      what if I implement it using a session bean, rather than updating
>      the EntityBean,does that cause a problem
>
>    * Can a manage transaction manualy from inside a SessionBean, so I
>      can do multiple operation on entities like a single operation so
>      when I finish I commit or I rollBack
>
> ==========================================================================
> =
> 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".
>

===========================================================================
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".

===========================================================================
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".

Reply via email to