Summary
Flow definitions have two levels of granularity, shown in Table 12-1.
Table 12-1.Flow Definition
Flow Artifact Appropriate Use
Top-level flow Defines an entire use case that can be reused in other contexts as a subflow.
Responsible for completing a logical application transaction.
Inline flow Defines an application transaction that is encapsulated within a larger use case
and is fully contained within the larger flow.
The key point to take away is that a flow always represents a controlled navigation that
accomplishes a logical unit of work for a single user.Whether it should be a top-level flow or
inline flow is dependent upon whether the flow logic should be reused in other contexts.
At the start of a flow definition process it is best not to worry too much about whether a
flow should be a top-level flow or an inline flow. The need for extracting flows has a tendency
to identify itself in the same way a method, or an interface naturally manifests itself as devel-
opment progresses. The key point is to ensure that a flow models a cohesive application
transaction.
CHAPTER 12 ■ADVANCED SPRING WEB FLOW 345