Area

Area is an instrument which breaks down need for full processing of Context chains and Element mutation generations in cascade.

Context cascades and ElementPure mutation generations hold linked chains of mirror tables. When a reference is being resolved in given Context, its all non-empty mirror tables must be queried so that any applicable mirrors are used. That involves querying "obviously irrelevant" mirror tables. In order to skip those, an "Area of relevance" is introduced. Areas are somewhat similar to generations in generational garbage collectors.

We split ElementPure items into Areas and chain them using MirrorsHolder links. When a reference is being translated, only "more relevant" mirrors are checked. This gains us lookup speed with little overhead.

Another way would be to merge mirror maps for every Context layer (or every N-th). It would have hard processing drawback when the system uses many mirrors - which are the keystones of Reusable Objects.

Area

  • applies hash distribution to chained lists or maps
  • not a Scope
    • that is a hierarchical tree of inclusive scopes. When given Context searches for mirrors of an Element, it would check mirrors in all Scopes descendant from given Element's Scope.
    • Context stores lowest common Area of all its mirrors
      • because of dynamic object flow and control flow, it's impossible to keep Elements and their mutations accessible only within given subscope. Therefore 
    • it was implemented with O(log N) time cost of isChildOf(), and O(N) space cost - net.sf.reuse.attic
  • Area makes Context.previous and Element.original chains apply only those mirrors which are relevant to the reference being resolved.

SourceForge.net Logo Copyright (c) 2005, 2006, 2007 Peter Kehl