--- url: "https://www.enterpriseintegrationpatterns.com/patterns/conversation/IncrementalStateBuild.html" titulek: "Incremental State Build-up - Enterprise Integration Patterns 2" h1: "" popis: "Enterprise Integration Patterns" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-15 14:54:16" znaku: 2902 slov: 432 kodovani: "utf-8" sha256: "7ff425928f5ef79021fe05455f64317fc50be0de87a8e653c8860c1ba82a12f7" --- | | Incremental State Build-up[Conversation Patterns](index.html) » [Resource Management](ResourceIntro.html) | [Contents](toc.html)[⇐ Prev](ResourceIntro.html)[Next ⇒](Lease.html) | | --- | --- | --- | Stuttering A participant transmits information to a conversation partner. How can a participant invoke an operation when the it does not have all required information available at the same time? The initiator could store data locally until all elements are present, which requires it to hold local state. The client may be be desired to be stateless or unreliable, which makes holding local state difficult.The data set may be very large and exceed the message size allowed by the system or a practical limit. In this case, the initiator may consider using a [*Claim Check*](/patterns/messaging/StoreInLibrary.html) if the system provides such a service. The requestor transmits information incrementally until it is ready to execute the operation. The *Incremental State Build-up* conversation involves the following participants: - The *Requestor* transmits data via multiple *Data* messages and finally invokes the *Operation* . Invoking the operation may coincide with the last data message (implicit invocation) or via a separate message (explicit invocation). - The *Provider* accepts a sequence of *Data* messages and collects the state contained in them. When it receives the final *Data* message or an *Operation* message it invokes an operation based on the collected data. *Incremental State Build-up* requires the provider to allocate resources for the convenience of the consumer. It should therefore employ resource management, such as a [*Lease*](Lease.html). After the invocation of the operation the *Provider* may immediately release the collected data or keep it for subsequent operations. If it keeps the data, the need for a [*Lease*](Lease.html) increases. The incremental transmission can occur in two "flavors": - Building a large data set, i.e. transmitting sections of the same type of data. In this case the number of *Data* messages is typically not limited. - Building a complex structure, i.e. transmitting different data types. In this case, each message tends to transmit a different element of the structure. thus the number of *Data* messages is limited, but it does not have to be fixed as some elements may be optional. *Incremental State Build-up* introduces a strong form of coupling and chatty network traffic. Because it is stateful, it also requires "stickiness", i.e. the initiator always has to talk to the same provider instance unless the state is explicitly shared across providers. This limits scalability. *Incremental State Build-up*should therefore be used with caution. In some cases the finer granularity of the incremental requests can aid reuse if each request relates to a different business entity. **Related patterns:**[*Lease*](Lease.html), [*Claim Check*](/patterns/messaging/StoreInLibrary.html) ---