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
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
270
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.7k
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
310
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
190
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
190
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
CSC509 Lecture 09
javiergs
PRO
0
140
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
170
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
300
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
250
Quine, Polyglot, 良いコード
qnighy
4
620
Java ジェネリクス入門 2024
nagise
0
690
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
700
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Side Projects
sachag
452
42k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
Docker and Python
trallard
40
3.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
The Invisible Side of Design
smashingmag
297
50k
KATA
mclloyd
29
14k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
For a Future-Friendly Web
brad_frost
175
9.4k
Building Your Own Lightsaber
phodgson
102
6.1k
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!