Alexander Makarov / Yii core team
https://slides.rmcreative.ru/2019/bgphp-packages/
into...
TTL of the item is ~20 sec.
We can not operate with high number of items:
Architecture is needed to deal with complex systems.
For our brain too complicated comes way too fast.
© 2000 Robert Martin
REP, CCP, CRP
ADP, SDP, SAP
The granule of reuse is the granule of release
Group and prepare code to be reused.
Release with proper versioning (SemVer).
Classes that change together are packaged together
The change should be within the package.
Classes that are used together are packaged together
Package should be focused.
Client should either use everything or nothing.
Dr. Stefan Kluth, Max-Planck-Institut fuer Physik
On early stages focus on CCP and REP.
Dr. Stefan Kluth, Max-Planck-Institut fuer Physik
The dependency graph of packages must have no cycles
Cycles are causing cascading problems.
There is clue/graph-composer.
But (PR #45) should be applied to exclude non-interesting packages.
The less dependencies the simpler everything is...
Or rethink the package...
Depend in the direction of stability
You can't build stable thing on unstable base.
A package abstractness should increase with stability
Stable packages are abstract.
Flexible packages are concrete.
X axis — abstractness, Y axis — instability.
Distance from main line.
0 is good.
1 is bad.
Sometimes 0, 0 is OK. Strings, arrays, stdlib.
Same as SOLID, these principles and metrics are not dogmas but tools.
Correct design results in explosive increase in number of packages. It is scary.
Principles are there to keep you away from either left-pad or monolith.
These tools should help producing code that breaks less.