*** here is an attempt to answer your questions.  just my $.02 worth so,
take it for what it's worth. ***


I am looking for some design guidelines for creating business object
EJBs.

1. Should I have business logic in entity beans ?
2. Should they just implement the insert/update/delete into
   the corresponding table ?

*** #1&2: with a session beans being "process-centric" and entity beans
being "data-centric" approach, one could quite easily argue that
business logic could be added to entity beans.  Of course, this would
only be "universally accepted" business logic.  What I mean by that
would be if this logic is applicable to at least 85% of business
scenarios using this data.  In fact, this is a good approach since now
you won't have to add that same business logic in possibly more than one
session bean that would have had to implement this universally accepted
logic as part of its business rule. ***


3. As per the business logic, If an update/insert/delete
   operation on a table requires updating/inserting/deleting
   on a different table as well - where this logic should be coded ?
4. Should session beans be used for implemnting this busiiness logic ?

*** #3&4: if the different table updates map back to different entity
objects, then yes, this business logic should definately be implemented
in a session bean. ***


5. Should there be one instance of session bean for each instance
   of corresponding entity bean ?

*** #5: not necessarily so on two fronts.  first, you could create a
session bean that "wraps" and entity bean, but you might have many
"instances" of that session bean at a given time that are all utilizing
a single entity bean.  secondly, you don't necessarily need to wrap
every entity bean; only those that need to be "seen" directly by
clients. ***


6. Should session beans be used to wrap Entity beans ?  If yes,
   what should be the criteria for selecting the entity
   beans that needs wrapping ?

*** #6: yes, see answer above.


7. Should I have one session bean for one UI screen ?

*** #7: this might be a good approach as long as you are using the
Model-View-Controller pattern with the session bean being the Model.
That way the UI is the View.  Note that with this pattern you could have
a single Model session bean with multiple Views.  ***


Any help on these design issues will be greatly appreciated !

-----------------------------------------------------
B. Arunmozhi
CARS Information Systems,     http://www.carsinfo.com
Off.: 513-563-4542             Res.: 513-759-4469


***
      BEST OF LUCK!!!
      Lester Martin
***

Reply via email to