Xholon Collections

Ken Webb 2010-04-01T13:29:59Z

Xholon includes several classes that implement Java Collections interfaces.

XholonList implements the java.util.List interface, and extends the Xholon class. It's a Xholon that treats its children as items in a list. It provides a way for a Xholon application to interact with non-Xholon classes, and to include lists as normal nodes in a larger hierarchical structure. A non-Xholon class can use the List methods such as add(Object o), addAll(Collection c), clear(), contains(Object o), get(int index), size(), while a Xholon class can use the IXholon methods such as getParentNode(), getFirstChild(), getNextSibling().

XholonList has been used in Xholon business applications with Hibernate. When Hibernate retrieves records from a database, it returns a Java List. It can be made to return the List as a XholonList. The Xholon application can pass this list from a server to a client, and can then attach the XholonList to a Xholon tree for further processing.

XholonMap implements the java.util.Map interface, and extends the Xholon class. This is used in a number of Xholon services to store maps of alternative implementations of the service allowing a choice at runtime. Each item in the map is the name of an implementation of the service plus the name of the Java class that implements the service. These items are all just nodes in the Xholon tree.

return to main page