Skip to content

Files

Latest commit

author
Dominik Liebler
Sep 24, 2013
c3ede29 · Sep 24, 2013

History

History
This branch is 1058 commits behind DesignPatternsPHP/DesignPatternsPHP:main.

Multiton

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 24, 2013
Sep 24, 2013

Multiton

THIS IS CONSIDERED TO BE AN ANTI-PATTERN! FOR BETTER TESTABILITY AND MAINTAINABILITY USE DEPENDENCY INJECTION!

Purpose

To have only a list of named instances that are used, like a singleton but with n instances.

Examples

  • 2 DB Connectors, e.g. one for MySQL, the other for SQLite
  • multiple Loggers (one for debug messages, one for errors)