분류 전체보기408 The Prototype Pattern The Builder Pattern We have already seen that the Factory pattern returns one of several different subclasses, depending on the data passed in arguments to the creation methods. But suppose we don’t want just a computing algorithm, but a whole different user interface depending on the data we need to display. A typical example might be your email address book. You probably have both people and g.. 2023. 3. 23. The Singleton Pattern The Singleton pattern is grouped with the other creational patterns, although, to some extent, it is a “noncreational” pattern. 프로그래밍에는 클래스의 인스턴스가 하나만 있는지 확인해야 하는 경우가 많이 있습니다. For example, your system can have only one window manager or print spooler, as well as a single point of access to a database engine. Python does not directly have a feature where a single static variable will be accessibl.. 2023. 3. 23. The Abstract Factory Pattern The Abstract Factory pattern is one level of abstraction higher than the Factory pattern. You use this pattern when you want to return one of several related classes of objects, each of which can return several different objects on request. In other words, the Abstract Factory is a factory object that returns one of several groups of classes. Determining which class from that group to use might .. 2023. 3. 23. The Factory Method Pattern 5 장에서 우리는 가장 단순한 공장의 몇 가지 예를 보았습니다. 팩토리 개념은 객체 지향 프로그래밍 전체에서 반복됩니다. 이러한 경우 단일 클래스는 교통 경찰 역할을 하며 인스턴스화할 단일 계층의 하위 클래스를 결정합니다. Factory Method 패턴은 Factory pattern의 확장으로, 단일 클래스가 인스턴스화할 하위 클래스를 결정하지 않습니다. 대신 슈퍼클래스는 각 서브클래스에 대한 결정을 연기합니다. 이 패턴에는 실제로 하나의 하위 클래스가 다른 클래스보다 직접 선택되는 결정 지점이 없습니다. 대신 이 패턴으로 작성된 프로그램은 객체를 생성하지만 각 하위 클래스가 생성할 객체를 결정하도록 하는 추상 클래스를 정의합니다. straight seeding 1) Heat 배정 방식 - 기록 오름 .. 2023. 3. 23. The Factory Pattern Creational Patterns All creational patterns deal with ways to create instances of objects. This is important because your program should not depend on how objects are created and arranged. In Python, of course, the simplest way to create an instance of an object is by creating a variable of that class type. fred = Fred()# instance of Fred class However, this really amounts to hard coding, depend.. 2023. 3. 23. What Are Design Patterns? Model-View-Controller framework for Smalltalk (Krasner and Pope, 1988), which divided the user interface problem into three parts. The parts were referred to as a data model, containing the computational parts of the program; the view, which presents the user interface; and the controller, which interacts between the user and the view The authors divided these patterns into three types: creation.. 2023. 3. 23. Visual Programming of Tables of Data 3 Visual Programming of Tables of Data In this chapter, we’ll look at a few ways to represent lists of data. We’ll start by writing code to read in a list of states, along with some of their data. Then we use these entries as examples for display, to easily find tables of all the U.S. states and their capitals and population data. When writing this book, we extracted the data from a table on Wik.. 2023. 3. 23. Visual Programming in Python 2 Visual Programming in Python You can make very nice visual interfaces using the tkinter toolkit provided with Python. It gives you tools for creating windows, buttons, radio buttons, check boxes, entry fields, list boxes, combo boxes and a number of other useful visual widgets. To use the tkinter library, you must tell your program to import those tools: import tkinter as tk from tkinter impor.. 2023. 3. 23. Introduction Introduction to Objects Classes are one of the most important parts of the Python language and also a major component of object-oriented programming. Some books put off classes until later chapters, but because nearly every component of Python is an object, we will take a look at them up right away. And don’t skip ahead, because we’ll be using them in every single chapter that follows! Almost ev.. 2023. 3. 23. 이전 1 ··· 25 26 27 28 29 30 31 ··· 46 다음