Upload
paul-seiffert
View
1.056
Download
1
Embed Size (px)
DESCRIPTION
ENGLISH - Symfony developers should be happy about the amount of publicly available open source libraries they can use for building web applications. In most cases, these libraries can reduce the required development time greatly. However, when you have to maintain an application with many dependencies to third-party libraries, this can become one of your biggest problems. One issue is that you might want to exchange one library with another one but didn't think of this when integrating it. In another case, the maintainers of a bundle might not have the time to revise all pull-requests and bug tickets you sent them. With only a few tricks you can make these situations less painful! This talk uses the HTTP client library Guzzle as an example to discuss how you can profit from the great functionality it implements while avoiding vendor lock-in. --- GERMAN - Bei der Entwicklung von Symfony-Applikationen kann man auf eine Vielzahl bestehender OpenSource Bundles und Libraries zurückgreifen. Dies verkürzt in der Regel die Entwicklungszeit immens, da man nicht bei jedem Projekt "das Rad neuerfinden muss". Bei der längerfristigen Betreuung einer Applikation, die viele Third-Party-Libraries verwendet, wird allerdings genau dies oft zum Problem. Man möchte evtl. eine Komponente austauschen, hat dies allerdings bei der Integration nicht bedacht oder der Maintainer einer Library kann nicht die Zeit aufbringen die notwendig wäre, alle Pull-Requests und Bug-Tickets zu bearbeiten. Diese Situation lässt sich mit ein paar Tricks deutlich weniger schmerzhaft gestalten. Dieser Vortrag erklärt am Beispiel der HTTP-Client-Library Guzzle, wie man die Abhängigkeiten zu konkreten Libraries und Bundles gering hält und dabei trotzdem von ihnen profitieren kann. Rate this talk: https://joind.in/9418
Citation preview
R A U S A U S D E M V E N D O R - L O C K - I N
PA U L S E I F F E R T | 0 8 . N O V E M B E R 2 0 1 3
S Y M F O N Y L I V E B E R L I N 2 0 1 3
PA U L S E I F F E R T
V E N D O R - L O C K - I N
Grenzen der Bibliotheken
Keine Garantien
Einfluss auf die eigene Architektur
A B E R …
Wiederkehrende Funktionalität
Best Practices
Gekapselte Komplexität
F R Ü H E R …
• “reines” PHP
• keine Frameworks
• Viel Technologie-spezifischer Code
• Stark gekoppelte Komponenten
V E N D O R - L O C K - I N ?✔✔✔
S PÄT E R …
• Struktur durch Framework
• Abstraktion über Technologien
• Libraries teilweise austauschbar
• Vermischte Concerns
• Framework nicht austauschbar
V E N D O R - L O C K - I N ?✔
E S G E H T N O C H B E S S E R !Controller PageRepository
<<Interface>>PageStorage
Symfony / HTTP Application
MySQLPageStorage
MySQLBackend
MySQLConnection
• Das Herzstück der Software ist ein Modell der Domäne
• Frameworks sind Details
• Libraries sind austauschbar durch semantische Abstraktionen
Controller PageRepository
<<Interface>>PageStorage
Symfony / HTTP Application
MySQLPageStorage
MySQLBackend
MySQLConnection
V E N D O R - L O C K - I N ?
X
B E I S P I E L : G U Z Z L E
• HTTP-Client Library
• Viele praktische Features
• Erweiterbar
I N T E G R AT I O N V O N G U Z Z L E
I ) G U Z Z L E - C L I E N T O B J E C T
V E N D O R - L O C K - I N ?✔
I I ) G U Z Z L E - B U N D L E
I I ) G U Z Z L E - B U N D L E
I I ) G U Z Z L E - B U N D L E
V E N D O R - L O C K - I N ?
✔✔
I I I ) E I G E N E S I N T E G R AT I O N S - B U N D L E
Controller <<interface>>Search
GuzzleSearch GuzzleClient
AppBundle
GuzzleSearchBundle
V E N D O R - L O C K - I N ?
✔
I I I ) E I G E N E S I N T E G R AT I O N S - B U N D L E
Controller Search
GuzzleSearchClientGuzzleClient
AppBundle
GuzzleSearchBundle
<<interface>>SearchClient
Application
V E N D O R - L O C K - I N ?
X
S Y M F O N Y- A N W E N D U N G
G U Z Z L E
S Y M F O N Y / H T T P
G U Z Z L E
A P P L I K AT I O N S - L O G I K
G U Z Z L E -S E A R C H
T E S T I N G
S Y M F O N Y / H T T P
G U Z Z L E
A P P L I K AT I O N S - L O G I K
G U Z Z L E -S E A R C H
• Erfindet das Rad nicht neu
• Macht Euch nicht abhängig
• Semantische Abstraktionen
• Dependency Injection
D A N K E S C H Ö N !
https://joind.in/9418
• Eric Evans: Domain-Driven Design
• Vaughn Vernon: Implementing Domain-Driven Design
• Guzzle: guzzlephp.org
L E S E S T O F F
• Lock - http://www.flickr.com/photos/24410855@N07/3172109331/
• Wheel - http://www.flickr.com/photos/72802667@N00/456568753
• Structure - http://www.flickr.com/photos/46271629@N00/2305078608
• Progress - http://www.flickr.com/photos/29312295@N06/4115844000
• Spaghetti - http://www.flickr.com/photos/7897906@N06/8602097091
• United States Capitol - Paul Seiffert
• Gears - http://www.flickr.com/photos/wwarby/4782904694/
• Guzzle - http://www.flickr.com/photos/66969579@N00/451668854
• Questions - http://www.flickr.com/photos/bilal-kamoon/6835060992
P H O T O S