[Lemon-devel] alteration notifier
Balazs Dezso
deba at inf.elte.hu
Mon Jul 21 11:54:16 CEST 2008
Hi
I would like to write about some information about the alteration notifier in
the lemon graphs. I worked on the graph adaptors, and I found some
inconsistency or open questions.
The aim of the lemon alteration notifier is to provide an observing mechanism
for an item set. The alteration notifier signals the item additions the
erasures in the set. In addition, it provides interface for enumerate the set.
The enumeration and the signals should be strictly consistent, each enumerated
item should be signaled beforehand, and each erased item should not be
enumerated anymore. The order, in details, should follow the forthcoming
order: the added item should first inserted into the enumeration list, after
that it should be signaled, the erased item should be first signaled, and then
it should be removed from the list.
The calling order of the observers are also important in this system. The
later attached observers get signaled later for addition, but earlier for
erasures. If concurrent events are happening in the graph, then for additions,
first the node like events should be signaled, after that the edge likes, while
for erasures it is exactly the opposite.
The next issues should be discussed:
- The graph maps usually use the alteration notifiers, but some graph adaptor
maps (for example SVN UndirGraphAdaptor::EdgeMap) is not inherited from an
observer base. It made impossible to use with DescriptorMap, InvertableMaps
(which uses the observing)
- Should be the notifier consistent to the graph iterators? Sometimes, the
graph iterators can be provide just a subset of the observer's set. It is
impossible to solve it correctly...
- The item sets sometimes quite different from original graphs (for example
UndirGraphAdaptor or SplitGraphAdaptor). There is a possibility to add notifier
proxies to this graph adaptors, but it has a quite big limitation. If we add a
map and after that an observer to the graph, then the map is composed from
maps of original graphs, and it is attached just on time. However, the
observer is attached to the proxy, which will signaled earlier than the map,
and it violates the rule of the observer order. It could be solved with own
proxy for each observer, but it would make necessary some redesign of whole
observer interface.
- Should each adaptor signal the changes? It is important for use with
In/OutDegMap, EdgeSets, DescriptorMap...
Best: Balazs
More information about the Lemon-devel
mailing list