We could of course engineer the services to merely listen for any event in the HDM and then decide whether or not to act on it. However, this model is highly inefficient for the programmer who must decide if the object that triggered the event is one of interest. It would be much more preferable to describe interest in a sub-graph. To facilitate this, Haystack includes the HsDispatcher service. HsDispatcher acts as an intermediary between event driven services and the data model.
There are two orthogonal aspects of the HsDispatcher's job. The first is to distinguish between the events triggered in the HDM. The second is to distinguish between structures in HDM. Events can be enumerated (as we do below), but the general graph ismorphism problem is believed to be NP-hard. Therefore, allowing services to express interest in arbitrary graph structures would prove infeasible. Rather we concentrate on what we call star graphs.