• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJBs modelling question

 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
this might not be the best forum to post this question, but i think only j2ee developers could answer my question correctly.
I`m building an j2ee e-commerce app, but i`m having some dificults to model it (majority of the books don`t take care of this aspect)
Basically, i`d like to know wich option is better for modeling the EJBs and DB (suppose i`m using only CMPs, actually this doesn`t matter):
A - I could have one CMP EJB for each table to represent the persistence,
hava one Session EJB asscociated with that CMP EJB to represent the
access to it and a few Session EJBs to represent a "global" access to
diferent business logics of the app.
B - I could only hava the CMP EJBs for eache table and don not use the
intermediate Session EJBs, only a few Session EJBs to represent what i
called the global access.
C - Any onther sugestion, links, or books you could recomentd me???
Thanks in advance,
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest to create CMP's for each table and put some facade over it (one or two session beans) I don't see any reason to have here more than one bean.
In my understanding one can handle everything (also security issues). You can also check out this pattern
Olli
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you will be well off going through Ed Roman's book on EJB.
There is a chapter dedicated to a full fledged application that discusses the merits of CMP vs BMP, Session Vs Entity, performance issues with respect to some persistance approaches etc.
These chapters in the book are thought provoking and elaborate.
The book can be downloaded and viewed from theserverside.com(or can be bought).
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My point is:
Do i really need a facade exclusive for everyeach entity bean, or i facade a whole funcionality (in this case, a session bean over one, two or three CMPs)???
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You create a Facade for a recognizable business function. If that covers three Entity beans, that's fine.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!