-
Notifications
You must be signed in to change notification settings - Fork 0
/
Easy Understanding.txt
72 lines (49 loc) · 3.31 KB
/
Easy Understanding.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
1️⃣ Creational Patterns:
These types of pattern basically focuses on creation of objects, ensuring the objects are created in controlled manner.
1. Singleton:
Ensures a class has only one instance and provides a global point of access to it.
2. Factory Method:
Defines an interface for creating an object but allows subclasses to alter the type of objects that will be created.
3. Abstract Factory:
Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
4. Builder:
Separates the construction of a complex object from its representation, allowing the same construction process to create different representations.
5. Prototype:
Allows cloning of existing objects without modifying the original object, promoting object reuse.
2️⃣ Structural Patterns:
Structural design pattern focuses on relationship between the classes and objects.
1. Adapter:
Allows incompatible interfaces to work together by converting the interface of a class into another interface that clients expect.
2. Bridge:
Separates an object’s abstraction from its implementation so that both can vary independently.
3. Composite:
Composes objects into tree structures to represent part-whole hierarchies, allowing clients to treat individual objects and compositions uniformly.
4. Decorator:
Adds new functionalities to an object dynamically without altering its structure, enhancing its behavior.
5. Facade:
Provides a simplified interface to a complex subsystem, making it easier for clients to interact with the system.
6. Flyweight:
Reduces memory usage by sharing common parts of state among multiple objects, allowing for efficient management of large quantities of similar objects.
7. Proxy:
Provides a surrogate or placeholder for another object to control access to it, enabling lazy loading, access control, or logging.
3️⃣ Behavioural Patterns:
These patterns focus on communication and the interaction between objects. They help to define the flow of control and data in complex systems.
1. Chain of Responsibility:
This type of pattern will let you pass request as a chain (handlers). Each handler will decide to pass or reject based on some conditions.
2. Command:
This type of pattern will help to perform and display the result based on same commands as mediator.
3. Iterator:
This pattern focuses on traverse collection without exposing their internal structures.
4. Mediator:
This pattern is like a common person who takes are communication between other objects (a medium).
5. Memento:
Pattern which stores the previous save and restore the previous state of an object without revealing the details of implementation.
6. Observer:
Obeserver pattern is one to many relationship.
In easier way, relationship between youtube channel and subscribers (like us) where we are notified only after we are pressing the bell icon only if they there is a new video is been uploaded.
7. State:
State pattern is similar to if-else condition, where it will work efficiently if multiple conditions are need to assign.
8. Strategy:
Set some strategies and runs when user wants to implement in a particular method.
9. Template:
Basically a temaplate to use whenever we want also we can modify the template.