Servant Design Pattern in PHP

Servant design pattern is behavioral design pattern where multiple classes use the servant’s class behavior. To avoid repeating code - DRY. Behavior functionality is defined only in one place - in servant.

The servant design pattern is not a defined pattern in the Gang of Four (GoF) book. It is very similar to the command design pattern but with a bit different solution to the problem.

Servant Design Pattern UML

See Also

GitHub OctocatFound a typo? Something wrong with this content? Just fork and edit it.

Content of this work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license. Code snippets in examples are published under the CC0 1.0 Universal (CC0 1.0). Thanks to all the contributors.