1 Reply Latest reply on May 6, 2008 6:27 PM by andygibson.contact.andygibson.net

    Is use of EntityHome as SFSB not recommended?

      I had a look on the EntityHome and Home source code and searched the forum for similiar threads regarding this topic.


      It seems to me, that EntityHome is designed for using with plain Java objects, not with SFSB or SLSB. Am I right? Can I also use it as SFSB without any restrictions?


      Will be there a special EJB version in the future?

        • 1. Re: Is use of EntityHome as SFSB not recommended?
          andygibson.contact.andygibson.net

          It depends...


          The EntityHome does not implement a local or remote interface, so you would need to work around that. You can create a local interface, subclass the EntityHome and use it like any other stateful bean. I'm not sure whether it can be used with the framework tags in components.xml (even though the entity-home tag has a class attribute that you could point to your new class).


          However, that said, the question of whether you need to is debateable given that :


          EntityHome is a helper class for orchestrating data access between JSF and the database.It probably won't contain code you want to re-use from outside of the application remotely, and if you are using SeamTransactionManagement, you get the same transactional functions. This is that whole grey area on when to use POJOs versus EJBs.


          Regarding the future, EJB 3.1 removes the need for interfaces, so as soon as everyone is on 3.1, we can convert our POJOs to EJBs and vice versa simply by adding and removing the @Stateless annotation.


          Cheers,


          Andy Gibson