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
MatteoVaccariBirthdayGreetingsKataInSCBCN2013
Search
trikitrok
September 28, 2013
Programming
0
160
MatteoVaccariBirthdayGreetingsKataInSCBCN2013
Presentation for Matteo Vaccari's Birthday Greetings Refactoring Kata that we did in SCBCN
trikitrok
September 28, 2013
Tweet
Share
Other Decks in Programming
See All in Programming
Progressive Web Apps for Rails developers
siaw23
2
520
AWS Lambda Web Adapterを活用する新しいサーバーレスの実装パターン
tmokmss
6
5.3k
Composing an API the *right* way (Droidcon New York 2024)
zsmb
2
530
Pythonによるイベントソーシングへの挑戦と現状に対する考察 / Challenging Event Sourcing with Python and Reflections on the Current State
nrslib
3
800
全方位強化 Python 服務可觀測性:以 FastAPI 和 Grafana Stack 為例
blueswen
1
360
RDBの世界をぬりかえていくモデルグラフDB〜truncus graphによるモデルファースト開発〜
jurabi
0
140
Интеграционное тестирование: как приручить хаос
mariyasaygina
0
460
Patched fetch did not work
quramy
6
480
Cloud Adoption Frameworkにみる組織とクラウド導入戦略(縮小版)
tomokusaba
1
120
色んなオートローダーを覗き見る #phpcon_okinawa
o0h
PRO
5
360
DjangoNinjaで高速なAPI開発を実現する
masaya00
0
420
Micro Frontends Unmasked: Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
250
Featured
See All Featured
Designing for Performance
lara
604
68k
A better future with KSS
kneath
235
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
263
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
40
9.2k
What's new in Ruby 2.0
geeforr
340
31k
Done Done
chrislema
180
16k
Debugging Ruby Performance
tmm1
72
12k
Robots, Beer and Maslow
schacon
PRO
157
8.2k
The Invisible Customer
myddelton
119
13k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
Adopting Sorbet at Scale
ufuk
73
8.9k
Side Projects
sachag
452
42k
Transcript
Birthday Greetings Kata Manuel Rivero @trikitrok
The kata Created by Matteo Vaccari. Alistair Cockburn's:
Ports and Adapters. a. k. a. Hexagonal Architecture Refactoring version.
The initial code Clone it from: https://github.com/trikitrok/BirthdayGreetingsKata SCBCN2013InitialCode
The initial code 1. Read employee records from a file.
2. Filter employees whose birthday is today. 3. Send a personalized greetings message by email.
Problems BirthdayService Has too many responsibilities. Depends
on low level APIs. Talks with external systems. ...
Ports and Adapters
In the ports and adapters architecture Domain Model depends
on nothing Everything depends on the domain model
Ports and Adapters
Benefits Easier to change as requirements change Easier
to test Easier to understand
Ports and Adapters
Ports and Adapters
Ports and Adapters Port Façade (interface) → Adapter
Concrete → implementation
Ports and Adapters
Refactoring technique Small steps! Keep tests green at
all times!
Refactoring approach 1. Identify a responsibility 2. Extract a method
3. Create a new class 4. Move that method to the new class
Refactoring guides Single Responsibility Principle First at function
level, then at class level. Dependency Inversion Principle
None
Let's start!