Skip to content

Commit 6011790

Browse files
committed
Formatting markdown
1 parent 7b2f4c8 commit 6011790

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

chapter01_strategy/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Chapter 1: Strategy design pattern
22

3-
**Strategy**: defines a family of algorithms, encapsulates each one and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
3+
> **Strategy**: defines a family of algorithms, encapsulates each one and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
44
55
I think the more pythonic approach would be to define methods rather than classes, and this would not violate the above definition. The class-based approach is needed in Java and has the advantage of explicitly setting out the required method in an abstract base class.

chapter03_decorator/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Chapter 3: Decorator design pattern
22

3-
**Decorator**: Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
3+
> **Decorator**: Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
44
55
Not quite the same as python [decorator syntax](https://docs.python.org/3/reference/compound_stmts.html#grammar-token-decorators) as in python you call the _decorated function_ and the decorating function is called first whereas the _decorating function_ must be called here.
66

chapter04_factory/readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Chapter 4: Factory patterns
22

3-
**Simple Factory**: A class which chooses which product class to instantiate and return, based upon method parameters.
3+
> **Simple Factory**: A class which chooses which product class to instantiate and return, based upon method parameters.
44
55
The Python standard library contains multiple references to factory objects, for instances in [dataclasses](https://docs.python.org/3/library/dataclasses.html?highlight=factory)
66

7-
**Factory Method**: Defines an interface for creating an object, but lets subclasses decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses.
7+
> **Factory Method**: Defines an interface for creating an object, but lets subclasses decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses.
88
99
For instance the `PizzaStore` abstract class in this repo provides an abstract `create_pizza` interface for creating one product.
1010

11-
**Abstract Factory**: Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
11+
> **Abstract Factory**: Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
1212
1313
For instance the `PizzaIngredientFactory` abstract class defines an interface for a family of products.

chapter05_singleton/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Chapter 5: Singleton design pattern
22

3-
**Singleton**: ensures a class has only one instance, and provides a global point of access to it.
3+
> **Singleton**: ensures a class has only one instance, and provides a global point of access to it.
44
5-
Based this [stackoverflow post](https://stackoverflow.com/questions/6760685/creating-a-singleton-in-python?noredirect=1&lq=1).
5+
Based this [stackoverflow post](https://stackoverflow.com/questions/6760685/creating-a-singleton-in-python?noredirect=1&lq=1).

0 commit comments

Comments
 (0)