0 Replies Latest reply on Oct 11, 2005 1:57 PM by dornus

    EJB3 vs static helper classes

    dornus Novice

      I have a question regarding the proper place to put my Helper class.

      If I have a Helper class with all static methods, does it make sense to leave it in the .war file (WEB-INF/classes), or to convert it into a ejb3 bean and place it in the ejb deployment directory?

      I'm guessing there's less overhead to call it in the war
      Ex.

      MyHelperClass.doSomething();
      


      than in the EJB3 directory
      Ex.
      InitialContext ctx = new InitialContext();
      MyHelperClass myHelper = (MyHelperClass) ctx.lookup(MyHelperClass.class.getName());
      myHelper.doSomething();
      


      Especially if it needs to be called in multiple places, multiple times.

      Does anyone have any guidance or suggestions? I guess I need to know when and why to use a ejb3 class over a regular class file. Are ejb3 classes only to manipulate the persistence files (saving/retrieving of .par class files from a database)?