he Spring framework
, a lightweight open source J2EE container previously featured on these pages
, is about to introduce a significant new feature as part of its already impressive offering. With the next release (1.3 , scheduled for summer of 2005) Spring will officially incorporate Spring WebFlow
, an innovative, high-level Web framework for creating and configuring reusable Web flows within a Web application.
Those familiar with Spring may mistakenly assume Spring WebFlow is the same as Spring MVC. It's not. Spring MVC is a lightweight framework for Web application development, while Spring WebFlow introduces a whole new value proposition. It enables Web application architects to focus on the more abstract concerns of Web application development: the structure of logical Web flows and the definition of Web event conditions. Furthermore, it introduces new concepts such as continuations (more on those shortly).
This article reviews some of the key concepts behind this upcoming framework, examining the major compositional elements of the flow markup language in the context of the sample login sequence flow, and explaining why WebFlow is an attractive framework. (Readers must have a basic knowledge of the Spring framework release 1.2.)
Spring WebFlow Concepts and Components
As a Web framework, WebFlow has advantages in both conceptual and practical terms. It is grounded in sound software engineering concepts that promote consistent and solid architectures, and its components are logical, easy to understand, and easy to work witheven on a large scale.
In fact, the framework is best suited for medium-sized to large applications development because its component model is optimized for architectural reuse and effective manageability and configurability.
Case Study in Context
As a case study, this article examines the most common Web application flow, a Web authentication sequence, and uses some of its segments for demonstration. A Web authentication sequence consists of a login form, a registration form, authentication action, registration action, and rendering the results for these actions. This example focuses mostly on the configuration for the components that render the login form.
Spring WebFlow is based on the concept of the Finite State machine
, also known as a Finite Automata. User interactions and transitions within a Web application are modeled on the common state machine principles of states and transitionsa very popular model in software engineering (see Figure 1
). Automata-based design is an interesting design choice, and it is likely to gain popularity among application architects for its clarity and disciplined approach to modeling Web interactions.