You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ some of the Design Patterns available in JAVA are:
22
22
- Singleton pattern is one of the simplest design patterns in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.
23
23
- This pattern involves a single class which is responsible to create an object while making sure that only single object gets created. This class provides a way to access its only object which can be accessed directly without need to instantiate the object of the class.
@@ -30,6 +31,7 @@ some of the Design Patterns available in JAVA are:
30
31
- Factory pattern is one of the most used design patterns in Java. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.
31
32
- In Factory pattern, we create object without exposing the creation logic to the client and refer to newly created object using a common interface.
@@ -38,6 +40,7 @@ some of the Design Patterns available in JAVA are:
38
40
- Builder pattern builds a complex object using simple objects and using a step by step approach. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.
39
41
- A Builder class builds the final object step by step. This builder is independent of other objects.
@@ -46,6 +49,7 @@ some of the Design Patterns available in JAVA are:
46
49
- Prototype pattern refers to creating duplicate object while keeping performance in mind. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.
47
50
- This pattern involves implementing a prototype interface which tells to create a clone of the current object. This pattern is used when creation of object directly is costly. For example, an object is to be created after a costly database operation. We can cache the object, returns its clone on next request and update the database as and when needed thus reducing database calls.
@@ -62,6 +67,7 @@ some of the Design Patterns available in JAVA are:
62
67
- Facade pattern hides the complexities of the system and provides an interface to the client using which the client can access the system. This type of design pattern comes under structural pattern as this pattern adds an interface to existing system to hide its complexities.
63
68
- This pattern involves a single class which provides simplified methods required by client and delegates calls to methods of existing system classes.
@@ -70,6 +76,7 @@ some of the Design Patterns available in JAVA are:
70
76
- Composite pattern is used where we need to treat a group of objects in similar way as a single object. Composite pattern composes objects in term of a tree structure to represent part as well as whole hierarchy. This type of design pattern comes under structural pattern as this pattern creates a tree structure of group of objects.
71
77
- This pattern creates a class that contains group of its own objects. This class provides ways to modify its group of same objects.
@@ -78,6 +85,7 @@ some of the Design Patterns available in JAVA are:
78
85
- Decorator pattern allows a user to add new functionality to an existing object without altering its structure. This type of design pattern comes under structural pattern as this pattern acts as a wrapper to existing class.
79
86
- This pattern creates a decorator class which wraps the original class and provides additional functionality keeping class methods signature intact.
@@ -86,6 +94,7 @@ some of the Design Patterns available in JAVA are:
86
94
- Flyweight pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance. This type of design pattern comes under structural pattern as this pattern provides ways to decrease object count thus improving the object structure of application.
87
95
- Flyweight pattern tries to reuse already existing similar kind objects by storing them and creates new object when no matching object is found.
@@ -95,6 +104,7 @@ some of the Design Patterns available in JAVA are:
95
104
- This pattern involves a single class which is responsible to join functionalities of independent or incompatible interfaces. A real life example could be a case of card reader which acts as an adapter between memory card and a laptop.
96
105
- You plugin the memory card into card reader and card reader into the laptop so that memory card can be read via laptop.
@@ -104,6 +114,7 @@ some of the Design Patterns available in JAVA are:
104
114
- This pattern involves an interface which acts as a bridge which makes the functionality of concrete classes independent from interface implementer classes.
105
115
- Both types of classes can be altered structurally without affecting each other.
@@ -112,5 +123,6 @@ some of the Design Patterns available in JAVA are:
112
123
- Observer pattern is used when there is one-to-many relationship between objects such as if one object is modified, its depenedent objects are to be notified automatically.
113
124
- Observer pattern falls under behavioral pattern category.
0 commit comments