Principles
SOLID
- Single Responsibility Principle (SRP)
- class should have single responsibility
- class shoud have one, and only one, reason to change
- Open/Closed Principle (OCP)
- class should be open for extension, but closed for modification
- Liskov substition principle (LSP)
- object should be replacable by instances of their subtypes without altering the correctness of that
programm
- Interface Segregation Principle (ISP)
- many client specific interfaces better then one general purpose interface
- Dependency Inversion Principle (DIP)
- one should depend upon asbtraction not conretion
GRASP
General responsibility assignment software patterns
- Controller
- Controller is responsible for receiving or handling a system event
- Creator
- Creator is responsible for creating objects
- - contain or compositely aggregate instances
- - record or closely use instances
- - have initializing information for instances
- High cohesion
- Responsibility are strongly related and highly focused
- Indirection
- Assign the responsibility of mediation between two elements to an intermediate object
- Information expert
- Assign the responsibility to the class which has the information neccessary to fulfill that responsibility
- Low coupling
- Assign responsibilities to support lower dependency between classes, change in one class having lower
impact on other classes, higher reuse potential
- Polimorphism
- Assign a responsibility according to the type of variation of behaviors by polymorphic operations
- Protected variation
- Protects elements from variations on others by wrapping into interface and using polymorphism
- Pure fabrication
- Specially made class to archieve low coupling, high cohesion and reuse potential
YARGNI
You aren't gone need it`
KISS
Keep it short and simple
DRY
Don't repeat your self
Hollywood Principle
Don’t Call Us, We’ll Call You.
Ocam's razor
Entities should not be multiplied without necessity. When presented with competing hypotheses that make the
same predictions, one should select the solution with the fewest assumptions, and it is not meant to be a way
of choosing between hypotheses that make different predictions
SSOT (single source of truth)
Single source of truth (SSOT) is the practice of structuring information models and associated data schema
such that every data element is mastered (or edited) in only one place