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
Avoiding the mud - Symfony Live London
Search
Richard Miller
September 21, 2013
Technology
7
730
Avoiding the mud - Symfony Live London
Richard Miller
September 21, 2013
Tweet
Share
More Decks by Richard Miller
See All by Richard Miller
Introduction to Symfony2 - DrupalCamp London 2014
richardmiller
0
210
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
490
better searching with elasticsearch
richardmiller
2
260
What do I get from the full stack framework?
richardmiller
1
1.3k
Advanced Service Container Utilization
richardmiller
4
1k
Dependency Injection and the Symfony2 Service Container
richardmiller
9
13k
Other Decks in Technology
See All in Technology
テストコードを書きながらCompose Multiplatformを乗りこなす
subroh0508
0
140
Google Cloud Next '24 Recap in ZOZO AIにより変わる開発 運用/Development and operation changed by AI
gachimuchiengineer
0
200
「できる!」を増やすGitHub Copilot活用法 / How to use GitHub Copilot to expand your possibilities
sansan_randd
1
240
データ分析力を高めるSQL研修サービス『SQL Everyone』
hikarut
1
390
エムスリーマルチデバイスチーム紹介資料 / Introduction of M3 Multi Device Team
m3_engineering
1
170
iThome2024 Wailing Wall of Enterprise Security
notsurprised
0
300
TailwindCSSでUIライブラリを作る際のハマりどころ
shuta13
0
230
使われないものを作るな!出口から作るデータ分析基盤 / Data Platform Development Starting from the User Needs
amaotone
16
4.6k
My road to OSEE Part1
yunolay
0
110
【TSkaigi】2024/05/11 当日スライド
kimitashoichi
14
4k
令和版ソフトウェアエンジニアの情報収集術 PHPカンファレンス香川2024
ysknsid25
4
900
株式会社EventHub・エンジニア採用資料
eventhub
0
2.1k
Featured
See All Featured
Become a Pro
speakerdeck
PRO
13
4.6k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
21
1.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
25
2k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Music & Morning Musume
bryan
41
5.6k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
The Power of CSS Pseudo Elements
geoffreycrofte
62
5k
Embracing the Ebb and Flow
colly
80
4.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
275
13k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
188
16k
Debugging Ruby Performance
tmm1
70
11k
Transcript
AVOIDING THE MUD by Richard Miller http://www.flickr.com/photos/burge5000/22568539/
@mr_r_miller http://www.richardmiller.co.uk
http://www.flickr.com/photos/brostad/8583990904
http://www.flickr.com/photos/dominik99/384027019
http://www.flickr.com/photos/jasmeet/2158002974
Bundles For Everything? http://www.flickr.com/photos/jarkel/2288176
Separate Domain Model From Bundles http://www.flickr.com/photos/30666161@N05/3705814710
HumanResourcesBundle
HumanResourcesBundle HumanResources
HumanResourcesBundle HumanResources
http://www.flickr.com/photos/26582481@N08/3040936355 Enough?
Still Tightly Coupled
AbsenceEntity Request Absence Form Cancel Absence Form Approve Absence Form
Change Absence Type Form
Sensio\HumanResources\Absence\AbsenceEntity: properties: reason: - NotBlank: { groups: [cancellation] } -
Length: { max: 300, groups: [cancellation] }
AbsenceEntity Request Absence Form Cancel Absence Form Approve Absence Form
Change Absence Type Form Request Absence Command Cancel Absence Command Approve Absence Command Change Absence Type Command
What About Templates?
AbsenceEntity upcoming .html .twig details .html .twig calendar .html .twig
unapproved .html .twig
{% if absence.endDate < date() %} past {% else %}
absence.status {% endif %} getDisplayStatus() AbsenceEntity getEndDate() getStatus()
{% if absence.endDate < date() %} past {% else %}
absence.status {% endif %} getDisplayStatus() AbsenceEntity getEndDate() getStatus()
{{ absence.displayStatus }} getDisplayStatus() AbsenceEntity getEndDate() getStatus() getDisplayStatus()
{{ absence.displayStatus }} getDisplayStatus() AbsenceEntity getEndDate() getStatus() getDisplayStatus()
AbsenceEntity Request Absence Form Cancel Absence Form Approve Absence Form
Change Absence Type Form Absence View upcoming .html .twig details .html .twig calendar .html .twig unapproved .html .twig
AbsenceEntity Request Absence Form Cancel Absence Form Approve Absence Form
Change Absence Type Form Absence View upcoming .html .twig details .html .twig calendar .html .twig unapproved .html .twig getStatus()
Unapproved Absence View Calendar View AbsenceEntity Request Absence Form Cancel
Absence Form Approve Absence Form Change Absence Type Form Upcoming Absences View Absence Details View upcoming .html .twig details .html .twig calendar .html .twig unapproved .html .twig
SRP
Behaviour Not State
Request Absence Controller Absence Entity setReason($reason) setStatus(AbsenceEntity::CANCELLED) setCancellationDate(new DateTime()) Cancel
Absence Command getReason()
Request Absence Controller Absence Entity cancel($reason) Cancel Absence Command getReason()
Cancel Absence Command Absence Entity Validate internal consistency Validate user
input
CancelAbsenceComm andHandler Cancel Absence Command Handler AbsenceEntity cancel($reason) handle($command) Request
Absence Controller Absence Entity cancel($reason) Cancel Absence Command
Infrastructure?
Absence Repository (Interface) findById($id) findUpcomingByMember($member) findAllByMember($member) Doctrine ORM Absence Repository
Doctrine ODM Absence Repository Guzzle Client Absence Repository Infrastructure Domain
AbsenceEntity Absence Repository Domain Bundle Service Config Infrastructure Doctrine ORM
Absence Repository Mapping Config
Absence Repository (Interface) findById($id) findUpcomingByMember($member) findAllByMember($member) add(AbsenceEntity $absence)
Events
OnUpdate Event AbsenceEntity Dispatches
OnUpdate Event AbsenceEntity Dispatches
Absence Cancelled Event Cancel Absence Command Handler Dispatches
Absence Cancelled Event In Memory Listener Immediate Action Place In
Messaging Queue Listens
Absence Cancelled Event Flush Listener Listens Absence Approved Event Domain
Infrastructure Listens
Separating Commands From Queries
Command Command Handler Entity Datastore
Datastore View Datastore View Datastore Command Command Handler Entity Event
Datastore View Datastore View Datastore Command Command Handler Entity View
Template Event
Separating Bundles Horizontally
Non-application Specific Code
HumanResources CustomLoggingBundle HumanResourcesBundle
HumanResourcesBundle HumanResources CustomLoggingBundle CustomLogging CustomLoggingBundle CustomLoggingBundle CustomLogging HumanResourcesBundle
HumanResources CustomLoggingBundle CustomLogging CustomLoggingBundle CustomLoggingBundle CustomLogging If it must! HumanResourcesBundle
HumanResources CustomLoggingBundle CustomLogging CustomLoggingBundle CustomLoggingBundle CustomLogging HumanResourcesBundle
Separating By Context
AbsencePlannerBundle AbsencePlanner CustomLoggingBundle CustomLogging CustomLoggingBundle RecruitmentBundle Recruitment
Message Queue/REST AbsencePlannerBundle AbsencePlanner CustomLoggingBundle CustomLogging CustomLoggingBundle RecruitmentBundle Recruitment
CustomLoggingBundle CustomLogging CustomLoggingBundle RecruitmentBundle Recruitment Off the shelf Package Message
Queue/REST Message Queue/REST AbsencePlannerBundle AbsencePlanner
Separate Commonality
AbsencePlannerBundle AbsencePlanner RecruitmentBundle Recruitment AbsencePlannerBundle AbsencePlanner CustomLoggingBundle CustomLogging CustomLoggingBundle RecruitmentBundle
Recruitment User Management
!= Staff Member Entity User Entity
AbsencePlannerBundle AbsencePlanner AbsencePlannerBundle AbsencePlanner CustomLoggingBundle CustomLogging CustomLoggingBundle RecruitmentBundle Recruitment UserManagementBundle
Now?
http://www.flickr.com/photos/mtsofan/8313606885
https://github.com/beberlei/litecqrs-php http://behat.org/
http://williamdurand.fr/ http://verraes.net/#blog http://www.whitewashing.de/
QUESTIONS?