Skip to content

Commit 2e94508

Browse files
committed
Fixed issues in comments.
1 parent b0791ff commit 2e94508

File tree

23 files changed

+93
-105
lines changed

23 files changed

+93
-105
lines changed

src/AbstractFactory/Conceptual/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
22
EN: Abstract Factory Design Pattern
33
4-
Intent: Provide an interface for creating families of related or dependent
5-
objects without specifying their concrete classes.
4+
Intent: Lets you produce families of related objects without specifying their
5+
concrete classes.
66
77
RU: Паттерн Абстрактная Фабрика
88

src/Adapter/Conceptual/main.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
"""
22
EN: Adapter Design Pattern
33
4-
Intent: Convert the interface of a class into the interface clients expect.
5-
Adapter lets classes work together where they otherwise couldn't, due to
6-
incompatible interfaces.
4+
Intent: Provides a unified interface that allows objects with incompatible
5+
interfaces to collaborate.
76
87
RU: Паттерн Адаптер
98
10-
Назначение: Преобразует интерфейс класса в интерфейс, ожидаемый клиентами.
11-
Адаптер позволяет классам с несовместимыми интерфейсами работать вместе.
9+
Назначение: Позволяет объектам с несовместимыми интерфейсами работать вместе.
1210
"""
1311

1412

src/Bridge/Conceptual/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""
22
EN: Bridge Design Pattern
33
4-
Intent: Decouple an abstraction from its implementation so that the two can vary
5-
independently.
4+
Intent: Lets you split a large class or a set of closely related classes into
5+
two separate hierarchies—abstraction and implementation—which can be developed
6+
independently of each other.
67
78
A
89
/ \ A N
@@ -12,8 +13,8 @@
1213
1314
RU: Паттерн Мост
1415
15-
Назначение: Разделяет абстракцию и реализацию, что позволяет изменять их
16-
независимо друг от друга.
16+
Назначение: Разделяет один или несколько классов на две отдельные иерархии —
17+
абстракцию и реализацию, позволяя изменять их независимо друг от друга.
1718
1819
A
1920
/ \ A N

src/Builder/Conceptual/main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
"""
22
EN: Builder Design Pattern
33
4-
Intent: Separate the construction of a complex object from its representation so
5-
that the same construction process can create different representations.
4+
Intent: Lets you construct complex objects step by step. The pattern allows you
5+
to produce different types and representations of an object using the same
6+
construction code.
67
78
RU: Паттерн Строитель
89
9-
Назначение: Отделяет построение сложного объекта от его представления так, что
10-
один и тот же процесс построения может создавать разные представления объекта.
10+
Назначение: Позволяет создавать сложные объекты пошагово. Строитель даёт
11+
возможность использовать один и тот же код строительства для получения разных
12+
представлений объектов.
1113
"""
1214

1315

src/ChainOfResponsibility/Conceptual/main.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
"""
22
EN: Chain of Responsibility Design Pattern
33
4-
Intent: Avoid coupling a sender of a request to its receiver by giving more than
5-
one object a chance to handle the request. Chain the receiving objects and then
6-
pass the request through the chain until some receiver handles it.
4+
Intent: Lets you pass requests along a chain of handlers. Upon receiving a
5+
request, each handler decides either to process the request or to pass it to the
6+
next handler in the chain.
77
88
RU: Паттерн Цепочка обязанностей
99
10-
Назначение: Позволяет избежать привязки отправителя запроса к его получателю,
11-
предоставляя возможность обработать запрос нескольким объектам. Связывает в
12-
цепочку объекты-получатели, а затем передаёт запрос по цепочке, пока некий
13-
получатель не обработает его.
10+
Назначение: Позволяет передавать запросы последовательно по цепочке
11+
обработчиков. Каждый последующий обработчик решает, может ли он обработать
12+
запрос сам и стоит ли передавать запрос дальше по цепи.
1413
"""
1514

1615
from __future__ import annotations

