Skip to content

Commit c7a9939

Browse files
committed
Fixed issues in comments.
1 parent dd9d627 commit c7a9939

File tree

16 files changed

+182
-164
lines changed

16 files changed

+182
-164
lines changed

AbstractFactory.Conceptual/Program.cs

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,35 @@ namespace RefactoringGuru.DesignPatterns.AbstractFactory.Conceptual
1414
{
1515
// EN: The Abstract Factory interface declares a set of methods that return
1616
// different abstract products. These products are called a family and are
17-
// related by a high-level theme or concept. Products of one family are usually
18-
// able to collaborate among themselves. A family of products may have several
19-
// variants, but the products of one variant are incompatible with products
20-
// of another.
17+
// related by a high-level theme or concept. Products of one family are
18+
// usually able to collaborate among themselves. A family of products may
19+
// have several variants, but the products of one variant are incompatible
20+
// with products of another.
2121
//
22-
// RU: Интерфейс Абстрактной Фабрики объявляет набор методов, которые возвращают
23-
// различные абстрактные продукты. Эти продукты называются семейством и связаны
24-
// темой или концепцией высокого уровня. Продукты одного семейства обычно могут
25-
// взаимодействовать между собой. Семейство продуктов может иметь несколько
26-
// вариаций, но продукты одной вариации несовместимы с продуктами другой.
22+
// RU: Интерфейс Абстрактной Фабрики объявляет набор методов, которые
23+
// возвращают различные абстрактные продукты. Эти продукты называются
24+
// семейством и связаны темой или концепцией высокого уровня. Продукты
25+
// одного семейства обычно могут взаимодействовать между собой. Семейство
26+
// продуктов может иметь несколько вариаций, но продукты одной вариации
27+
// несовместимы с продуктами другой.
2728
public interface IAbstractFactory
2829
{
2930
IAbstractProductA CreateProductA();
3031

3132
IAbstractProductB CreateProductB();
3233
}
3334

34-
// EN: Concrete Factories produce a family of products that belong to a single
35-
// variant. The factory guarantees that resulting products are compatible.
36-
// Note that signatures of the Concrete Factory's methods return an abstract
37-
// product, while inside the method a concrete product is instantiated.
35+
// EN: Concrete Factories produce a family of products that belong to a
36+
// single variant. The factory guarantees that resulting products are
37+
// compatible. Note that signatures of the Concrete Factory's methods return
38+
// an abstract product, while inside the method a concrete product is
39+
// instantiated.
3840
//
39-
// RU: Конкретная Фабрика производит семейство продуктов одной вариации. Фабрика
40-
// гарантирует совместимость полученных продуктов. Обратите внимание, что
41-
// сигнатуры методов Конкретной Фабрики возвращают абстрактный продукт, в то
42-
// время как внутри метода создается экземпляр конкретного продукта.
41+
// RU: Конкретная Фабрика производит семейство продуктов одной вариации.
42+
// Фабрика гарантирует совместимость полученных продуктов. Обратите
43+
// внимание, что сигнатуры методов Конкретной Фабрики возвращают абстрактный
44+
// продукт, в то время как внутри метода создается экземпляр конкретного
45+
// продукта.
4346
class ConcreteFactory1 : IAbstractFactory
4447
{
4548
public IAbstractProductA CreateProductA()
@@ -69,8 +72,8 @@ public IAbstractProductB CreateProductB()
6972
}
7073
}
7174

72-
// EN: Each distinct product of a product family should have a base interface.
73-
// All variants of the product must implement this interface.
75+
// EN: Each distinct product of a product family should have a base
76+
// interface. All variants of the product must implement this interface.
7477
//
7578
// RU: Каждый отдельный продукт семейства продуктов должен иметь базовый
7679
// интерфейс. Все вариации продукта должны реализовывать этот интерфейс.
@@ -98,13 +101,13 @@ public string UsefulFunctionA()
98101
}
99102
}
100103

