Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Symfony2 in SOA
Search
Wolfgang Pfnür
September 05, 2012
Programming
2
820
Symfony2 in SOA
Symfony2 in einer Service-Orientierten Architektur am Beispiel eines devbliss Projekts.
Wolfgang Pfnür
September 05, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
ソフトウェアエンジニアの成長
masuda220
PRO
12
1.7k
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
520
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
910
Pulsar2 を雰囲気で使ってみよう
anoken
0
240
CDK開発におけるコーディング規約の運用
yamanashi_ren01
2
140
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
110
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1k
チームリードになって変わったこと
isaka1022
0
200
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
120
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
170
もう僕は OpenAPI を書きたくない
sgash708
5
1.8k
負債になりにくいCSSをデザイナとつくるには?
fsubal
10
2.4k
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Building Adaptive Systems
keathley
40
2.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Producing Creativity
orderedlist
PRO
344
39k
Speed Design
sergeychernyshev
27
790
Documentation Writing (for coders)
carmenintech
67
4.6k
Embracing the Ebb and Flow
colly
84
4.6k
A Philosophy of Restraint
colly
203
16k
Transcript
Symfony2 in SOA Kifah Abbad, devbliss GmbH Luis Quintela Garcia,
devbliss GmbH Wolfgang Pfnür, devbliss GmbH
Vorab • Grober Überblick über komplexe Themen • Am Beispiel
von Projekt-X • Fragen bitte am Ende
TOC • Basics ◦ SOA ◦ Beispiele für Services ◦
RESTlike • Architektur Projekt-X • Symfony
SOA - Service-Oriented Architecture • Unterteilung in kleine Einheiten •
Vorteile ◦ Wiederverwendbarkeit ◦ Wartbarkeit ◦ Skalierbarkeit in der Entwicklung
Beispiele für Services • Chat • Commenting • Rating •
Pernod (Persistent Notification Daemon) • Buschfunk • ...
RESTlike • Zustandslos • URL => Resource • HTTP Method
=> CRUD • /users (POST, GET) • /users/{userId} (PUT, GET, DELETE) • /users/{userId}/albums/{albumId}
TOC • Basics • Architektur Projekt-X ◦ Frontend ◦ Firewall
◦ Symfony Service Container ◦ Services ◦ Inter-Service Kommunikation • Symfony
Frontend • Entkoppelung Server - Client • Validierung auf Client
• Statisches nicht immer neu laden ◦ AJAX • Optisch ansprechend • GWT (Google Web Toolkit)
None
Firewall • Janitor ◦ In der Blütezeit von VZ entwickelt
◦ Nginx ◦ Extrem viele Requests, zentrale Komponente ◦ Routen-Regex per Service-Config-Endpunkt ◦ AuthLevels • Juanitor ◦ Janitor mit Lua Konfiguration statt rewrites
None
Symfony Service Container • Bundle => Service • Schnelle Entwicklung
• Einfaches Deployment • Trotzdem: Service-Orientierte Architektur • Später Hochlast-Services extrahieren
None
Services • Problemspezifische Sprache • Problemspezifische Architektur • Existierende Services
• Vorhandene Sprach-Kenntnisse nutzen • Abwechslung ;-)
None
Inter-Service Kommunikation • Synchron ◦ HTTP ◦ Subrequest Symfony-Intern •
Asynchron ◦ AMQP (RabbitMQ) • Sonst nichts! • Keine Bundle-Übergreifenden Imports! ◦ Automatische Überwachung
TOC • Basics • Architektur Projekt-X • Symfony ◦ Entscheidungsfindung
◦ Routing ◦ ORM ◦ DMS ◦ Testing
Entscheidungsfindung • VZ-Redesign := PHP • Verschiedene Frameworks getestet ◦
Schnelligkeit ◦ Dependency Injection (gut für Tests) ◦ Coding Standards ◦ Symfony2 => Bestes Framework für PHP • Projekt-X: ◦ Wissen vorhanden ◦ Gute Erfahrungen
Routing • Warum kein FoSRestBundle? ◦ Befürchtung: zu unflexibel (Dezember
2010) • Routen per Annotation • AuthLevel + Regex für J(u)anitor • RequestListener per URL-Annotation aktivieren (z.B. GUID-to-ID)
ORM • Doctrine • Quasi Standard für Symfony • Mischen
von Mysql und MongoDB möglich
DMS • Domain-Model-Schema in Yaml • Objektdefinition ◦ Properties (mit
Typ) ◦ Validatoren ◦ Initialer Wert • Generierung von DTOs für alle Sprachen • Symfony-Entities erben von DTOs ◦ Doctrine Annotationen in Entities
None
None
Testing • Unittests ◦ Mocking (einfach dank Dependency Injection) •
Doctests (Python) ◦ Dokumentation der Routen ◦ Dokumentation der Benutzung ◦ Integrationstests
None
None
Exception Listener • Nur JSON erlaubt - auch bei Exceptions
◦ Client muss ja wissen, dass etwas kaputt ist • Doctests erwarten also JSON ◦ Es werden auch Fehlerfälle getestet • Anzeige von Fehlern im Browser (bcat) • Symfony-Fehlerscreen-HTML im JSON Payload (nur im Debug Mode)
Danke für die Aufmerksamkeit Fragen?