Roopa,

No, in this example, Address is a "dependent object": it's not an EJB, just
a regular Java class.

class PersoneEJB implements EntityBean {
   private Adress adress;

   public void setAdress(Adress adress) {...}
   public Adress getAdress() {...}
}

The Aggregate EJB manage a graph of parts. The parts are regular Java
classes.

Another example is Invoice and InvoiceLine. An invoice line is a dependent
object because it's life cycle is controled by the Invoice object itself.

class Invoice implements EntityBean {
  private List invoiceLines;

  public void addInvoiceLine(InvoiceLine line) {...}
  public void remInvoiceLine(InvoiceLinePK pk) {...}
  public void changeInvoiceLine(InvoiceLinePK pk, InvoiceLine line) {...}
}

Then, the  Invoice EJB can recompute the invoice total when the invoice
lines are changed.
InvoiceLine is a tto fine grain object to be distributed.

Have a look on the Craig Larman's article.
http://www.sdmagazine.com/articles/2000/0004/0004c/0004c.htm

Hope this help.
Tibo.

>-----Original Message-----
>From: roopa kotha [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, January 03, 2001 3:47 PM
>To: [EMAIL PROTECTED]
>Subject: Coarse grained EJB
>
>
>Hi Thibault,
>
>I got your email Id from ejb mailing list.
>
>I had a question regarding coarse grained EJB
>
>2- Create BIG, coarse grained EJBs.
>  - Represent an aggregat of data stored in different tables
>  - i.e.: PersoneEJB with a method getAddress
>
>Does this mean in a CMP entity bean you have getAddress method
>which talks
>to the Address CMP entity bean.
>
>Can you  explain this bit more
>
>Thanks
>Roopa
>
>
>
>There is 2 granularity problem when you design Entity EJBs:
>  - Component granularity
>  - Accessors granularity
>
>
>1-- Component granularity
>---------------------------------
>There is two extrem solutions when you create EJbs
>
>1- Create small, fine grained EJBs.
>  - Usually, you create 1 EJB per table
>  - i.e.: PersoneEJB and AddressEJB
>
>2- Create BIG, coarse grained EJBs.
>  - Represent an aggregat of data stored in different tables
>  - i.e.: PersoneEJB with a method getAddress
>_______________________________________________________________
>__________
>Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.

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