Topic
5 replies Latest Post - ‏2012-08-16T04:30:07Z by gr8yash
SystemAdmin
SystemAdmin
4447 Posts
ACCEPTED ANSWER

Pinned topic Design Pattern

‏2002-01-31T13:21:27Z |
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.
Updated on 2012-08-16T04:30:07Z at 2012-08-16T04:30:07Z by gr8yash
  • SystemAdmin
    SystemAdmin
    4447 Posts
    ACCEPTED ANSWER

    RE: Design Pattern

    ‏2002-06-18T20:07:37Z  in response to SystemAdmin
    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:
    http://www7b.boulder.ibm.com/wsdd/library/techarticles/0106_brown/sessionfacades
    .html

    Govind Seshadri
    Updated on 2002-06-18T20:07:37Z at 2002-06-18T20:07:37Z by SystemAdmin
    • SystemAdmin
      SystemAdmin
      4447 Posts
      ACCEPTED ANSWER

      RE: Design Pattern

      ‏2002-06-18T20:07:42Z  in response to SystemAdmin
      Hi!

      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.

      Raghu
      Updated on 2002-06-18T20:07:42Z at 2002-06-18T20:07:42Z by SystemAdmin
      • SystemAdmin
        SystemAdmin
        4447 Posts
        ACCEPTED ANSWER

        RE: Design Pattern

        ‏2002-06-18T20:07:42Z  in response to SystemAdmin
        I guess ejb2.0 is a big thing to happen.
        Updated on 2002-06-18T20:07:42Z at 2002-06-18T20:07:42Z by SystemAdmin
        • SystemAdmin
          SystemAdmin
          4447 Posts
          ACCEPTED ANSWER

          RE: Design Pattern

          ‏2002-06-18T20:07:43Z  in response to SystemAdmin
          Ofcorse while it is not needed (with "local" ejbs)you might want to have
          Dependent Value classes to have a logical view of the persistence and even
          valiadtions
          Updated on 2002-06-18T20:07:43Z at 2002-06-18T20:07:43Z by SystemAdmin
  • gr8yash
    gr8yash
    1 Post
    ACCEPTED ANSWER

    Re: Design Pattern

    ‏2012-08-16T04:30:07Z  in response to SystemAdmin
    If you are looking for ESB patterns then visit VETO Design Pattern