Is it possible for a Session Bean which implements Session Facade pattern to
call an Entity bean directly? Our Client insists that a True Session Bean
(which does not implement Session Facade pattern) can only call an Entity Bean
and not a Session Bean which implements SessionFacade. In effect they want us
to introduce a layer of Session Bean between Session Facade Bean and Entity
Bean. Please advise us.
Thanks in advance.
RE: Design Pattern2002-06-18T20:07:37ZThis is the accepted answer. This is the accepted answer.I think both you and your client are right, although I think you are "more
right" than your client! :)
To answer your first question: Can an ejb implementing session facade access a
entity bean directly? Yes, most certainly. In fact, you'd do that rather
routinely, more so with the tightly coupled subsystems you can develop using
local interfaces under EJB 2.0.
Basically, you should look at the session facade as a gateway to a subsystem.
Which means that you can certainly have a super-session facade acting as a
mediator between multiple subsystems (i.e. it would aggregate multiple facades)
Take a look at the developerWorks article "Rules and Patterns for Session
Facades" for details:
Govind SeshadriUpdated on 2002-06-18T20:07:37Z at 2002-06-18T20:07:37Z by SystemAdmin
RE: Design Pattern2002-06-18T20:07:42ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
All the design patterns have been cahnging. The way we used to do coding
earlier are no longer valid with the onset of EJB2.0. Infact if all that you
want to make is a web-application how you should code your ejb is different
from how you would code otherwise. If you are making only webappliactions go
for only local-interfaces. Don't even go for dependent classes and bulk
accessors. UseEJB relationships. Have yourservlets,jsps,taglibs, ejbs deployed
in an ear archive. The servlets will be able to access the ejbs without even
the session facade. Although your servlet might be able to directly access your
"local" ejb in an ear you might still want it to layer your business logic away
from the servlets. In fact your session facade could be "local". Having
business logic inside the session facade will also ensure you do not have to
yourself demarcate transactions yourself but use declarative transaction
management. The idea is if all you wanted was web-appliactions make ears. You
might not have to make a single r
emote home for your bean.
For ejbs that are being accessed from outside applications (non
webappliactions) you might need remote interfaces and bulkaccessors.
In any case do use a session facade.
RaghuUpdated on 2002-06-18T20:07:42Z at 2002-06-18T20:07:42Z by SystemAdmin
RE: Design Pattern2002-06-18T20:07:43ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
Dependent Value classes to have a logical view of the persistence and even
valiadtionsUpdated on 2002-06-18T20:07:43Z at 2002-06-18T20:07:43Z by SystemAdmin