src/Command/Conceptual/main.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
"""
22
EN: Command Design Pattern
33
4-
Intent: Encapsulate a request as an object, thereby letting you parameterize
5-
clients with different requests (e.g. queue or log requests) and support
6-
undoable operations.
4+
Intent: Turns a request into a stand-alone object that contains all information
5+
about the request. This transformation lets you parameterize methods with
6+
different requests, delay or queue a request's execution, and support undoable
7+
operations.
78
89
RU: Паттерн Команда
910
10-
Назначение: Инкапсулирует запрос как объект, позволяя тем самым параметризовать
11-
клиентов с различными запросами (например, запросами очереди или логирования) и
11+
Назначение: Превращает запросы в объекты, позволяя передавать их как аргументы
12+
при вызове методов, ставить запросы в очередь, логировать их, а также
1213
поддерживать отмену операций.
1314
"""
1415

src/Composite/Conceptual/main.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
"""
22
EN: Composite Design Pattern
33
4-
Intent: Compose objects into tree structures to represent part-whole
5-
hierarchies. Composite lets clients treat individual objects and compositions of
6-
objects uniformly.
4+
Intent: Lets you compose objects into tree structures and then work with these
5+
structures as if they were individual objects.
76
87
RU: Паттерн Компоновщик
98
10-
Назначение: Объединяет объекты в древовидные структуры для представления
11-
иерархий часть-целое. Компоновщик позволяет клиентам обрабатывать отдельные
12-
объекты и группы объектов одинаковым образом.
9+
Назначение: Позволяет сгруппировать объекты в древовидную структуру, а затем
10+
работать с ними так, как будто это единичный объект.
1311
"""
1412

1513

src/Decorator/Conceptual/main.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"""
22
EN: Decorator Design Pattern
33
4-
Intent: Attach additional responsibilities to an object dynamically. Decorators
5-
provide a flexible alternative to subclassing for extending functionality.
4+
Intent: Lets you attach new behaviors to objects by placing these objects inside
5+
special wrapper objects that contain the behaviors.
66
77
RU: Паттерн Декоратор
88
9-
Назначение: Динамически подключает к объекту дополнительную функциональность.
10-
Декораторы предоставляют гибкую альтернативу практике создания подклассов для
11-
расширения функциональности.
9+
Назначение: Позволяет динамически добавлять объектам новую функциональность,
10+
оборачивая их в полезные «обёртки».
1211
"""
1312

1413

src/Facade/Conceptual/main.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
"""
22
EN: Facade Design Pattern
33
4-
Intent: Provide a unified interface to a number of classes/interfaces of a
5-
complex subsystem. The Facade pattern defines a higher-level interface that
6-
makes the subsystem easier to use.
4+
Intent: Provides a simplified interface to a library, a framework, or any other
5+
complex set of classes.
76
87
RU: Паттерн Фасад
98
10-
Назначение: Предоставляет единый интерфейс к ряду классов/интерфейсов сложной
11-
подсистемы. Паттерн Фасад определяет интерфейс более высокого уровня, который
12-
упрощает использование подсистемы.
9+
Назначение: Предоставляет простой интерфейс к сложной системе классов,
10+
библиотеке или фреймворку.
1311
"""
1412

1513

src/FactoryMethod/Conceptual/main.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
"""
22
EN: Factory Method Design Pattern
33
4-
Intent: Define an interface for creating an object, but let subclasses decide
5-
which class to instantiate. Factory Method lets a class defer instantiation to
6-
subclasses.
4+
Intent: Provides an interface for creating objects in a superclass, but allows
5+
subclasses to alter the type of objects that will be created.
76
87
RU: Паттерн Фабричный Метод
98
10-
Назначение: Определяет интерфейс для создания объекта, но позволяет подклассам
11-
решать, какого класса создавать экземпляр. Фабричный Метод позволяет классу
12-
делегировать создание экземпляра подклассам.
9+
Назначение: Определяет общий интерфейс для создания объектов в суперклассе,
10+
позволяя подклассам изменять тип создаваемых объектов.
1311
"""
1412

