This package holds the Hierarchical Graph (henceforth abbreviated H-Graph)
data structure. It has within Palcom been used to accommodate for primarily
the inspectability experimentability qualities, but also to a certain
extent others. The Palcom Open Architecture sports a pervasive use of
it as a dynamic runtime data structure. The primary benefit and novelty
of this comes not as much from the datastructure itself, more than it is a
consequence of its use.
As such, the use contains several perspectives. Firstly, the H-Graph is used
for structuring and accessing/inspecting most non-transient elements
of any process in a runtime environment. That is, both ontological
functional entities as well as their data. Secondly, the H-Graph
facilitates a simple message-passing and handling mechanism for
inter-node messaging. Thirdly, the H-Graph act as a reflective
mechanism facilitating, amongst others, inspection.
Package Specification
In general the intention is for H-Graphs to be used instead of
inventing ad-hoc data structures. It is, as stated, a dynamic
graph-esque runtime data structure. The ontology of H-Graphs is an
extension of the ontology of standard object graphs used in
object-oriented programs. It consists of the following elements:
- H-Graph Node H-Graph nodes are the vertices of the hierachical
graph. H-Graph nodes have names and these names are required to be
unique amongst siblings. H-Graph Node names are transient and thus
allowed to change over time. H-Graph Nodes pass H-Graph Events to
each other along the Child-Parent Relationship. The H-Graph Node /
Object could be considered at the level where it is like an object
with a set of extra mandatory operations.
- Child-Parent Relationship The containment relation by which one
H-Graph node is subordinated another in the hierachy. H-Graph nodes
have no or one parent and no or more children. H-Graph nodes with
the same parent are siblings. The Child-Parent Relationship thus
defines the hierarchical nature of the H-Graph.
- Path A sequence of names of H-Graph nodes at progressively
lower hierachical levels. H-Graph nodes have a path at any given
time. No two different H-Graph nodes can have the same
path. Colloquially, Paths are just like those in a file
system. Paths can be seen as symbolic references, allowing for
symbolic-path relationships to other nodes in the hierarchy.
- Sibling RelationshipA type of edge that can only exist between
the H-Graph Nodes at the same level in the hierarchy. Sibling
relationships are based on the names of the node end points. Thus,
they are maintained when possible if one of the node end points
change. The Sibling Relationship thus defines the graph-like nature
of the H-Graph, and allows for regular object graphs, each within a
given level in the hierarchy.
- H-Graph Event The type of message passed between H-Graph
Nodes. H-Graph Events have a receiver and a sender Path giving the
end points of its journey. H-Graph Events have a Command string
designating the type of event. It may have a Return Command
designating the type of an eventual return event. H-Graph Events may
further carry a payload in the form of a Value.
- Handler H-Graph node analogous of provided method(s). Handlers
are associated with H-Graph nodes in a dynamic fashion, in the sense
that they can be added and removed at runtime. Handlers are the end
points that handle H-Graph Events based on their Commands and
Values. As such, they provide the one part of the functional link to
the H-Graph kontext. Handlers are named, though not uniquely, and
have a description outlining the purpose of the Handler.
- Invokator H-Graph node analogous of required
method(s). Invokators are, like Handlers associated with H-Graph
Nodes in a dynamic fashion. Invokators are the start points of
H-Graph Events, in that they instatiate those and start passing them
through the H-Graph structure via their H-Graph Node. As such, they
provide the other part of the functional link to the H-Graph
context. Invokators are named, although not uniquely, and have a
description outlining their purpose.
- Listener H-Graph node analogous of event callback(s). Like
Handlers and Invokators are Listeners dynamically associated with a
given H-Graph Node. Listeners are invokated on the basis of trigger
events which are, basically, all node state changing
events. Listeners invoke return events to the listening node and, as
such, have a return Path and Command and may have pass a payload
along.
- Value Values are encapsulated non-H-Graph node entities
associated with some given H-Graph node. Values have names. Value
names are within a given H-Graph context unique.
The notion of H-Graphs is historically tied to, the within Palcom
previously used, concept of H-Maps (an abbreviation for Hirarchical
Maps). Inspired by the Plan 9 OS from Bell Labs and the Linux /proc
file system, the previously used Corundum framework uses a hierarchical
map to support the implementation of palpable components, services and
devices. In particular, the use of the externally accessible hierarchical map
supports construction/deconstruction of assemblies of services, and
visibility and introspection of services and applications.
Although their historical relation, H-Graphs differ from H-Maps in
several senses. Mainly, given their sibling reference concept and
therefrom their secondary graph-like nature, the H-Graphs are not
strictly hirarchical like H-Maps. Instead, they can be seen as
hirerchically ordered graphs with a primary child-parent relationship
and a secondary sibling relationship.