Ken Irving - 2008-03-01

This shouldn't be surprising, I suppose, but I happened on a simple problem that perhaps can demonstrate that this object oriented system works.

TimeSeries is a general-purpose class with the task of managing time-stamped data.  A timeseries-html method is defined in the class in order to present a web-view of the contained data.  The data is presented in sorted order by time, but with an optional tag value as the primary sort key.

An application class inherits from TimeSeries, and uses a numeric-based tag of the form: id-count.  The output of the timeseries-html method in one case was:

    106-10
    106-4
    106-8
    106-9

I'd prefer this to be in ascending numerical order, but these tags won't sort that way even using a numeric sort, since it's not a simple number.

The timeline-html method calls a timeline method to retrieve the metadata to display, and itself merely formats these data for the web page.  I first tried subclassing timeline in order to re-sort the data, but it turns out that timeline-html also does its own sorting, so this was ineffective.

The solution was to zero-pad the tag count field in the timeline subclassed method, so that simple lexical sorting, really the only possible kind, has the desired result, so that the output is now:

    106-04
    106-08
    106-09
    106-10

This is a good enough workaround for the problem at hand.

The point of this missive is just that this works very well.  It uses classic object oriented inheritance, overriding of a method, and calling a superclass method from within the subclass method.

Hmm... not sure how to diagram this...

    object        class        superclass
   
    timeline-html ------------------^
         +-----> timeline ------->timeline

Anyway... the thinobject system seems to be holding up its end of things.