|
3 | 3 | ## OOP
|
4 | 4 | - <strong><a href="1_oop/" target="_blank">What Is OOP ?!</a></strong>
|
5 | 5 |
|
6 |
| -## Design Patterns |
7 |
| - reusable solution to a commonly occurring problem within a given context in software design. |
8 |
| - --- |
9 |
| - It is not a finished design that can be transformed directly into source or machine code. Rather, it is a description or template for how to solve a problem that can be used in many different situations. |
10 |
| - --- |
11 |
| - Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. |
12 |
| - --- |
13 |
| - Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved. |
14 |
| - --- |
15 |
| - Patterns that imply mutable state may be unsuited for functional programming languages. |
16 |
| - Some patterns can be rendered unnecessary in languages that have built-in support for solving the problem they are trying to solve, and object-oriented patterns are not necessarily suitable for non-object-oriented languages. |
| 6 | +## **Design Patterns** |
| 7 | +> reusable solution to a commonly occurring problem within a given context in software design. |
| 8 | +
|
| 9 | +- It is not a finished design that can be transformed directly into source or machine code. |
| 10 | + - Rather, it is a *description* or *template* |
| 11 | + - for how to solve a problem that can be used in many different situations. |
17 | 12 |
|
| 13 | +- Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. |
18 | 14 |
|
19 |
| -- ### Creational Design Pattern |
| 15 | +- Object-oriented design patterns |
| 16 | + 1. show relationships and interactions |
| 17 | + 1. between classes or objects, |
| 18 | + 1. without specifying the final application classes or objects that are involved. |
20 | 19 |
|
21 |
| - Wikipedia |
| 20 | + > Patterns that imply mutable state may be unsuited for functional programming languages. |
| 21 | + Some patterns can be rendered unnecessary in languages that have built-in support for solving the problem they are trying to solve, and object-oriented patterns are not necessarily suitable for non-object-oriented languages. |
22 | 22 |
|
23 |
| - Are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. |
24 |
| - --- |
25 |
| - The basic form of object creation could result in design problems or in added complexity to the design. |
26 |
| - --- |
27 |
| - Creational design patterns solve this problem by somehow controlling this object creation. |
28 |
| - --- |
| 23 | +--- |
| 24 | +## **Creational Design Pattern** |
29 | 25 |
|
30 |
| - Creational design patterns are composed of two dominant ideas. |
31 |
| - - One is encapsulating knowledge about which concrete classes the system uses. |
32 |
| - - Another is hiding how instances of these concrete classes are created and combined |
33 |
| - Tutorial point |
| 26 | +- **Wikipedia** |
| 27 | + |
| 28 | + - Are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. |
| 29 | + - The basic form of object creation could result in design problems or in added complexity to the design. |
| 30 | + - Creational design patterns solve this problem by somehow controlling this object creation. |
| 31 | + - Creational design patterns are composed of two dominant ideas. |
| 32 | + - One is encapsulating knowledge about which concrete classes the system uses. |
| 33 | + - Another is hiding how instances of these concrete classes are created and combined |
34 | 34 |
|
35 |
| - a way to create objects. |
| 35 | +- **Tutorial point** |
36 | 36 |
|
37 |
| - while hiding the creation logic, rather than instantiating objects directly using new operator. |
38 |
| - |
39 |
| - This gives program more flexibility in deciding which objects need to be created for a given use case. |
| 37 | + - a way to create objects. |
| 38 | + - while hiding the creation logic, rather than instantiating objects directly using new operator. |
| 39 | + - This gives program more flexibility in deciding which objects need to be created for a given use case. |
40 | 40 |
|
41 | 41 |
|
42 |
| - - <strong><a href="creational_design_pattern/factory_method" target="_blank">Factory Method</a></strong> |
43 |
| - - <strong><a href="creational_design_pattern/builder" target="_blank">Builder </a></strong> |
| 42 | +- <strong><a href="creational_design_pattern/factory_method" target="_blank">Factory Method</a></strong> |
| 43 | +- <strong><a href="creational_design_pattern/builder" target="_blank">Builder </a></strong> |
44 | 44 |
|
45 | 45 | ---
|
46 |
| -- ### Structural Design Pattern |
| 46 | +## **Structural Design Pattern** |
| 47 | + |
| 48 | +- **Wikipedia** |
47 | 49 | - Structural patterns are concerned with how classes and objects are composed to form larger structures.
|
48 | 50 | - Structural class patterns use inheritance to compose
|
49 | 51 | interfaces or implementations.
|
50 | 52 | - As a simple example, consider how multiple
|
51 | 53 | inheritance mixes two or more chasses into one. The result is a class that 3 combines the properties of its parent chasses.
|
52 | 54 | <!-- - This pattern is particularly useful for making iridependently developed class libraries work together.
|
53 | 55 | - Another example is the class form of the Adapter pattern. In general, an adapter makes |one interface (the adaptee's) conform to another, thereby providing a uniform abstraction of different interfaces.A class adapter accomplishes this by 1 inheriting privately from an adaptee class. The adapter then expresses its | interface in terms of the adaptee’s. | -->
|
54 |
| - --- |
55 |
| - - tutorial point: |
56 |
| - - These design patterns concern class and object composition. |
57 |
| - - Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities. |
| 56 | + |
| 57 | +- **tutorial point** |
| 58 | + - These design patterns concern class and object composition. |
| 59 | + - Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities. |
58 | 60 |
|
59 | 61 |
|
60 |
| - - <strong><a href="structural_design_pattern/Adapter/" target="_blank">Adapter</a></strong> |
| 62 | +- <strong><a href="structural_design_pattern/Adapter/" target="_blank">Adapter</a></strong> |
61 | 63 |
|
62 |
| - - <strong><a href="structural_design_pattern/bridge/" target="_blank">Bridge</a></strong> |
| 64 | +- <strong><a href="structural_design_pattern/bridge/" target="_blank">Bridge</a></strong> |
63 | 65 |
|
64 |
| - - <strong><a href="structural_design_pattern/facade/" target="_blank">Facade</a></strong> |
| 66 | +- <strong><a href="structural_design_pattern/facade/" target="_blank">Facade</a></strong> |
65 | 67 |
|
| 68 | +--- |
0 commit comments