Skip to content

cmu-is-projects/PythonDesignPatterns

 
 

Repository files navigation

PythonDesignPatterns

Design patterns in vanilla Python.

Creational Patterns

Builder Pattern

Found in /builder, discusses best practices using Python to model out the food order process/meal building process.

Abstract Factory Pattern

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.

Factory Method Pattern

Found in /factory_method, discusses using factory method pattern to create a Pizza Store with two different variations (New York and Chicago style).

Structural Patterns

Adapter Pattern

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.

Decorator Pattern

Found in /decorator, investigates using Python decorators to enfore consistent pre-and-post-conditions on a Binary Search Tree class.

Proxy Pattern

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.

Behavioral Patterns

Observer Pattern

Found in /observer, creates system of push updates by relating classes

Strategy Pattern

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.

About

Design patterns in vanilla Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%