Jump to content

Poltergeist (computer programming)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 151.37.27.68 (talk) at 22:29, 21 April 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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 is an example of an anti-pattern.

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

As a gypsy wagon or a poltergeist appear and disappear mysteriously so are this short lived object. As a consequence the code is more difficult to mantain 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.