Why I must have so many EJBs in my system?

Discussions

EJB design: Why I must have so many EJBs in my system?

  1. Why I must have so many EJBs in my system? (2 messages)

        In my design, I design one entity bean for each table in database, one session bean for each GUI form. But since I have nearly 1000 table in the database, I've got 1000 entity bean. This number seems too big for me.
        Is there any thing wrong with my design?
        How can I reduce the EJB number?
  2. As much as possible, make your EJB coarse-grain. Don't model dependent objects. Eg, create EJB for your Order object but do not create EJB for your OrderLineItem.

    Benedict Chng
  3. HI
    dont use entity beans for the tables which are more dependent on other tables like 1 to many relationship..
    for such a kind of database operation use helper bean which interacts with ur entity bean..to insert data
    if u ev one order table having orderid
    and for that table u ev orderitem table inwhich there are many items per ur orderid than use helper bean for orderitem entity which interacts with ur oredr entity
    god luk