code: function AggregateFunction() {
    var self = this;
    // function type can be one of
    // - simple (default)
    // - ordered - will require window to store elements in arrival and sorted order
    //
    self.type = "simple";
    // invoked when a window opens - should 'reset' or 'zero' a windows internal state
    self.init = function() { throw "Must subclass"; };
    // invoked when an event is enqueued into a window
    self.accumulate = function(value) { throw "Must subclass"; };
    // invoked to compensate sliding window overwrite
    self.compensate = function(value) { throw "Must subclass"; };
    // invoked when a window closes
    self.emit = function() { throw "Must subclass"; };
    // used by window implementations variously to preallocate function instances - makes things 'fast', basically
    self.make = function(win) { throw "Must subclass"; };
  }
docs: Constraints computations on event streams to a simple functional contract