Open/closed principle • Your code should be open for extension, but closed for modification. • Code against abstract not concrete classes (interfaces in PHP).
Liskov substitution principle • Every subclass or derived class should be substitutable for their base/parent class. • Only narrow, never widen, the input for sub classes
plugin • Version control • Package definition file • SemVer and BC in minor versions • Meta files and documentation • Tests, CI and coverage And don’t forget to maintain it :-)
• Code that is used together, should be ideally in the same package Common-closure principle • A package should not have more than one reason to change.
dereuromark/cakephp-shim • dereuromark/cakephp-ajax • dereuromark/cakephp-geo • dereuromark/cakephp-feed • dereuromark/cakephp-tinyauth • dereuromark/cakephp-meta • dereuromark/cakephp-flash • dereuromark/cakephp-mobile On top of dereuromark/cakephp-tools now 6 extracted 3.x plugins with clear groups
(ADP, SDP, SAP) • Prevent cycling dependencies • Change is easiest when a package has not many dependencies (stable), so make sure if it does those are also not blocked for change. • Stable packages ideally have a lot of abstraction (interface, …) exposed to the depending parts so their stability does not prevent them from being extended.