Before and after
The same business flow should be shown in both styles so the change is architectural, not cosmetic.
This page outlines a practical migration-style example pack that translates older J2EE-style organization into modern Spring-oriented structure without pretending the shift is only a framework swap. The real migration is architectural: clearer application services, better injection boundaries, improved testing seams, and simpler transport integration.
Many teams still modernize systems that started with older enterprise conventions. They need examples that show how to move from service locators, heavy delegate layers, and older controller arrangements into more modern Spring application structure without losing business clarity.
A strong migration example set should compare the same use case before and after refactoring. For example: order submission in a J2EE-style layered flow, then the same flow in a Spring Boot style with constructor injection, application services, clearer DTO boundaries, and repository or DAO choices explained.
The same business flow should be shown in both styles so the change is architectural, not cosmetic.
Controller, service, DTO, and persistence boundaries should become more explicit and easier to test.
Old enterprise patterns do not disappear; they often reappear in modernized form.
Use one order-placement or refund flow so the comparison stays grounded.
Move from lookup-heavy wiring toward constructor injection and explicit collaborators.
Separate transport, orchestration, and persistence concerns more deliberately.
Show which old ideas still matter so modernization does not erase architectural understanding.
package org.javaomnibus.examples.migration;
public final class PlaceOrderApplicationService {
private final OrderRepository orderRepository;
private final PaymentGateway paymentGateway;
public PlaceOrderApplicationService(OrderRepository orderRepository, PaymentGateway paymentGateway) {
this.orderRepository = orderRepository;
this.paymentGateway = paymentGateway;
}
}