Skip to content

Commit a12c184

Browse files
committed
Finish ch1 notes
1 parent 576ffe2 commit a12c184

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

learning-python-design-patterns/notes.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,45 @@ Author: Chetan Giridhar
8484
> **Derived classes must be able to completely substitute the base classes**
8585
8686
## 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
125+
126+
# Ch2. The singleton design pattern
88127

89128

0 commit comments

Comments
 (0)