Migration of J2EE to spring boot application
Hello,
I'm at my first SWE job and I'm tasked with evaluating migrating away from enterprise services to Spring Boot. I have experience with Spring Boot but I have no idea on how to approach it, it is a huge project with many moving components.
Please suggest on how I should approach this.
15 Replies
1). Look into microservices.
2). Would you be able to provide more details
To move forward I will need to translate ejb to pojo first and test the pojo on existing functions
However this should be super easy, just evaluate the beans and create a pojo, use lombok to reduce boilerplate code etc.
For example this is a simple EJB
The pojo for this is as follows.
With lombok you'd do this
You'd just do this for every EJB you find and rerun the program.
actually it makes sense now why they want to change to spring.
Java EE servers are annoying.
I've got something like this
ejb
@Stateless
@Local(NEHandlerLocal.class)
@Remote(NEHandlerRemote.class)
@TransactionManagement(TransactionManagementType.BEAN)
public class NEHandlerBean implements NEHandlerLocal, NEHandlerRemote {
public Measurement retrievePM(Node nodeC, Map<String, String> params, Command cmdVal, ExecutionMode mode) throws xxxException {
xxxx
}
@Override // method from interface
public OperationStatus getOTDRList(String clientSession, Node node, Map<String, String> params, ExecutionMode mode) throws xxxException {
}
It implements a interface, how would I go about that in the POJO class?
Something like this?
public class NEHandlerBean{
public Measurement retrievePM(Node nodeC, Map<String, String> params, Command cmdVal, ExecutionMode mode) throws xxxException {
xxxx
}
public OperationStatus getOTDRList(String clientSession, Node node, Map<String, String> params, ExecutionMode mode) throws xxxException {
}
}
they said it's part of modernization but then that's above my paygradeYeah so...
public class NEHandlerPOJO {
public Measurement retrievePM(Node nodeC, Map<String, String> params, Command cmdVal, ExecutionMode mode) throws XxxException {
// Implementation of the retrievePM method
// This method returns a Measurement object and may throw an XxxException
// The details of the implementation are represented by "xxxx"
}
public OperationStatus getOTDRList(String clientSession, Node node, Map<String, String> params, ExecutionMode mode) throws XxxException {
// Implementation of the getOTDRList method
// This method returns an OperationStatus object and may throw an XxxException
// The details of the implementation are not provided in the code snippet
}
}
Is the pojo method.For the @TransactionManagement, in the POJO class, do I have to something to handle it to maintain the functionality ?
Pretty much the implementation of that functionality should be handled in the impl class.
The annotation used to handle that functionality but now you have to handle it most likely.
You're most likely gonna be copying and pasting code all day.
You will really be just trying to understand the code to twist it and make ends meet again.
Do they allow you to use AI?
yea
Yeah so check it out.
Ask AI some of the questions to understand the code better.
Ok gonna look into what you said, thanks for pointing me in a direction
Is your company hiring lol
yes
Check dms