mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-30 19:50:12 +02:00
README Multiton
This commit is contained in:
@@ -3,20 +3,7 @@
|
||||
namespace DesignPatterns;
|
||||
|
||||
/**
|
||||
* Multiton pattern
|
||||
*
|
||||
* --------------------------------------------------------------------------------------------------------------
|
||||
* 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)
|
||||
*
|
||||
*
|
||||
* class Multiton
|
||||
*/
|
||||
class Multiton
|
||||
{
|
||||
|
12
Multiton/README.md
Normal file
12
Multiton/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# 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)
|
Reference in New Issue
Block a user