본문 바로가기

Mastering Python Design Patterns15

The Decorator Pattern 5 The Decorator Pattern As we saw in the previous chapter, using an adapter, a first structural design pattern, you can adapt an object implementing a given interface to implement another interface. This is called interface adaptation and includes the kinds of patterns that encourage composition over inheritance, and it could bring benefits when you have to maintain a large codebase. A second in.. 2023. 3. 22.
The Adapter Pattern 4 The Adapter Pattern In the previous chapters, we have covered creational patterns, object-oriented programming patterns that help us with object creation procedures. The next category of patterns we want to present is structural design patterns. A structural design pattern proposes a way of composing objects for creating new functionality. The first of these patterns we will cover is the adapt.. 2023. 3. 22.
Other Creational Patterns 3 Other Creational Patterns In the previous chapter, we covered a third creational pattern, that is, builder, which offers a nice way of creating the various parts of a complex object. Besides the factory method, the abstract factory, and the builder patterns covered so far, there are other creational patterns that are interesting to discuss, such as the prototype pattern and the singleton patte.. 2023. 3. 22.
The Builder Pattern 2 The Builder Pattern In the previous chapter, we covered the first two creational patterns, the factory method and abstract factory, which both offer approaches to improve the way we create objects in nontrivial cases. Now, imagine that we want to create an object that is composed of multiple parts and the composition needs to be done step by step. The object is not complete unless all its part.. 2023. 3. 22.
The Factory Pattern Design patterns 참조 book Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 객체 지향 프로그래밍 에서 사용되는 디자인 패턴에는 여러 범주가 있으며 , 해결하는 문제의 유형 및/또는 빌드하는데 도움이 되는 솔루션의 유형에 따라 다릅니다. 그들의 저서에서 The Gang of Four는 23가지 디자인 패턴을 제시하며 creational, structural, behavioral의 세 가지 범주로 나뉩니다 . These patterns deal with different aspects of object creati.. 2023. 3. 22.
Index Mastering Python Design Patterns Second Edition Preface Python is an object-oriented scripting language that is used in a wide range of categories. In software engineering, a design pattern is a solution for solving software design problems. Although they have been around for a while, design patterns remain one of the hot topics in software engineering and are a good source of information for so.. 2023. 3. 22.