This repo is created based on reading design patterns GoF element of reusable object-oriented software and clean architecture: a craftman's guide to software structure and design, so practice concepts on Python.
It mixed with some engineering work that Python is one option to do with.
- Creational patterns: design patterns that involve instantiating concrete objects.
- Behavioural patterns: design patterns that focus on how objects distribute work.
- Polymorphism: the ability to interact with objects of different types in the same way.
- Subclass: a class that inherits from a parent class, called a superclass.
- Subtype: a data type that inherits from a parent type, called a supertype.
- Inheritance: when a subtype or subclass inherits behaviours and methods from the supertype or superclass.
- Adapter pattern: a design pattern that connects two incompatible interfaces by fitting between them and providing a compatible interface to both.
- Command pattern: a behavioural pattern for encapsulating requests as objects.
- Composite class: a class which is designed to contain other classes, including objects of the same type.
- Composite pattern: a design pattern for composing nested structures of objects and dealing with these objects uniformly.
- Decorator pattern: a design pattern allowing for added behaviour through wrapping.
- Facade pattern: a design pattern that involves encapsulating a complex system in a simple interface.
- Factory Method pattern: a pattern that delegates concrete instantiation to a method of a subclass.
- Factory Object: any object whose main purpose is concrete instantiation, i.e. actually creating objects.
- Observer pattern: a behavioural pattern for event handling.
- Singleton pattern: a design pattern that enforces a single instantiation of a class that is globally accessible.
- State pattern: a behavioural pattern for handling requests taking into account the current state of the object.
- structural patterns: design patterns that describe how objects are connected to one another.
- Template Method pattern: a behavioural pattern that allows for similar behaviour to be inherited by multiple subclasses.
- Composing objects principle: an alternative method of code reuse that uses aggregation rather than inheritance.
- Chain of Responsibility pattern: a behavioural pattern for allowing multiple entities to handle requests.
- Open/Closed principle: a design principle dictating that an object should be open to extension, but closed to modification.
- Principle of least knowledge: a design principle stating that classes should know about and interact with as few other classes as possible. Also called the Law of Demeter.
- Separation of concerns: a design principle dictating that a program should separate different concerns or functions into separate objects or processes. Allows for easier maintenance and loose coupling.
- Favor composition over inheritance, especially for FP.
- Program to interface, not an implementation.
- Refactoring: the process of changing code so that external behaviours and interfaces are unchanged but internal structure is improved.
Git usage:
git log
git add -p "atomic" changes
git stash save ""
git reset <commit hash>//restore changes to specific commits
git reset --soft <commit hash> //keep changes like unstaged changes
git reset --hard <commit hash> //will remove changes
git rebase --interactive <commit hash> //get all the repo commits