diff --git a/notes/01-singleton-builder.md b/notes/01-singleton-builder.md index d4d57fa..5fadf1f 100644 --- a/notes/01-singleton-builder.md +++ b/notes/01-singleton-builder.md @@ -42,7 +42,7 @@ ### Solution -Singleton pattern is a creational design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance. To implement the Singleton patter, the following steps are required: +Singleton pattern is a creational design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance. To implement the Singleton pattern, the following steps are required: * `Constructor hiding` - The constructor of the singleton class should be private or protected. This will prevent other classes from instantiating the singleton class. * `Global access point` - The singleton class should provide a global access point to get the instance of the singleton class. This global access point should be static and should return the same instance of the singleton class every time it is called. If the instance does not exist, it should create the instance and then return it. @@ -266,4 +266,4 @@ Database database = new Database.DatabaseBuilder() ## Reading list * [Telescoping constructor anti-pattern](https://www.vojtechruzicka.com/avoid-telescoping-constructor-pattern/) -* [Why objects should be immutable?](https://octoperf.com/blog/2016/04/07/why-objects-must-be-immutable) \ No newline at end of file +* [Why objects should be immutable?](https://octoperf.com/blog/2016/04/07/why-objects-must-be-immutable)