Apama 10.15.0 | Developing Apama Applications | Developing Apama Applications in EPL | Common EPL Patterns in Monitors | Combining the dictionary and factory patterns
 
Combining the dictionary and factory patterns
The dictionary and factory patterns are often combined. This pattern achieves separation of concerns by using two monitors. The first monitor is responsible for managing global concerns, for example, it ensures that each order has a unique key. The second monitor is responsible for local concerns, for example, it manages all data associated with processing that order.
The example does the following:
1. The OrderFilter monitor accepts NewOrder events and checks for uniqueness of the order key.
2. For all orders with unique keys, the OrderFilter monitor routes a ValidOrder event.