Transaction Idiom

Intent

The active object Transaction pattern is a structural pattern that is used by a context to track many simulaneous asynchronous ITC client requests to servers that it uses to accomplish its goals. A Transaction is a kind of "helper" active object that always executes using the same thread as its context.

Transactions are commonly used by Services and Parts to corrdinate multiple asynchronous ITC client transactions with the ITC servers that it uses. The active object diagram below illustrates the temporal aspects of Transactions within the ITC communication framework.

Transaction Temporal

The static structure of a Transaction with respect to the implementation language is shown in the diagram below.

Transaction Context 1

Note that a Transaction is tightly coupled to its context. As a result, it is often declared as a member class of its context and thus the notation Context::Transaction.

Also notable is the circular dependency between the Context and its transaction. While this is generally a bad thing in object oriented programming, this is an exception that is allowed because of the tight coupling and implementation specific mission of the Transaction.

The following diagram illustrates several other properties of the Transaction idiom.

Transaction Context 2

This diagram illustrates the fact that Transactions are frequently used in the implementation of various active objects including Services and Parts. Also emphasized in this diagram is the fact that a context may contain many instances and types of Transactions.

Context

This diagram shows the Transaction idiom with respect to other idioms.

ITC Patterns and Idioms Diagram