Question

Does spring web flow used widely in industry for a conversational flow behavioral application or a wizard kind of application. The main purpose of going such application is to reduced the data we need to keep in session right? Does it worth to go for a framework such as web flow or else what would be other industry standard implementation for such enterprise application?

Below are the disadvantages of a normal implementation contrast to spring web flow which Spring claims,

  1. Visualizing the flow is very difficult.
  2. The application has a lot of code accessing the HTTP session.
  3. Enforcing controlled navigation is important but not possible.
  4. Proper browser back button support seems unattainable.
  5. Browser and server get out of sync with "Back" button use.
  6. Multiple browser tabs causes concurrency issues with HTTP session data.
Was it helpful?

Solution

If you have any feature in your website that has more steps than filling up a form and submit I would definitely go for spring webflow.

Webflow still use the session to store the data, but abstracts everything for you and also does the cleanup on the session when the flow is finished.

You can have as many simultaneous 'instances' of a flow as you want. Think about creating a flow for buying securities, as soon as you click buy, a separate context for that transaction is created, and you can go on as many steps you want (adding a value, checking limits etc) in both of them with complete isolation of state.

The flow xml file is easy to understand and is very manageable as the flow grows with more features.

The whole structure for unit testing the methods on the flow is also pretty easy to mock, which is a huge plus on top of dealing with mocked session objects on a traditional controller. (http://vishwanathk.wordpress.com/2011/07/12/using-mockito-to-unit-test-spring-webflow/)

Give it a try, at first you'll tell yourself several times, "Oh I should have just coded a controller and a few action mappings. But after understanding how the webflow works, you'll never going to code more than 1 step on traditional controllers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top