I Stand With Ukraine
Anna Filina
• Coding since 1997.
• PHP, Java, C#, etc.
• Legacy archaeology.
• Test automation.
• Talks and workshops.
• YouTube videos.
• Filina Consulting.
Slide 3
Slide 3 text
I Stand With Ukraine
Slide 4
Slide 4 text
I Stand With Ukraine
#100
Slide 5
Slide 5 text
I Stand With Ukraine
Object
Back-and-forth
Collaborator
Slide 6
Slide 6 text
I Stand With Ukraine
Object
One-way reference
Collaborator
Slide 7
Slide 7 text
I Stand With Ukraine
Object
Chatty
Collaborator
Step 1
Step 2
Step 3
Slide 8
Slide 8 text
I Stand With Ukraine
Object
Less chatty
Collaborator
Task
Step 1
Step 2
Step 3
Slide 9
Slide 9 text
I Stand With Ukraine
Is the complexity justified?
Object 1
Object 2
Object 3
Object 4
Bus
Slide 10
Slide 10 text
I Stand With Ukraine
Design Drive
• Avoid complexity until I need it.
• Do I understand what’s going on in terms of the business use case?
Slide 11
Slide 11 text
I Stand With Ukraine
Slide 12
Slide 12 text
I Stand With Ukraine
Objects should speak business,
not technical.
Slide 13
Slide 13 text
I Stand With Ukraine
$lineItems = $this->orders->getLineItems($pendingOrderNumber);
$taxTotals = $this->taxes->calculateForLineItems($lineItems);
Slide 14
Slide 14 text
I Stand With Ukraine
Project
• Marketplace for short-term rental:
• Search properties for rent by city, date and number of guests.
• Reserve & pay.
Slide 15
Slide 15 text
I Stand With Ukraine
ReservationService
->reserve()
PaymentManager
ReservationManager
processPayment(data)
Templating
saveReservation(data)
confirmReservation(data)
html
EmailManager
payment
savePayment(data)
confirmReservation(html)
Slide 16
Slide 16 text
I Stand With Ukraine
ReservationService
->reserve()
PaymentManager
ReservationManager
processPayment(data)
Templating
saveReservation(data)
confirmReservation(data)
html
EmailManager
payment
savePayment(data)
confirmReservation(html)
Slide 17
Slide 17 text
I Stand With Ukraine
MakeReservation ReservationRepository
add(paidReservation)
ReservationNotifier
PaymentProcessor
capture(charge)
paymentConfirmation
notifyBuyer(paidReservation)
Slide 18
Slide 18 text
I Stand With Ukraine
MakeReservation ReservationRepository
add(paidReservation)
ReservationNotifier
PaymentProcessor
capture(charge)
paymentConfirmation
notifyBuyer(paidReservation)
Slide 19
Slide 19 text
I Stand With Ukraine
MakeReservation ReservationRepository
add(paidReservation)
ReservationNotifier
PaymentProcessor
capture(charge)
paymentConfirmation
notifyBuyer(paidReservation)
Slide 20
Slide 20 text
I Stand With Ukraine
MakeReservation ReservationRepository
add(paidReservation)
notifyBuyer(paidReservation)
ReservationNotifier
PaymentProcessor
capture(charge)
paymentConfirmation
Slide 21
Slide 21 text
I Stand With Ukraine
MakeReservation ReservationRepository
add(paidReservation)
ReservationNotifier
PaymentProcessor
capture(charge)
paymentConfirmation
notifyBuyer(paidReservation)
Slide 22
Slide 22 text
I Stand With Ukraine
Good design needs no diagrams.
Slide 23
Slide 23 text
I Stand With Ukraine
Slide 24
Slide 24 text
I Stand With Ukraine
Slide 25
Slide 25 text
I Stand With Ukraine
Simple Code
• No need for framework.
• No need to design the database.
• No need to have a UI.
• Code the business rules.
Slide 26
Slide 26 text
I Stand With Ukraine
Slide 27
Slide 27 text
I Stand With Ukraine
Handle HTTP Request
Return HTTP Response
2 adults
in Lviv
on Jan 1 to Jan 7
Results containing
“Lviv for 4”
Slide 28
Slide 28 text
I Stand With Ukraine
Slide 29
Slide 29 text
I Stand With Ukraine
Handle HTTP Request
Return HTTP Response
2 adults
in Lviv
on Jan 1 to Jan 7
Results containing
“Lviv for 4”
Slide 30
Slide 30 text
I Stand With Ukraine
Slide 31
Slide 31 text
I Stand With Ukraine
Slide 32
Slide 32 text
I Stand With Ukraine
Slide 33
Slide 33 text
I Stand With Ukraine
Slide 34
Slide 34 text
I Stand With Ukraine
Slide 35
Slide 35 text
I Stand With Ukraine
A complex system that works is
invariably found to have evolved from a
simple system that worked.
— John Gall
Slide 36
Slide 36 text
I Stand With Ukraine
Slide 37
Slide 37 text
I Stand With Ukraine
Too reusable becomes unusable.
Slide 38
Slide 38 text
I Stand With Ukraine
Slide 39
Slide 39 text
I Stand With Ukraine
Slide 40
Slide 40 text
I Stand With Ukraine
Input/output Business rules Infrastructure
Use case
Slide 41
Slide 41 text
I Stand With Ukraine
Slide 42
Slide 42 text
I Stand With Ukraine
Slide 43
Slide 43 text
I Stand With Ukraine
Slide 44
Slide 44 text
I Stand With Ukraine
Slide 45
Slide 45 text
I Stand With Ukraine
Slide 46
Slide 46 text
I Stand With Ukraine
Slide 47
Slide 47 text
I Stand With Ukraine
Slide 48
Slide 48 text
I Stand With Ukraine
Slide 49
Slide 49 text
I Stand With Ukraine
Slide 50
Slide 50 text
I Stand With Ukraine
Slide 51
Slide 51 text
I Stand With Ukraine
Slide 52
Slide 52 text
I Stand With Ukraine
PropertySearchHandler
Lviv, Lviv Oblast, Ukraine
Convert to coordinates.
CitySearchHandler
Lviv - Lviv, Lviv Oblast, Ukraine
- Lviv Boulevard, Oshawa, ON
Slide 53
Slide 53 text
I Stand With Ukraine
Slide 54
Slide 54 text
I Stand With Ukraine
PropertySearchHandler
49.8397, 24.0297 Longitude: -180 to +180
Latitude: -90 to +90
CitySearchHandler
Lviv
Lviv, Lviv Oblast, Ukraine
49.8397
24.0297
Slide 55
Slide 55 text
I Stand With Ukraine
Slide 56
Slide 56 text
I Stand With Ukraine
Code is simply a model of
the business rules and knowledge.