User Tools

Site Tools


notes:misc:software_patterns

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
notes:misc:software_patterns [2018/06/22]
leszek [Dependency Injection]
notes:misc:software_patterns [2018/06/22] (current)
leszek [Singleton]
Line 163: Line 163:
   * Useful for creating manager classes that provide a single point of access to multiple resources, such as a thread manager or an event manager.   * Useful for creating manager classes that provide a single point of access to multiple resources, such as a thread manager or an event manager.
   * Introduces global state and dependencies making your code difficult to unit test.   * Introduces global state and dependencies making your code difficult to unit test.
 +  * Consider introducing a "​session"​ or "​execution context"​ object that would hold all of the state rather than representing the state with multiple singletons.
  
 An implementation of the singleton pattern in C#: An implementation of the singleton pattern in C#:
notes/misc/software_patterns.txt ยท Last modified: 2018/06/22 by leszek