Date post: | 22-Nov-2014 |
Category: |
Internet |
Upload: | webfactory-gmbh |
View: | 65 times |
Download: | 1 times |
Paketmanagementfür Champions ;-)
Matthias Pigulla – webfactory GmbH –
16.07.2014
-(Foto wf)
Gestatten: webfactory.
War stories
wfLibSystemweite (eigene) Bibliothek im include_path
Bugs/BC breaks machen viel auf einmal kaputt
Was einmal drin ist, können wir nur noch schwer
ändern.
PEAR_DB vs. Zend_DB
Branches in Sync?
Composer to the rescue!Schrittweiser Umbau in Pakete
Composer-Repo selbstgeschrieben in 11/2011
Es geht schnell und leicht, für irgendwas ein Paket anzulegen.
Dank .lock-File können wir gut weiterentwickeln.
BasicsGanz wichtig.
Ceci n‘est pas un paquet.
Wiederverwendung!= Ctrl-C, Ctrl-V
Release Reuse Equivalence Principle
The granule of reuse is the granule
of release. Only components that are
released through a tracking system
can be effectively reused. This
granule is the package.
Robert C. Martin: Granularity (1997)
http://www.objectmentor.com/resources/articles/granularity.pdf
Was ist die Schnittstelle
(m)eines Pakets?
Schnittstellen-Dokumentation
Upgrading-NotesChangelogExtension pointscomposer.json, ...
Versionsnummern
Normal-wichtig.
Semantical Versioning
semver.org
Fun fact: Zwei von drei Teilnehmern der Online-Umfrage habennoch nie davon gehört.
X.Y.ZMajor.Minor.Bugfix
Beseitigt ein Problem, ohne dass dafür Änderungen am eigenen Code notwendig sind.
Bugfix
Geiler Scheiß, den andere bestimmt auch gerne hätten.
Feature
Neue oder strengere Abhängigkeiten.
Feature.Feature?Feature!
Alles, was Änderungen an existierendem Code erforderlich macht.
Schlechte Idee.
~X.Y
Release-Policy
So mittel-wichtig.
Welche Major/Minor pflegenwir noch?
Wann bringe ich eine neue Version?
Sofort, regelmäßig, beim Launch, wenn es sich lohnt...?
Prinzipien des Paketdesigns
Interessant.
Aller guten Dinge sind drei.
Common Reuse Principle
The classes in a package are reused
together. If you reuse one of the
classes in a package, you reuse
them all.
Robert C. Martin: Granularity (1997)http://www.objectmentor.com/resources/articles/granularity.pdf
Common Closure Principle
The classes in a package should be
closed together against the same
kinds of changes. A change that
affects a package affects all classes
in that package.
Robert C. Martin: Granularity (1997)
http://www.objectmentor.com/resources/articles/granularity.pdf
Stable Dependencies Principle
The dependencies between packages
in a design should be in the direction of
the stability of the packages. A
package should only depend upon
packages that are more stable than it
is.
Robert C. Martin: Stability(1997)
http://www.objectmentor.com/resources/articles/stability.pdf
Stability
Schwer zu ändern
Wenig Anlass für Änderungen
Wann sollte das Design erfolgen?
Tools rund um Composer
Praktisch.
clue/graph-composergithub.com/clue/graph-composer
Satis
github.com/composer/satis
Toran Proxy
toranproxy.com(kommerziell)
track.wf Follow @webfactory
Depending
„Depending is an online tool to
monitor your PHP project
dependencies. It shows your project
dependencies status, right away
after you're commiting new code
into your Github repository.“
– depending.in
Security Advisories Checker
security.sensiolabs.org/check
„Gemnasium parses your projects
dependencies and notifies you when
new versions are released or need
to updated.“
– gemnasium.com
Kopfschmerzen, weil...1. Schnittstelle aus Versehen
geändert2. Schnittstelle absichtlich geändert3. SemVer falsch angewendet4. Zu wenig Planung und bewusstes
Paketdesign
TL;DR
Danke!Dipl. Wirt. Inf. Matthias Pigulla
webfactory GmbH, Bonn
[email protected]@mpdude_degithub.com/mpdude
webfactory.de/blog