Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use spring web flow over spring mvc

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.

like image 472
Victor Avatar asked Apr 02 '13 22:04

Victor


People also ask

What are the differences between Spring MVC and Spring 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.

What is the use of Spring Web Flow?

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.

What are the advantages of spring boot over Spring MVC?

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.

Is Spring Web Flow still used?

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.


2 Answers

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.

like image 104
Vinay Lodha Avatar answered Sep 20 '22 15:09

Vinay Lodha


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

like image 35
Abdullah Khan Avatar answered Sep 17 '22 15:09

Abdullah Khan