1513

src/Flyweight/Conceptual/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""
22
EN: Flyweight Design Pattern
33
4-
Intent: Use sharing to fit more objects into the available amount of RAM by
5-
sharing common parts of the object state among multiple objects, instead of
6-
keeping the entire state in each object.
4+
Intent: Lets you fit more objects into the available amount of RAM by sharing
5+
common parts of state between multiple objects, instead of keeping all of the
6+
data in each object.
77
88
RU: Паттерн Легковес
99
1010
Назначение: Позволяет вместить бóльшее количество объектов в отведённую
1111
оперативную память. Легковес экономит память, разделяя общее состояние объектов
12-
между ними, вместо хранения одинаковых данных в каждом объекте.
12+
между собой, вместо хранения одинаковых данных в каждом объекте.
1313
"""
1414

1515

src/Iterator/Conceptual/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
EN: Iterator Design Pattern
33
4-
Intent: Provide a way to traverse the elements of an aggregate object without
5-
exposing its underlying representation.
4+
Intent: Lets you traverse elements of a collection without exposing its
5+
underlying representation (list, stack, tree, etc.).
66
77
RU: Паттерн Итератор
88
9-
Назначение: Предоставляет возможность обходить элементы составного объекта, не
10-
раскрывая его внутреннего представления.
9+
Назначение: Даёт возможность последовательно обходить элементы составных
10+
объектов, не раскрывая их внутреннего представления.
1111
"""
1212

1313

src/Mediator/Conceptual/main.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
"""
22
EN: Mediator Design Pattern
33
4-
Intent: Define an object that encapsulates how a set of objects interact.
5-
Mediator promotes loose coupling by keeping objects from referring to each other
6-
explicitly, and it lets you vary their interaction independently.
4+
Intent: Lets you reduce chaotic dependencies between objects. The pattern
5+
restricts direct communications between the objects and forces them to
6+
collaborate only via a mediator object.
77
88
RU: Паттерн Посредник
99
10-
Назначение: Определяет объект, который инкапсулирует взаимодействие набора
11-
объектов. Посредник способствует слабой связанности, удерживая объекты от
12-
обращения друг к другу напрямую, и это позволяет вам менять их взаимодействие
13-
независимо.
10+
Назначение: Позволяет уменьшить связанность множества классов между собой,
11+
благодаря перемещению этих связей в один класс-посредник.
1412
"""
1513

1614

src/Memento/Conceptual/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
22
EN: Memento Design Pattern
33
4-
Intent: Capture and externalize an object's internal state so that the object
5-
can be restored to this state later, without violating encapsulation.
4+
Intent: Lets you save and restore the previous state of an object without
5+
revealing the details of its implementation.
66
77
RU: Паттерн Снимок
88

src/Observer/Conceptual/main.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
22
EN: Observer Design Pattern
33
4-
Intent: Define a one-to-many dependency between objects so that when one object
5-
changes state, all of its dependents are notified and updated automatically.
4+
Intent: Lets you define a subscription mechanism to notify multiple objects
5+
about any events that happen to the object they're observing.
66
77
Note that there's a lot of different terms with similar meaning associated with
88
this pattern. Just remember that the Subject is also called the Publisher and
@@ -11,9 +11,8 @@
1111
1212
RU: Паттерн Наблюдатель
1313
14-
Назначение: Устанавливает между объектами зависимость «один ко многим» таким
15-
образом, что когда изменяется состояние одного объекта, все зависимые от него
16-
объекты оповещаются и обновляются автоматически.
14+
Назначение: Создаёт механизм подписки, позволяющий одним объектам следить и
15+
реагировать на события, происходящие в других объектах.
1716
1817
Обратите внимание, что существует множество различных терминов с похожими
1918
значениями, связанных с этим паттерном. Просто помните, что Субъекта также

