Content deleted Content added
mNo edit summary |
"Pattern" refers to software design patterns here. |
||
Line 8:
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. However, this more complex architecture may actually never materialize.
Poltergeists should not be confused with long-lived, state-bearing objects of a [[Software design pattern|pattern]] such as [[model–view–controller]], or tier-separating patterns such as [[business-delegate]].
To remove a poltergeist, delete the class and insert its functionality in the invoked class, possibly by [[Inheritance (computer science)|inheritance]] or as a [[mixin]].
|