We have a project with a pretty considerable number of EJB 2 stateless session beans which were created quite a long time ago. These are not the first-line beans which are accessed from our client via RMI, rather they are used by that code to perform specific functions. However, I've come to believe that there's nothing to be gained by having them as session beans at all.
- They do not need to be accessed via RMI.
- They do not retain any state, they are just code that was factored out of the first set of beans to reduce their complexity.
- They don't have multiple different implementations which we are swapping out, each one has been as it was for years (barring bug fixes and feature additions).
- None of them alter the transaction that comes into them from the bean calling them (that is they don't require a new transaction, not participate in the existing one, or otherwise change things).
Why should these not all just be classes with a couple of static functions and no EJB trappings at all?