src/Prototype/Conceptual/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
EN: Prototype Design Pattern
33
4-
Intent: Produce new objects by copying existing ones without compromising their
5-
internal structure.
4+
Intent: Lets you copy existing objects without making your code dependent on
5+
their classes.
66
77
RU: Паттерн Прототип
88
9-
Назначение: Создаёт новые объекты, копируя существующие без нарушения их
10-
внутренней структуры.
9+
Назначение: Позволяет копировать объекты, не вдаваясь в подробности их
10+
реализации.
1111
"""
1212

1313

src/Proxy/Conceptual/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
77
RU: Паттерн Заместитель
88
9-
Назначение: Предоставляет заменитель или местозаполнитель для другого объекта,
10-
чтобы контролировать доступ к оригинальному объекту или добавлять другие
11-
обязанности.
9+
Назначение: Позволяет подставлять вместо реальных объектов специальные
10+
объекты-заменители. Эти объекты перехватывают вызовы к оригинальному объекту,
11+
позволяя сделать что-то до или после передачи вызова оригиналу.
1212
"""
1313

1414

src/Singleton/Conceptual/NonThreadSafe/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
EN: Singleton Design Pattern
33
4-
Intent: Ensure that a class has a single instance, and provide a global point of
5-
access to it.
4+
Intent: Lets you ensure that a class has only one instance, while providing a
5+
global access point to this instance.
66
77
RU: Паттерн Одиночка
88
9-
Назначение: Гарантирует существование единственного экземпляра класса и
10-
предоставляет глобальную точку доступа к нему.
9+
Назначение: Гарантирует, что у класса есть только один экземпляр, и
10+
предоставляет к нему глобальную точку доступа.
1111
"""
1212

1313

src/Singleton/Conceptual/ThreadSafe/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
EN: Singleton Design Pattern
33
4-
Intent: Ensure that a class has a single instance, and provide a global point of
5-
access to it.
4+
Intent: Lets you ensure that a class has only one instance, while providing a
5+
global access point to this instance.
66
77
RU: Паттерн Одиночка
88
9-
Назначение: Гарантирует существование единственного экземпляра класса и
10-
предоставляет глобальную точку доступа к нему.
9+
Назначение: Гарантирует, что у класса есть только один экземпляр, и
10+
предоставляет к нему глобальную точку доступа.
1111
"""
1212

1313

src/State/Conceptual/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
22
EN: State Design Pattern
33
4-
Intent: Allow an object to alter its behavior when its internal state changes.
5-
The object will appear to change its class.
4+
Intent: Lets an object alter its behavior when its internal state changes. It
5+
appears as if the object changed its class.
66
77
RU: Паттерн Состояние
88
9-
Назначение: Позволяет объекту менять поведение при изменении его внутреннего
10-
состояния. Со стороны может казаться, что объект меняет свой класс.
9+
Назначение: Позволяет объектам менять поведение в зависимости от своего
10+
состояния. Извне создаётся впечатление, что изменился класс объекта.
1111
"""
1212

1313

src/Strategy/Conceptual/main.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
"""
22
EN: Strategy Design Pattern
33
4-
Intent: Define a family of algorithms, encapsulate each one, and make them
5-
interchangeable. Strategy lets the algorithm vary independently from clients
6-
that use it.
4+
Intent: Lets you define a family of algorithms, put each of them into a separate
5+
class, and make their objects interchangeable.
76
87
RU: Паттерн Стратегия
98
10-
Назначение: Определяет семейство алгоритмов, инкапсулирует каждый из них и
11-
делает взаимозаменяемыми. Стратегия позволяет изменять алгоритм независимо от
12-
клиентов, которые его используют.
9+
Назначение: Определяет семейство схожих алгоритмов и помещает каждый из них в
10+
собственный класс, после чего алгоритмы можно взаимозаменять прямо во время
11+
исполнения программы.
1312
"""
1413

1514

0 commit comments

Comments
 (0)