101-
// EN: Here's the the base interface of another product. All products can interact with
102-
// each other, but proper interaction is possible only between products of the
103-
// same concrete variant.
104+
// EN: Here's the the base interface of another product. All products can
105+
// interact with each other, but proper interaction is possible only between
106+
// products of the same concrete variant.
104107
//
105-
// RU: Базовый интерфейс другого продукта. Все продукты могут взаимодействовать
106-
// друг с другом, но правильное взаимодействие возможно только между продуктами
107-
// одной и той же конкретной вариации.
108+
// RU: Базовый интерфейс другого продукта. Все продукты могут
109+
// взаимодействовать друг с другом, но правильное взаимодействие возможно
110+
// только между продуктами одной и той же конкретной вариации.
108111
public interface IAbstractProductB
109112
{
110113
// EN: Product B is able to do its own thing...
@@ -139,8 +142,8 @@ public string UsefulFunctionB()
139142
// AbstractProductA as an argument.
140143
//
141144
// RU: Продукт B1 может корректно работать только с Продуктом A1. Тем не
142-
// менее, он принимает любой экземпляр Абстрактного Продукта А в качестве
143-
// аргумента.
145+
// менее, он принимает любой экземпляр Абстрактного Продукта А в
146+
// качестве аргумента.
144147
public string AnotherUsefulFunctionB(IAbstractProductA collaborator)
145148
{
146149
var result = collaborator.UsefulFunctionA();
@@ -171,20 +174,22 @@ public string AnotherUsefulFunctionB(IAbstractProductA collaborator)
171174
}
172175
}
173176

