Skip to content

Commit 69dbc03

Browse files
updated README
2 parents f31e183 + 2221b5f commit 69dbc03

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
**Java Design Patterns are divided into three categories – creational, structural, and behavioral design patterns. This post serves as an index for all the java design patterns articles I have written so far.**
44

5-
6-
[Creational Design Patterns]("#Creational-Design-Patterns")
7-
- [Singleton Pattern]("###Singleton-Pattern")
5+
[Creational Design Patterns](#creational-design-patterns)
6+
- [Singleton Pattern](#singleton-pattern)
87
- Factory Pattern
98
- Abstract Factory Pattern
109
- Builder Pattern
@@ -34,6 +33,11 @@
3433
- Dependency Injection Pattern
3534
- MVC Pattern
3635

37-
# Creational Design Patterns
36+
### Creational Design Patterns
3837
Creational design patterns provide solution to instantiate a object in the best possible way for specific situations
39-
### Singleton-Pattern
38+
#### Singleton-Pattern
39+
To implement a Singleton pattern, we have different approaches but all of them have the following common concepts.
40+
41+
- Private constructor to restrict instantiation of the class from other classes.
42+
- Private static variable of the same class that is the only instance of the class.
43+
- Public static method that returns the instance of the class, this is the global access point for outer world to get the instance of the singleton class.

0 commit comments

Comments
 (0)