분류 전체보기408 The Prototype Pattern CHAPTER 3 The Prototype Pattern Reality doesn t care if you believe in it. Boba Fett, StarWars extended universe The Problem I can still remember the very first time I wanted to program anything. This was at a time when DOS could not address more than 20 MB at a time, and thus our massive 40 MB hard drive had to be partitioned into two drives. It was a beige Olivetti XT. The local library had a .. 2023. 3. 28. The Singleton Pattern The Problem We only have a single file to update. Let s create a new file called logger.py and write the following code in the file: logger.py def log_message(msg): with open("./var/log/filename.log", "a") as log_file: log_file.write("{0}\n".format(msg)) if __name__ == "__main__": log_message("error!") Now, we can use our new logger function to write log messages to the file system in our main_s.. 2023. 3. 28. Before We Begin Becoming a Better Programmer To become a better programmer, you need to decide to obsess about mastery. Every day is a new opportunity to become better than the day before. Every line of code is an opportunity to improve. How do you do that? When you must work on a piece of existing code, leave the code better than you found it. Try to complete a quick problem-solving challenge every day. Look f.. 2023. 3. 28. Index Practical Python Design Patterns: Pythonic Solutions to Common Problems Wessel Badenhorst Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book s product page, located at www.apress.com/9781484226797. For more detailed information, please visit http://www.apress.com/source-code. Printed on acid-free paper For Tanya, m.. 2023. 3. 28. UML 다이어그램 vscode 개발 Tool 조합 - Visual Studio Code - 확장팩 : PlantUML Extension GraphViz 1. PlantUML Extension 설치 하신후에는 기본으로 Sequence Diagram 을 그리실수 있습니다. 2. GraphViz - Class Diagram 을 그리기 위해 환경변수 설정 : GRAPHVIZ_DOT 설정값 : GraphViz 폴더안의 bin 폴더에 있는 dot.exe 파일의 전체 경로 ### UML 관련 참조 자료 http://plantuml.com/ko/guide PlantUML Language Reference Guide plantuml.com 참조 사이트 : https://www.clien.net/service/board/lecture/13.. 2023. 3. 24. The Bridge Pattern 13 The Bridge Pattern At first sight, the Bridge pattern looks much like the Adapter pattern in that a class is used to convert one kind of interface to another. However, the intent of the Adapter pattern is to make one or more classes’ interfaces look the same as the interface of a particular class. The Bridge pattern is designed to separate a class’s interface from its implementation so that y.. 2023. 3. 23. The Adapter Pattern 12** The Adapter Pattern The Adapter pattern is used to convert the programming interface of one class into that of another. We use adapters whenever we want unrelated classes to work together in a single program. The concept of an adapter is thus pretty simple; we write a class that has the desired interface and then make it communicate with the class that has a different interface. There are t.. 2023. 3. 23. Summary of Creational Patterns 11** Summary of Creational Patterns The Factory pattern is used to choose and return an instance of a class from a number of similar classes, based on data you provide to the factory. The Abstract Factory pattern is used to return one of several groups of classes. In some cases, it actually returns a factory for that group of classes. The Builder pattern assembles a number of objects to make a n.. 2023. 3. 23. The Prototype Pattern 10** The Prototype Pattern The Prototype pattern is used when creating an instance of a class is very time consuming or complex in some way. Instead of creating more instances, you make copies of the original instance and modify the copies as appropriate. Prototypes can also be used whenever you need classes that differ only in the type of processing they offer—for example, in parsing strings th.. 2023. 3. 23. 이전 1 ··· 24 25 26 27 28 29 30 ··· 46 다음