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
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,6 @@ While classes and encapsulation are generally recommended,
41
41
it's essential to consider the specific requirements of your project.
42
42
In some cases, using global variables might be appropriate, but it's crucial to be mindful of the potential drawbacks mentioned above. Striking a balance and following good design principles will contribute to more maintainable and scalable code.
43
43
44
-
45
44
## Singleton Pattern
46
45
47
46
@@ -55,8 +54,19 @@ The monostate pattern will create instances or objects with their own identity t
55
54
It is often referred to as the Borg pattern in reference to The Borg in Star Trek.
56
55
While being individuals in their own right, they all share the same collective consciousness or shared state.
57
56
57
+
## Other Useful Patterns
58
+
58
59
## Factory Pattern
59
60
60
61
The Factory Pattern is to define an interface for creating an object, but leave the choice of its type to the subclasses,
61
62
deferring the instantiation to the subclasses. Objects are created by calling a factory method
62
-
instead of calling a constructor.
63
+
instead of calling a constructor.
64
+
65
+
## Builder Pattern
66
+
67
+
The Builder Pattern is a creational design pattern used to construct complex objects step by step.
68
+
It separates the construction of a complex object from its representation. i.e. keep the process of putting
69
+
it together separate from how it's actually represented or used in the program. This way, the same
70
+
construction process can create different representations.
71
+
Imagine you have an order for a new laptop. You will pick the processor, ram, screen size, memory , mouse, warranty and many other options.
72
+
The builder pattern will allow for many different laptop variations.
0 commit comments