Object Hierarchies

This concerns in particular objects that also have a fle representation, such as links, nodes, persons, plans, etc.

There seems to be some agreement to handle it as follows:

  • There is a BasicXXX interface that, after parsing the (XML) file, contains the same info as the file.  It will NOT contain, say, (hardware) pointers, but rather Id strings.
    The parser and its relation to the XML description can (somehow; ask Dominik) be automatically generated. 
  • There is an implementation, BasicXXXImpl, of that interface.
  • There is another implementation, often just called XXX, that inherits from BasicXXXImpl that also contains hardware pointers.
  • Sometimes, there is an interface called XXX, in which case the implementation is called XXXImpl.

There are two typical ways in which this should be used:

(1) If you can live with XXX, then just use it.

(2) If you need additional attributes to the object (e.g. "cells" in order to obtain a SimLink), then the corresponding subsystem will be called with objects from the "basic" level, i.e. as

Simulation sim = new Simulation( basicNet, ... )

 

(I wrote this after the matsim seminar '08; to be improved ...  Kai)