The Web Graph Database


The Factory Pattern in InfoGrid

InfoGrid uses the factory pattern extensively throughout the code base.

  • Many classes have protected constructors and offer public, static factory methods called create, or a variation, instead
  • The abstract Factory interface in package org.infogrid.util is used wherever appropriate.

Two subtypes of Factory are notable:

  • SmartFactory is implemented by those classes that act as Factory for some objects, but keep a record of already-created objects and return those instead of newly created objects under some circumstances (that depend on the particular `Factory).
  • PatientSmartFactory optimizes the SmartFactory algorithm for those objects whose creation may take a long time, while the SmartFactory may be invoked concurrently by several threads.
Last modified 9 years ago Last modified on 01/19/10 05:56:17