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
ONE WEDGE_company_guide
1wedge_one
0
490
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.4k
GitHub Copilotのススメ
marcy731
1
200
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
820
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
410
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
920
Goのエラースタックトレースの歴史と今後
sonatard
9
1.5k
Polars入門
daikikatsuragawa
1
100
Apache Hive 4 on Treasure Data
ryukobayashi
0
340
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
650
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
180
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
Featured
See All Featured
KATA
mclloyd
15
12k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
21
1.6k
The Mythical Team-Month
searls
216
42k
Statistics for Hackers
jakevdp
789
220k
How to name files
jennybc
65
93k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
14
1.6k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
187
16k
The Invisible Side of Design
smashingmag
294
49k
The Pragmatic Product Professional
lauravandoore
25
5.8k
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!