Can Spring Webflow eliminate the need for controller classes?

For a relatively simple application, can Webflow be used to reduce the need for form controllers? Well, of course, this is possible, but I think I ask: can I write the entire application using Webflow for the entire logic of the controller / view, if my goal is to reduce the amount of code that I write

I am trying to go through the (bad) Webflow documentation and am wondering if this is worth it, or should I just stick with regular MVC.

+6
spring spring-mvc spring-webflow-2
source share
2 answers

The Web Flow use case is intended to solve a problem related to the controller logic, which encompasses multi-page navigation (page flow or wizard). If you do not need to have a form divided into several pages (or require several small forms to participate in one transaction), you probably do not need a page flow.

However, most applications need this. Something more than just CRUD can be beneficial.

Pageflows provide a natural data cache and can solve problems that arise when using the back navigation button and multiple frames / tabs.

If you are thinking about how to store data that should live longer than one request (a general but erroneous representation should be stored in HttpSession), you will definitely get something from Web Flow. If you are not doing anything like this and are processing everything in the request area, then the likelihood is that you do not need a web stream.

Update: Web Flow can eliminate the need for specialized controller classes to follow the path to the pages / updates of the form in a predefined workflow. If you don't need to do this, you can save yourself a lot of configuration / complexity just by using MVC.

+6
source share

SpringMVC and Spring WebFlow can be used together where necessary - there is nothing strange about this.

If you have a use case that is simple crud, and you think you can easily implement this with SpringMVC, then this is probably the right choice.

Note. You can also achieve this in WebFlow, and neither better nor worse.

If you have complex wizard logic and state management requirements, then WebFlow is great for many other functions, such as transactions and save support (version-2).

+3
source share

All Articles