To provide the exchangability of the graph system this interface was introduced. For each graph system that is to be used with OpenCAGE, an adapter has to be written. This adapter maps the interface of the graph system to the Graph Interface (GIF) and it possibly implements functionality which is required by the Graph Interface (GIF) which is not supported by the graph system.
An adapter has to implement the following classes:
Edge_Model and Node_Model. Implementations of these classes represent the nodes and edges.
Specific_Model_Factory. The implementation of this abstract class reads all data which is relevant for the adapter from a file and provides the Nodes and Edges.
Display_Factory. The implementation of this abstract class is responsible for creating a controller and display which is used to show the content of a node.
The classes forming the Graph Interface (GIF) are mostly abstract classes which have to be implemented by the concrete Adapter. The Graph_Factory is the only concrete class which handles the administration of implementations of Specific_Model_Factory and Display_Factory.
Implementations of Node_Model and Edge_Model provide access to the data structures, specified by this graph system. The access methods give a hierarchical view to the underlying graph system.
To use a specific graph system, you have to implement a Specific_Model_Factory as well as a Display_Factory. The method Open_File of the Specific_Model_Factory triggers the whole process of loading the data from file into the appropriate structures of this graph system.
The Graph_Factory is the point where it all begins. For every graph system which is supported by OpenCAGE there is a instance of Specific_Model_Factory registerd at the Graph_Factory. So this Factory is able to delegate the reading of a file which is to be read to the appropriate Specific_Model_Factory.
The XML_Model_Factory is only a example for another model factory to illustrate how it is supposed to work.
The behaviour of the method Create_Display of the concrete Display_Factory is implemented specific.
For the implementation of this interface with the RFG see Overview (the Section called Overview in Chapter 4).