Based on Dmitri Nesteruk's Udemy course
A Class should have a single reason to change
It should have a primary responsibility and not take on other responsibilities
Separation of concerns - different classes handling different, independent tasks/problems
Systems should be open to extension, but closed to modification
To extend functionality use inheritance rather than modifying existing code
Subtypes should be immediately substitutable for their basetypes
i.e. if a square inherits from rectangle, it should be useable wherever a rectangle can be used
Keep interface sizes small and maintainable
Don't be tempted to put all operations into a single interface
YAGNI - You ain't gonna need it
Specifies the best way to form dependencies between objects
-
High-level modules should not depend on low-level modules
Both should depend on abstractions (interfaces) This makes it easy to change the underlying implementation
-
Abstractions should not depend on details
Details should depend on abstractions
### Builder When piecewise object construction is complicated, provide an API for doing it succinctly
A builder is a separate component for building an object
Can either give builder a constructor or return it via a static function
To make a builder fluid retutn this
Different facets of an object can ve built with different builders working in tandem via a base class