Design patterns in vanilla Python.
Found in /builder
, discusses best practices using Python to model out the food order process/meal building process.
Found in /abstract_factory
, discusses using abstract factory pattern to create a Pizza Store with different types of Pizza as well as styles varying based on location.
Found in /factory_method
, discusses using factory method pattern to create a Pizza Store with two different variations (New York and Chicago style).
Found in /adapter
, shows the benefits of the adapter pattern using scenario where a client tries to implement different payment options.
Also different clean code boundary techniques are discussed.
Found in /decorator
, investigates using Python decorators to enfore consistent pre-and-post-conditions on a Binary Search Tree class.
Found in /proxy
, gives an example of the relationship between a real object and the proxy that acts as a surrogate or placeholder for it to control access and/or add other responsibilities.
Found in /observer
, creates system of push updates by relating classes
Found in /strategy
, shows a general strategy for defining a family of algorithms, encapsulating each one, and making them
interchangeable. This allows clients to couple themselves to an interface rather than a concrete implementation.