Model reference
Reference Figure: Application Layers for Spring Web Flow
The layer view for a Spring Web Flow application, where the flow definition joins the view and controller layers.
A Spring Web Flow application adds a flow layer to the familiar MVC stack. The flow definition coordinates views and actions, while the service and data layers stay the same. That is why a team can move a use case from MVC to a flow without rewriting its business logic.
Where the flow sits
- View. The pages that the flow shows.
- Flow. The states, transitions and validation that connect the pages.
- Service. The operations that the flow calls.
- Data. The repositories behind those operations.
Generation choices
When you generate a flow, choose whether the flow owns its views or reuses existing pages. Reusing pages keeps the application small, while flow owned views keep each journey self contained. Record the choice in the project notes so that the next developer knows where to look.
The layer figure is also a checklist. If a flow calls a repository directly, the service layer has been skipped. Move the call into a service method and let the flow depend on the service instead.