Back to Papers and Articles
Monitoring Business Objects with ECA
Copyright 1996 Management Strategies

Presented at the 1996 OOPSLA Conference

By Leo Hsu and Regina Obe


The ECA (event-condition-action) paradigm is a simple approach for monitoring the states of business objects. ECA adds event handling capabilities to business objects using event hooks. When an event of interest takes place in the business domain, event hooks alert a centralized state monitor. The monitor then takes prescribed steps to inspect the states of objects and, if necessary, to perform remedial actions. Most object-oriented programming environments can accommodate ECA, making it a fast solution for monitoring business objects.

The ECA Paradigm

The ECA triplet consists of a triggering event, a condition, and an action. Inserting event hooks into method definitions creates triggering events. When an object, the triggering object, encounters an event hook during method execution, the event hook passes control flow to a centralized state monitor. The monitor then applies pre-formulated conditions to determine whether the triggering object is in a permissible state. The monitor can query the states of other objects, as necessary, to establish the validity of the state of the triggering object. If the state of the triggering object does not conform to the prespecified condition, then the monitor performs the actions prescribed in the action component of the ECA triplet to amend the situation or to log the state violation.

Advantages of ECA

ECA centralizes monitoring of business objects, allowing the information domain to quickly incorporate general policy changes. Since only the centralized monitor needs to reflect policy changes, individual business objects remain intact. Centralized monitoring also allows for easier detection of conflicting policy implementations as well as a means for organizing and storing business rules.

An Example

The following example demonstrates the monitoring capabilities of ECA. Suppose that a company has a customer class with the following properties and methods:

Class: Customer

Properties: Customer ID, Outstanding Balance

Method: Set Balance

If the company wants the billing department to take action whenever the outstanding balance exceeds $1000, we can insert an event hook into the method for setting the balance, Set Balance. When the balance for a customer changes via Set Balance, the event hook signals the centralized state monitor. The monitor then checks the customer's balance to see if the balance exceeded $1000. If so, the monitor can send a message to the billing department to issue a warning letter or to terminate credit.

The centralized monitoring facilitates amendment of business rules. If the company decides to lower the threshold to $500, only the monitor needs to know, while the customer objects remain unaltered.


[1] Binder, R., "State-based Testing", Object Magazine, July-August 1995.

[2] Knolmayer, G., Herbst, H., Schlesinger, M., "Enforcing Business Rules by the Application of Trigger Concepts", Proceedings Priority Programme Informatics Research, Information Conference Module 1, Berne 1994.

Back to Papers and Articles