Architecture principles

Principles

Law of Demetr (LOD)

Base postulates

Every unit should have limited knowledge about other units: only "closely" related to the current unit

Each unit should only talk to its friends; don't talk to stangers

Only talk to your immediate friends

Links

Why its needed (ru): https://toster.ru/q/44822

Pros

Lower dependencies between classes

Safer code change

Potentialy lower Response for Class (RFC) Metric

Cons

Wrappers time & space overhead

Layer architecture is an implementation of LOD

Design Patters

Chain of responsibility

Relay messages

Command

Metrics

Metrics types

Response for Class (RFC)

inokation complexity on message

lower RFC - lower bugs

Weighted Methods per Class (WMC)

Sum of complexity of all class methods

We can have ~7 entities in same time in mind