Poltergeist (computer programming)

This is an old revision of this page, as edited by 151.37.16.70 (talk) at 12:10, 22 April 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer programming a Poltergeist or Gypsy Wagon is a short lived object used to perform initialization or to invoke methods in other more permanent class.

A Poltergeist or Gypsy Wagon is an example of an anti-pattern.

The original definition is by Michael Akroyd 1996 - Object World West Conference.

As a gypsy wagon or a poltergeist appear and disappear mysteriously so is this short lived object. As a consequence the code is more difficult to maintain and there is unnecessary resource waste. The typical cause for this antipattern is poor object design. Gypsy wagon can be identified also by their name. Typically these are stateless "supervision" classes, used only to call methods of other classes, so several time are called "manager_" , "controller_", "start_process", etc..

To remove a Gypsy Wagon, delete the class and insert its functionality in the invoked class.