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
180
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
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.5k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
160
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.6k
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
750
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
190
CSC307 Lecture 14
javiergs
PRO
0
470
AHC061解説
shun_pi
0
360
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
170
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
1
200
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
540
How to stabilize UI tests using XCTest
akkeylab
0
110
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
100
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.4k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
820
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
210
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
410
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
190
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
190
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
380
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
68
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!