diff --git a/pages/Design-Patterns.md b/pages/Design-Patterns.md index 53b0f92..cb3a9a8 100644 --- a/pages/Design-Patterns.md +++ b/pages/Design-Patterns.md @@ -62,6 +62,50 @@ yourself a lot of trouble down the road by using factories. * [Factory pattern on Wikipedia](https://en.wikipedia.org/wiki/Factory_pattern) +## Singleton + +When designing web applications, it often makes sense conceptually and architecturally to allow access to one and +only one instance of a particular class. The singleton pattern enables us to do this. + +{% highlight php %} +