Announcement Announcement Module
No announcement yet.
Added value of EJB convenience classes ? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Added value of EJB convenience classes ?

    Can someone describe the advantages of using convenience classes such as AbstractStatelessSessionBean vs. standard J2EE EJB APIs ?

    In my case the business session beans are accessed by the presentation layer through the EJB client which is injected by Spring via the ApplicationContext of the presentation webapp, and this is independent of the fact that the EJBs might or might not extend the AbstractStatelessSessionBean.
    So what can the convenience class do for me ?


  • #2
    If you just consider the client side, there is no advantage at all. The convenience classes just facilitate the implementation of EJBs on the server side. If you want to use your (stateless) EJBs as facade for a POJO which gets configured via Spring then these classes provide everything to get you started quickly. Have a look here for more details.



    • #3
      Hi. I have already read that, but things are still unclear to me. From what I understand, even if my session EJB does not extend the Spring convenience class, I can still use it as a facade in front of a business POJO, and inject the POJO's reference in the EJB using Spring. I'm just having a hard time putting my finger on what the AbstractStatelessSessionBean simplifies or permits vs. a standard J2EE stateless session EJB.


      • #4
        Well, it is not that complicated. As you said you can do without them. You just have to retrieve the ApplicationContext, and get the delegate bean from it. Further you have to implement the mandatory but (for stateless beans) useless lifecycle methods.

        Now you have the choice of programming this boilerplate code for every bean you implement or just take the implementation that is already there.

        There nothing more about it. Just making life a little bit easier :-)



        • #5
          Got it. Thanks !