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: learning-python-design-patterns/notes.md
+40-1Lines changed: 40 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,45 @@ Author: Chetan Giridhar
84
84
> **Derived classes must be able to completely substitute the base classes**
85
85
86
86
## The concept of design patterns
87
-
87
+
- Solutions to given problems
88
+
- Design patterns are discoveries and not a invention in themselves
89
+
- Is about learning from others' successes rather than your own failures!
90
+
91
+
### Advantages of design patterns
92
+
- Reusable across multiple projects
93
+
- Architectural level of problems can be solved
94
+
- Time-tested and well-proven, which is the experience of developers and architects
95
+
- They have reliability and dependence
96
+
97
+
### Patterns for dynamic languages
98
+
Python:
99
+
- Types or classes are objects at runtime
100
+
- Variables can have type as a value and can be modified at runtime
101
+
- Dynamic languages have more flexibility in terms of class restrictions
102
+
- Everything is public by default
103
+
- Design patterns can be easily implemented in dynamic languages
104
+
105
+
## Classifying patterns
106
+
- Creational
107
+
- Structural
108
+
- Behavioral
109
+
110
+
> Classification of patterns is done based primarily on how the objects get created, how classes and objects are structured in a software application, and also covers the way objects interact among themselves
111
+
112
+
### Creational patterns
113
+
- Work on the basis of how objects can be created
114
+
- Isolate the details of object creation
115
+
- Code is independent of the type of object to be created
116
+
117
+
### Structural patterns
118
+
- Design the structure of objects and classes so that they can compose to achieve larger results
119
+
- Focus on simplifying the structure and identifying the relationship between classes and objects
120
+
- Focus on class inheritance and composition
121
+
122
+
### Behavioral patterns
123
+
- Concerned with the interaction among objects and responsibilities of objects
124
+
- Objects should be able to interact and still be loosely coupled
0 commit comments