Is it fair to say that the most important justification to use Spring Webflow over Spring MVC is this: Using Spring MVC, the different stages of the workflow needs to be in code. i.e. If Stage 1 ends in success, in the Controller we need to forward to the jsp for stage 2 and so on. In SPring MVC, we cannot do it in xml file.
But in Spring webflow we can configure the flow in xml file without touching code.
Is this wrong or over simplification? I looked at http://forum.springsource.org/showthread.php?16393-Difference-between-Spring-MVC-Web-Framework-and-Web-Flow and was trying to make a summary of the explanation.
MVC is an implementation of the Model View Controller design pattern, webflow is an implementation of a "web flow" state machine. Web flow sits on top of springs MVC and allows you to define complex navigational flows.
Spring Web Flow provides a declarative flow definition language for authoring flows on a higher level of abstraction. It allows it to be integrated into a wide range of applications without any changes (to the flow programming model) including Spring MVC, JSF, and even Portlet web applications.
Spring MVC helps to develop applications easily. Spring Boot helps to develop the applications easily and quickly with features like auto-configuration and starters. Spring Boot helps in reducing the development time as all the dependency-related task gets handled.
Although Spring Web Flow still serves a purpose and is being maintained, we don't feel like it's a good candidate to have support out of the box in Spring Boot.
If your application have complex Flow pages, events which need to be defined as Finite state machin then use Webflow
. It would be justified to use webflow for website where you buy Insurence, Flight Tickets.
Otherwise use normal MVC framework like Struts, learning curve for webflow can be bit hard than other MVC frameworks.
I would say below point mentioned in post is fully justified.
The main point: webflow is a powerful controller. That's it. Use it when you need its power. use plain old controllers where you don't.
Taken from http://forum.spring.io/forum/spring-projects/web/web-flow/7159-difference-between-spring-mvc-web-framework-and-web-flow
MVC is an implementation of the Model View Controller design pattern, webflow is an implementation of a "web flow" state machine.
Web flow sits on top of springs MVC and allows you to define complex navigational flows.
Quite simply; if you have lots of independent single pages, which don't do much and don't interact, use plain old MVC. If you have a set of pages that represent a workflow, use webflow to model the workflow. If you have both; mix and match
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With