Poltergeist (computer programming)

In computer programming, a poltergeist (or gypsy wagon) is a short-lived, typically stateless object used to perform initialization or to invoke methods in another, more permanent class.

The original definition is by Michael Akroyd at the 1996 Object World West Conference:[citation needed] As a gypsy wagon or a poltergeist appears and disappears mysteriously, so does this short lived object.

The typical cause for this anti-pattern is poor object design.A poltergeist can often be identified by its name; they are often called "manager_", "controller_", "supervisor", "start_process", etc.

Sometimes, poltergeist classes are created because the programmer anticipated the need for a more complex architecture.

For example, a poltergeist arises if the same method acts as both the client and invoker in a command pattern, and the programmer anticipates separating the two phases.