Mar 18th, 2006, 08:56 AM
Best practice for EJB migration ?
We have a application within our product stack that currently heavily uses EJB's. We have a mixture of remote and local EJB's and ALL are stateless.
We would like to remove our over relience on EJB's by replacing them with POJO's under spring controll.
We have a range of clients accessing our services via a mixture of technologies including HTML, SOAP and RMI. We also have 2 senarios where XA transactions are used across multiple application servers.
Our remote SLSB's are used only as facades that defer to services provided by the local SLSB's. That outlines our current deployment and the final goal we would like to achive.
My question is then, how best to aproach the migration from EJB's to spring managed beans?
I have not seen any case studies or descriptions on how other projects may have aproached this (if any have) so I was thinking that maybe I could use my project as a case study in how to remove or hugely reduce a projects reliance on EJB's. We have some 100 EJB's in this one application alone and as you can image changes to the system or the addition of features prove painful especially where unit testing comes in (thus only gets done by developers on the team haphazardly).
My thinking was that I would address this problem in small concentrated cycles.
1. I would extend all my Remote SLSB's to use springs AbstractStatelessSessionBean thus giving me access to the Spring Context. (would this be better to do with AOP or by hand?). But it does then force a dependency on Spring
2. I would then replace all Local SLS's with standard POJO's and have all my Remote SLSB's defer to them instead (as my remote SLSB's would now have access to the Spring Context).
Any comments or other ideas would be most welcome. I am trying to increase the use of Spring within our project (hopefully without dependence) with each release.