Hi,
 You can see it from a database perspective also. Say you have a Customer
and he has an Address.
 Now when you design the database schema for this scenario, would you model
Address as a seperate entity ? If you do that, then how are you gonna
differentiate between addresses (which address corresponds to whom). So you
need to have a foreign key imported into your Address table, more clearly,
your Address does not exist without a Customer (if it exists it doesnt make
any sense for the above stated reasons). So, this is dependent on Customer
and hence this is bound to be modeled as a dependentObject(LocalInterface,
EJB2.0).
   An enity is a corse grained object that can exist without depending on
anybody whereas a fine grained object meaning that the finer-details of an
entity (captured into a logical object called fine-grained-object) are put
in a dependent object whose life-cycle is bound to be dependent on an Entiy
or other finer-detailed-object of an entity.

To summarise,
Corse-grained object : The obvious data of an entity
Fine-grained object : The obvious finer/"microscopic" details captured into
a logical object and (should be) stated to which entity does the
details(logically abstracted FINER DETAILS) in this object belong to.
     Hope this opens some avenues regarding the solution to your issue.

Regards,
Kris

-----Original Message-----
From: Ashwani Kalra [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 4:55 PM
To: [EMAIL PROTECTED]
Subject: Re: Can a CMP EJB be a CMP field inside another CMP EJB


Hi,

1.Consider an example. if A is completely dependent on B for its existance
then A is modelled as dependent object of B(entity bean)

for example . Customer entity bean may have dependent object Address. If
there is no customer then there can be no Address.

2.Question is not of optimisation of colocated EJBs but remote client
accessing two separate EJBs. Resulting in network traffic. Also if you model
them (Customer and Address) as separate EJBs, then you may not have control
on how they should be created. Client may try to create address ejb which
cannot exist without a customer EJB.

Regds
Ashwani


-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of shreedhar
Sent: Wednesday, March 06, 2002 11:06 AM
To: [EMAIL PROTECTED]
Subject: Re: Can a CMP EJB be a CMP field inside another CMP EJB


I have few similar questions. CMP 1.1 is version what I use. Please answer
this questions with CMP 1.1 perspective

1) How do you exactly classify Entity Beans as Fine Grained - Coarse
Grained. I see very much confusing definitions from various sites. Dependent
Objects adds to this confusion.

2) As per my understanding Address is a dependent Object. Why not we
implement it as an Entity Bean. I guess all the application server has
various optimizations when it comes to communication between Co-Located
Entity Beans.

3) I was goin thru AggregateEntity Pattern. I guess the pattern was
introduced without assuming various optimization done by the App. Servers.
The pattern directs to use a Coarse Grained Object composed of various Fine
Grained Object. And the Aggregate Entity(EJB) will have Coarse Grained
Object as one of its instance(one of strategy). In this case how will I map
the Coarse Grained Object to the persistence Schema.










-----Original Message-----
From: Ashwani Kalra [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05, 2002 2:12 PM
To: [EMAIL PROTECTED]
Subject: Re: Can a CMP EJB be a CMP field inside another CMP EJB


Looks some design problem. Fine grained objects such as address whose life
cycle is dependent on other ejb. They are better implemented as dependent
objects.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cheers
Ashwani Kalra
Sr. Mem. Dev. Staff
Aithent Technologies
India
http://www.geocities.com/ashwani_kalra/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~







-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Sanjeev Verma
Sent: Tuesday, March 05, 2002 1:20 PM
To: [EMAIL PROTECTED]
Subject: Can a CMP EJB be a CMP field inside another CMP EJB


Hi all

lets say we have two CMP EJBs (1.1 spec), Person and Address.

1. Can the person EJB have a cmp field as Address EJB? (In EJB 1.1)
        2. If yes, what will be the create statement for the table that will
hold
the person data look like. I basically mean to ask the data type of the
Address column.
3. If this was with reference to EJB 2.0, can I still have point 1? I DO NOT
mean/want to use <cmr-field>.

Thanx

Sanjeev

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

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