The syntax of hierarchy

Ken Webb 2010-01-15T19:48:06Z

Software developers use hierarchical structure in various ways. This page summarizes some actual syntax.

Contents


Xholon

IXholon IXholon.getParentNode()
IXholon IXholon.getFirstChild()
IXholon IXholon.getNextSibling()

The Xholon API is based on the Java binding in the XML DOM specification. This syntax was chosen because it supports the no arbitrary restrictions (NAR) principle, and the related concept of mathematical closure. All three of these operations return the same type that they act on. For example, a node that implements IXholon can call the getParentNode() method to get another node that implements IXholon.

Another reason is that this syntax is self focused. It is local rather than global. To locate its immediate local neighbors (its parent, its first child, and its next sibling), a node does not need to know its own location within an array or list of children of its parent.

XML/HTML DOM (Java binding)

Node Node.getParentNode()
Node Node.getFirstChild()
Node Node.getNextSibling()

Node is the base interface in the w3c Document Object Model (DOM).

XML/HTML DOM (ECMAScript/JavaScript binding)

Node Node.parentNode
Node Node.firstChild
Node Node.nextSibling

Node is the base interface in the w3c Document Object Model (DOM).

Java AWT/Swing

Container Component.getParent()
Component[] Container.getComponents()
Component getComponent(int n)
int getComponentCount()

Component is the base class for all classes in AWT and Swing. Container is an immediate subclass of Component.

Java Eclipse SWT

Widget(Widget parent, int style)
Composite Control.getParent()
Control[] Composite.getChildren() 

The class inheritance hierarchy is as follows.

org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
 org.eclipse.swt.widgets.Scrollable
  org.eclipse.swt.widgets.Composite

Java GWT

Widget Widget.getParent()

XPath

parent::
child::
next-sibling::

Smalltalk/V (1991)

Window Window.parent
OrderedCollection Window.children

GoF Design Patterns - Composite pattern

Component Component.GetChild(int)
Component Component.getParent()

Java class inheritance hierarchy

Class Class.getSuperclass()

jQuery (JavaScript)

parentNode
children("*[nodeType=1]")[0]
next("*[nodeType=1]")[0]

binary tree

parent
leftChild
rightChild
sibling

return to main page