traits
traits copied to clipboard
Rename ObserverGraph.node to ObserverGraph.observer
Suggestion for readability and accessibility of the observe code to newcomers: rename ObserverGraph.node
to ObserverGraph.observer
. "node" is a generic term that doesn't describe well what it refers to. The object referred to is an IObserver
instance, which doesn't always exist as a node on a graph - it's used by the ObserverExpression
, too.
This would be backwards compatible change from the point of view of Traits users: ObserverGraph
isn't directly accessible to users, and the ObserverGraph
class is not part of any published API; it would only affect developers of Traits itself.
Deferring this; this is not an urgent change, but should be made at some point before the 7.0.0 release.
The naming issue extends beyond that one attribute, and there may be a slightly larger rework that's useful here. What's really going on is that ObserverGraph
itself is misnamed: ObserverGraph
represents a node on the full graph. So a more comprehensive proposal would involve:
- renaming the
node
attribute toobserver
, as in the original description - renaming
ObserverGraph
toObserverNode
- possibly reintroducing
ObserverGraph
as a collection of rootObserverNodes
- the fundamental object that we're passing around everywhere is actually a list ofObserverGraph
objects; that list possibly deserves to be a class in its own right.