Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/RefactoringGuru/design-patterns-python
/ functions
Functions
212 in github.com/RefactoringGuru/design-patterns-python
⨍
Functions
212
◇
Types & classes
95
↓ 6 callers
Method
add
(self, component: Component)
src/Composite/Conceptual/main.py:61
↓ 5 callers
Method
add
(self, part: Any)
src/Builder/Conceptual/main.py:136
↓ 5 callers
Method
handle
(self, request)
src/ChainOfResponsibility/Conceptual/main.py:34
↓ 4 callers
Method
notify
(self, sender: object, event: str)
src/Mediator/Conceptual/main.py:30
↓ 4 callers
Method
operation
(self)
src/Decorator/Conceptual/main.py:23
↓ 3 callers
Method
add_item
(self, item: Any)
src/Iterator/Conceptual/main.py:120
↓ 3 callers
Method
backup
(self)
src/Memento/Conceptual/main.py:147
↓ 3 callers
Method
do_something
EN: The Originator's business logic may affect its internal state. Therefore, the client should backup the state before launching met
src/Memento/Conceptual/main.py:45
↓ 3 callers
Method
list_parts
(self)
src/Builder/Conceptual/main.py:139
↓ 3 callers
Method
operation
(self)
src/Composite/Conceptual/main.py:108
↓ 3 callers
Method
produce_part_a
(self)
src/Builder/Conceptual/main.py:36
↓ 3 callers
Method
some_business_logic
EN: Usually, the subscription logic is only a fraction of what a Subject can really do. Subjects commonly hold some important busines
src/Observer/Conceptual/main.py:118
↓ 3 callers
Method
transition_to
EN: The Context allows changing the State object at runtime. RU: Контекст позволяет изменять объект Состояния во время выполнения.
src/State/Conceptual/main.py:39
↓ 2 callers
Function
add_car_to_police_database
( factory: FlyweightFactory, plates: str, owner: str, brand: str, model: str, color: str )
src/Flyweight/Conceptual/main.py:95
↓ 2 callers
Method
attach
EN: Attach an observer to the subject. RU: Присоединяет наблюдателя к издателю.
src/Observer/Conceptual/main.py:40
↓ 2 callers
Function
client_code
EN: The client code works with all objects using the Component interface. This way it can stay independent of the concrete classes of compone
src/Decorator/Conceptual/main.py:109
↓ 2 callers
Function
client_code
EN: The client code is usually suited to work with a single handler. In most cases, it is not even aware that the handler is part of a chain.
src/ChainOfResponsibility/Conceptual/main.py:101
↓ 2 callers
Function
client_code
EN: The client code can run visitor operations over any set of elements without figuring out their concrete classes. The accept operation dir
src/Visitor/Conceptual/main.py:138
↓ 2 callers
Function
client_code
EN: The client code is supposed to work with all objects (both subjects and proxies) via the Subject interface in order to support both real
src/Proxy/Conceptual/main.py:89
↓ 2 callers
Function
client_code
EN: The client code works with an instance of a concrete creator, albeit through its base interface. As long as the client keeps working with
src/FactoryMethod/Conceptual/main.py:131
↓ 2 callers
Function
client_code
EN: The client code calls the template method to execute the algorithm. Client code does not have to know the concrete class of an object it
src/TemplateMethod/Conceptual/main.py:129
↓ 2 callers
Function
client_code
EN: Except for the initialization phase, where an Abstraction object gets linked with a specific Implementation object, the client code shoul
src/Bridge/Conceptual/main.py:102
↓ 2 callers
Function
client_code
EN: The client code works with factories and products only through abstract types: AbstractFactory and AbstractProduct. This lets you pass an
src/AbstractFactory/Conceptual/main.py:186
↓ 2 callers
Function
client_code
EN: The client code supports all classes that follow the Target interface. RU: Клиентский код поддерживает все классы, использующие интерфей
src/Adapter/Conceptual/class/main.py:55
↓ 2 callers
Function
client_code
EN: The client code supports all classes that follow the Target interface. RU: Клиентский код поддерживает все классы, использующие интерфей
src/Adapter/Conceptual/object/main.py:58
↓ 2 callers
Function
client_code
EN: The client code works with all of the components via the base interface. RU: Клиентский код работает со всеми компонентами через базовый
src/Composite/Conceptual/main.py:164
↓ 2 callers
Method
do_c
(self)
src/Mediator/Conceptual/main.py:93
↓ 2 callers
Method
do_some_business_logic
EN: The Context delegates some work to the Strategy object instead of implementing multiple versions of the algorithm on its own.
src/Strategy/Conceptual/main.py:63
↓ 2 callers
Method
exclusive_method_of_concrete_component_a
EN: Concrete Components may have special methods that don't exist in their base class or interface. The Visitor is still able to use
src/Visitor/Conceptual/main.py:55
↓ 2 callers
Method
execute
(self)
src/Command/Conceptual/main.py:29
↓ 2 callers
Method
get_key
EN: Returns a Flyweight's string hash for a given state. RU: Возвращает хеш строки Легковеса для данного состояния.
src/Flyweight/Conceptual/main.py:61
↓ 2 callers
Method
get_name
(self)
src/Memento/Conceptual/main.py:96
↓ 2 callers
Method
list_flyweights
(self)
src/Flyweight/Conceptual/main.py:89
↓ 2 callers
Method
operation1
(self)
src/Facade/Conceptual/main.py:76
↓ 2 callers
Method
operation_implementation
(self)
src/Bridge/Conceptual/main.py:79
↓ 2 callers
Method
produce_part_b
(self)
src/Builder/Conceptual/main.py:40
↓ 2 callers
Method
remove
(self, component: Component)
src/Composite/Conceptual/main.py:64
↓ 2 callers
Method
reset
(self)
src/Builder/Conceptual/main.py:69
↓ 2 callers
Method
set_next
(self, handler: Handler)
src/ChainOfResponsibility/Conceptual/main.py:30
↓ 2 callers
Method
special_method_of_concrete_component_b
(self)
src/Visitor/Conceptual/main.py:79
↓ 2 callers
Method
specific_request
(self)
src/Adapter/Conceptual/class/main.py:38
↓ 2 callers
Method
specific_request
(self)
src/Adapter/Conceptual/object/main.py:38
↓ 2 callers
Method
undo
(self)
src/Memento/Conceptual/main.py:151
↓ 2 callers
Method
update
EN: Receive update from subject. RU: Получить обновление от субъекта.
src/Observer/Conceptual/main.py:147
↓ 2 callers
Method
useful_function_a
(self)
src/AbstractFactory/Conceptual/main.py:87
↓ 1 callers
Method
_generate_random_string
(length: int = 10)
src/Memento/Conceptual/main.py:61
↓ 1 callers
Method
accept
(self, visitor: Visitor)
src/Visitor/Conceptual/main.py:28
↓ 1 callers
Method
another_useful_function_b
EN: ...but it also can collaborate with the ProductA. The Abstract Factory makes sure that all products it creates are of the
src/AbstractFactory/Conceptual/main.py:128
↓ 1 callers
Method
base_operation1
(self)
src/TemplateMethod/Conceptual/main.py:55
↓ 1 callers
Method
base_operation2
(self)
src/TemplateMethod/Conceptual/main.py:58
↓ 1 callers
Method
base_operation3
(self)
src/TemplateMethod/Conceptual/main.py:61
↓ 1 callers
Method
build_full_featured_product
(self)
src/Builder/Conceptual/main.py:187
↓ 1 callers
Method
build_minimal_viable_product
(self)
src/Builder/Conceptual/main.py:184
↓ 1 callers
Method
check_access
(self)
src/Proxy/Conceptual/main.py:81
↓ 1 callers
Function
client_code
EN: The client code works with complex subsystems through a simple interface provided by the Facade. When a facade manages the lifecycle of t
src/Facade/Conceptual/main.py:101
↓ 1 callers
Function
client_code2
EN: Thanks to the fact that the child-management operations are declared in the base Component class, the client code can work with any compo
src/Composite/Conceptual/main.py:174
↓ 1 callers
Method
create_product_a
(self)
src/AbstractFactory/Conceptual/main.py:35
↓ 1 callers
Method
create_product_b
(self)
src/AbstractFactory/Conceptual/main.py:39
↓ 1 callers
Method
detach
EN: Detach an observer from the subject. RU: Отсоединяет наблюдателя от издателя.
src/Observer/Conceptual/main.py:49
↓ 1 callers
Method
do_a
(self)
src/Mediator/Conceptual/main.py:83
↓ 1 callers
Method
do_algorithm
(self, data: List)
src/Strategy/Conceptual/main.py:97
↓ 1 callers
Method
do_b
(self)
src/Mediator/Conceptual/main.py:87
↓ 1 callers
Method
do_d
(self)
src/Mediator/Conceptual/main.py:97
↓ 1 callers
Method
do_something
(self, a: str)
src/Command/Conceptual/main.py:94
↓ 1 callers
Method
do_something_else
(self, b: str)
src/Command/Conceptual/main.py:97
↓ 1 callers
Method
do_something_important
EN: The Invoker does not depend on concrete command or receiver classes. The Invoker passes a request to a receiver indirectly, by ex
src/Command/Conceptual/main.py:125
↓ 1 callers
Method
factory_method
EN: Note that the Creator may also provide some default implementation of the factory method. RU: Обратите внимание, что Соз
src/FactoryMethod/Conceptual/main.py:30
↓ 1 callers
Method
get_flyweight
EN: Returns an existing Flyweight with a given state or creates a new one. RU: Возвращает существующий Легковес с заданным с
src/Flyweight/Conceptual/main.py:70
↓ 1 callers
Method
get_reverse_iterator
(self)
src/Iterator/Conceptual/main.py:117
↓ 1 callers
Method
get_state
EN: The Originator uses this method when restoring its state. RU: Создатель использует этот метод, когда восстанавливает своё
src/Memento/Conceptual/main.py:109
↓ 1 callers
Method
handle1
(self)
src/State/Conceptual/main.py:85
↓ 1 callers
Method
handle2
(self)
src/State/Conceptual/main.py:89
↓ 1 callers
Method
hook1
(self)
src/TemplateMethod/Conceptual/main.py:86
↓ 1 callers
Method
hook2
(self)
src/TemplateMethod/Conceptual/main.py:89
↓ 1 callers
Method
is_composite
EN: You can provide a method that lets the client code figure out whether a component can bear children. RU: Вы можете предо
src/Composite/Conceptual/main.py:67
↓ 1 callers
Method
log_access
(self)
src/Proxy/Conceptual/main.py:85
↓ 1 callers
Method
notify
EN: Trigger an update in each subscriber. RU: Запуск обновления в каждом подписчике.
src/Observer/Conceptual/main.py:107
↓ 1 callers
Method
operation
(self, unique_state: str)
src/Flyweight/Conceptual/main.py:36
↓ 1 callers
Method
operation
(self)
src/FactoryMethod/Conceptual/main.py:110
↓ 1 callers
Method
operation
(self)
src/Bridge/Conceptual/main.py:45
↓ 1 callers
Method
operation
EN: The Facade's methods are convenient shortcuts to the sophisticated functionality of the subsystems. However, clients get only to
src/Facade/Conceptual/main.py:45
↓ 1 callers
Method
operation_n
(self)
src/Facade/Conceptual/main.py:81
↓ 1 callers
Method
operation_z
(self)
src/Facade/Conceptual/main.py:97
↓ 1 callers
Method
produce_part_c
(self)
src/Builder/Conceptual/main.py:44
↓ 1 callers
Method
request
EN: The most common applications of the Proxy pattern are lazy loading, caching, controlling the access, logging, etc. A Proxy can pe
src/Proxy/Conceptual/main.py:63
↓ 1 callers
Method
request
(self)
src/Adapter/Conceptual/class/main.py:22
↓ 1 callers
Method
request
(self)
src/Adapter/Conceptual/object/main.py:22
↓ 1 callers
Method
request1
(self)
src/State/Conceptual/main.py:56
↓ 1 callers
Method
request2
(self)
src/State/Conceptual/main.py:59
↓ 1 callers
Method
required_operations1
(self)
src/TemplateMethod/Conceptual/main.py:69
↓ 1 callers
Method
required_operations2
(self)
src/TemplateMethod/Conceptual/main.py:73
↓ 1 callers
Method
restore
EN: Restores the Originator's state from a memento object. RU: Восстанавливает состояние Создателя из объекта снимка.
src/Memento/Conceptual/main.py:73
↓ 1 callers
Method
save
EN: Saves the current state inside a memento. RU: Сохраняет текущее состояние внутри снимка.
src/Memento/Conceptual/main.py:64
↓ 1 callers
Method
set_on_finish
(self, command: Command)
src/Command/Conceptual/main.py:122
↓ 1 callers
Method
set_on_start
(self, command: Command)
src/Command/Conceptual/main.py:119
↓ 1 callers
Method
set_parent
(self, parent)
src/Prototype/Conceptual/main.py:8
↓ 1 callers
Method
show_history
(self)
src/Memento/Conceptual/main.py:162
↓ 1 callers
Method
some_operation
EN: Also note that, despite its name, the Creator's primary responsibility is not creating products. Usually, it contains some core
src/FactoryMethod/Conceptual/main.py:40
↓ 1 callers
Method
template_method
EN: The template method defines the skeleton of an algorithm. RU: Шаблонный метод определяет скелет алгоритма.
src/TemplateMethod/Conceptual/main.py:36
↓ 1 callers
Method
useful_function_b
EN: Product B is able to do its own thing... RU: Продукт B способен работать самостоятельно...
src/AbstractFactory/Conceptual/main.py:119
next →
1–100 of 212, ranked by callers