What is Spring Web Flow?
Spring Web Flow is a Web application component in the Spring Framework that provides an easy way to write stateful and session-based Web applications. Spring Web Flow makes logical processes first-class citizens of Web applications, allowing you to define them as self-contained modules that can be configured and reused independently of the rest of the application. It is framework-independent and can be easily used with alternative Web application frameworks such as Spring MVC, Struts, or JSF.
Page flows are configured using a Domain definition Language (DSL) developed specifically to define and compose page flows. The current implementations are XML and Java.
Spring Web Flow introduces several stateful data domains: Request, Flash, Flow, and Conversation that can meet a variety of user cases and needs, giving you great flexibility and ability to develop stateful Web applications.
Here’s a quick rundown of the most interesting features in 1.0 Release:
Define all the control logic for an application task, such as a search process, in one place rather than spreading the logic over many places.
Simple flows are combined to create rich control modules.
Use a natural and object-oriented linear programming model rather than verbose if/else blocks to define strict user navigation rules.
But the memory you allocated during the execution of the flow is automatically cleared when the flow ends or expires.
Deploy an executable flow in a Servlet environment that uses the base Web framework of your choice.
Change web frameworks (such as Struts, Spring MVC, JSF, and others) without changing flow definitions.
Change with the environment without changing your flow definition, such as from JUnit tests to portlets.
Refine your application navigation rules during development without restarting the container.
Automatically and correctly respond to browser buttons (back, forward, refresh) without custom programming.
The task data is stored in four managed domains: Request, Flash, Flow, and conversation, each with its own unique semantics.
Test the flow separately from the container. Ensures that application control logic is working properly before deployment.
Use Spring IDE 2.0 to visually edit your flow navigation logic diagrams
What is Terracotta for Spring?
Terracotta for Spring is a Spring application based runtime that provides transparent high-performance clustering support for Spring applications with minimal impact on application code and deployment and configuration processes. Instead of clustering applications directly, it clusters applications at the heap level below the application. This enables developers to develop single-node stateful Spring applications that are different from stateless ones. This allows clustering not to be considered at the beginning of the design of applications that need to scale. When the application needs to scale or ensure availability and failover, they only need to define in the Terracotta configuration file which Spring application context Beans need to be clustered. Terracotta for Spring enables applications to be clustered automatically and transparently, and also ensures the same semantics between clusters and single nodes. For Spring Web Flow, this is actually simpler. In order to obtain the status of web applications and the clustering capability of the persistent repository, users only need to declare a specific Web application as session-support enabled in the Terracotta configuration file. (See “Declarative Configuration” below for details.)
At a macro level, Terracotta for Spring provides:
Cluster with HTTP session status. Ensure high availability and failover of user states in Spring Web Flow and other states that extend the repository or put into HTTP sessions.
Clusters of Spring beans. The lifecycle semantics and domains of Spring Beans are stored across clusters in the same “logically” ApplicationContext. Currently, the bean types that can be clustered are Singleton and Session Scoped. You can declaratively configure which beans in which Application Contexts need to be clustered.
Transparent cluster POJOs. You don’t need to modify existing code, or even source code. Applications operate transparently at load time, based on few declarative XML configuration files. Terracotta for Spring does not require classes that implement Serializable, Externalizable, or other interfaces. This is possible because it does not use serialization, but simply transfers the actual difference and changed data to the currently needed node (Lazily).
Virtual memory management. It also provides distributed garbage collection and virtual heap capabilities. For example, since the physical memory can be swapped in and out as needed, it can run Web applications that require 200 GIGABytes of heap on a machine with 4 gigabytes of RAM. This also means that you don’t need to care if the Spring Web Flow session data size exceeds the physical heap size.