174-
// EN: The client code works with factories and products only through abstract
175-
// types: AbstractFactory and AbstractProduct. This lets you pass any factory or
176-
// product subclass to the client code without breaking it.
177+
// EN: The client code works with factories and products only through
178+
// abstract types: AbstractFactory and AbstractProduct. This lets you pass
179+
// any factory or product subclass to the client code without breaking it.
177180
//
178-
// RU: Клиентский код работает с фабриками и продуктами только через абстрактные
179-
// типы: Абстрактная Фабрика и Абстрактный Продукт. Это позволяет передавать
180-
// любой подкласс фабрики или продукта клиентскому коду, не нарушая его.
181+
// RU: Клиентский код работает с фабриками и продуктами только через
182+
// абстрактные типы: Абстрактная Фабрика и Абстрактный Продукт. Это
183+
// позволяет передавать любой подкласс фабрики или продукта клиентскому
184+
// коду, не нарушая его.
181185
class Client
182186
{
183187
public void Main()
184188
{
185189
// EN: The client code can work with any concrete factory class.
186190
//
187-
// RU: Клиентский код может работать с любым конкретным классом фабрики.
191+
// RU: Клиентский код может работать с любым конкретным классом
192+
// фабрики.
188193
Console.WriteLine("Client: Testing client code with the first factory type...");
189194
ClientMethod(new ConcreteFactory1());
190195
Console.WriteLine();

Bridge.Conceptual/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ static void Main(string[] args)
126126
Client client = new Client();
127127

128128
Abstraction abstraction;
129-
// EN: The client code should be able to work with any
130-
// pre-configured abstraction-implementation combination.
129+
// EN: The client code should be able to work with any pre-
130+
// configured abstraction-implementation combination.
131131
//
132132
// RU: Клиентский код должен работать с любой предварительно
133133
// сконфигурированной комбинацией абстракции и реализации.

Builder.Conceptual/Program.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
//
66
// RU: Паттерн Строитель
77
//
8-
// Назначение: Отделяет построение сложного объекта от его
9-
// представления так, что один и тот же процесс построения может создавать
10-
// разные представления объекта.
8+
// Назначение: Отделяет построение сложного объекта от его представления так,
9+
// что один и тот же процесс построения может создавать разные представления
10+
// объекта.
1111

1212
using System;
1313
using System.Collections.Generic;
@@ -168,8 +168,8 @@ public IBuilder Builder
168168
set { _builder = value; }
169169
}
170170

171-
// EN: The Director can construct several product variations using the same
172-
// building steps.
171+
// EN: The Director can construct several product variations using the
172+
// same building steps.
173173
//
174174
// RU: Директор может строить несколько вариаций продукта, используя
175175
// одинаковые шаги построения.
@@ -190,13 +190,13 @@ class Program
190190
{
191191
static void Main(string[] args)
192192
{
193-
// EN: The client code creates a builder object, passes it to the director and
194-
// then initiates the construction process. The end result is retrieved from the
195-
// builder object.
193+
// EN: The client code creates a builder object, passes it to the
194+
// director and then initiates the construction process. The end
195+
// result is retrieved from the builder object.
196196
//
197-
// RU: Клиентский код создаёт объект-строитель, передаёт его директору, а затем
198-
// инициирует процесс построения. Конечный результат извлекается из
199-
// объекта-строителя.
197+
// RU: Клиентский код создаёт объект-строитель, передаёт его
198+
// директору, а затем инициирует процесс построения. Конечный
199+
// результат извлекается из объекта-строителя.
200200
var director = new Director();
201201
var builder = new ConcreteBuilder();
202202
director.Builder = builder;

ChainOfResponsibility.Conceptual/Program.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public interface IHandler
2828
object Handle(object request);
2929
}
3030

31-
// EN: The default chaining behavior can be implemented inside a base handler
32-
// class.
31+
// EN: The default chaining behavior can be implemented inside a base
32+
// handler class.
3333
//
3434
// RU: Поведение цепочки по умолчанию может быть реализовано внутри базового
3535
// класса обработчика.
@@ -111,8 +111,9 @@ public override object Handle(object request)
111111

112112
class Client
113113
{
114-
// EN: The client code is usually suited to work with a single handler. In most
115-
// cases, it is not even aware that the handler is part of a chain.
114+
// EN: The client code is usually suited to work with a single handler.
115+
// In most cases, it is not even aware that the handler is part of a
116+
// chain.
116117
//
117118
// RU: Обычно клиентский код приспособлен для работы с единственным
118119
// обработчиком. В большинстве случаев клиенту даже неизвестно, что этот
@@ -141,7 +142,8 @@ class Program
141142
{
142143
static void Main(string[] args)
143144
{
144-
// EN: The other part of the client code constructs the actual chain.
145+
// EN: The other part of the client code constructs the actual
146+
// chain.
145147
//
146148
// RU: Другая часть клиентского кода создает саму цепочку.
147149
var monkey = new MonkeyHandler();
@@ -150,11 +152,11 @@ static void Main(string[] args)
150152

151153
monkey.SetNext(squirrel).SetNext(dog);
152154

153-
// EN: The client should be able to send a request to any handler, not just the
154-
// first one in the chain.
155+
// EN: The client should be able to send a request to any handler,
156+
// not just the first one in the chain.
155157
//
156-
// RU: Клиент должен иметь возможность отправлять запрос любому обработчику, а
157-
// не только первому в цепочке.
158+
// RU: Клиент должен иметь возможность отправлять запрос любому
159+
// обработчику, а не только первому в цепочке.
158160
Console.WriteLine("Chain: Monkey > Squirrel > Dog\n");
159161
Client.ClientCode(monkey);
160162
Console.WriteLine();

Command.Conceptual/Program.cs

Lines changed: 18 additions & 15 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
using System;
1414

@@ -80,9 +80,9 @@ public void Execute()
8080
}
8181
}
8282

83-
// EN: The Receiver classes contain some important business logic. They know how
84-
// to perform all kinds of operations, associated with carrying out a request.
85-
// In fact, any class may serve as a Receiver.
83+
// EN: The Receiver classes contain some important business logic. They know
84+
// how to perform all kinds of operations, associated with carrying out a
85+
// request. In fact, any class may serve as a Receiver.
8686
//
8787
// RU: Классы Получателей содержат некую важную бизнес-логику. Они умеют
8888
// выполнять все виды операций, связанных с выполнением запроса. Фактически,
@@ -103,8 +103,8 @@ public void DoSomethingElse(string b)
103103
// EN: The Invoker is associated with one or several commands. It sends a
104104
// request to the command.
105105
//
106-
// RU: Отправитель связан с одной или несколькими командами. Он отправляет запрос
107-
// команде.
106+
// RU: Отправитель связан с одной или несколькими командами. Он отправляет
107+
// запрос команде.
108108
class Invoker
109109
{
110110
private ICommand _onStart;
@@ -124,12 +124,13 @@ public void SetOnFinish(ICommand command)
124124
this._onFinish = command;
125125
}
126126

127-
// EN: The Invoker does not depend on concrete command or receiver classes.
128-
// The Invoker passes a request to a receiver indirectly, by executing a
129-
// command.
127+
// EN: The Invoker does not depend on concrete command or receiver
128+
// classes. The Invoker passes a request to a receiver indirectly, by
129+
// executing a command.
130130
//
131-
// RU: Отправитель не зависит от классов конкретных команд и получателей.
132-
// Отправитель передаёт запрос получателю косвенно, выполняя команду.
131+
// RU: Отправитель не зависит от классов конкретных команд и
132+
// получателей. Отправитель передаёт запрос получателю косвенно,
133+
// выполняя команду.
133134
public void DoSomethingImportant()
134135
{
135136
Console.WriteLine("Invoker: Does anybody want something done before I begin?");
@@ -152,9 +153,11 @@ class Program
152153
{
153154
static void Main(string[] args)
154155
{
155-
// EN: The client code can parameterize an invoker with any commands.
156+
// EN: The client code can parameterize an invoker with any
157+
// commands.
156158
//
157-
// RU: Клиентский код может параметризовать отправителя любыми командами.
159+
// RU: Клиентский код может параметризовать отправителя любыми
160+
// командами.
158161
Invoker invoker = new Invoker();
159162
invoker.SetOnStart(new SimpleCommand("Say Hi!"));
160163
Receiver receiver = new Receiver();

0 commit comments

Comments
 (0)