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
170
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
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
10
6.6k
Conquering Massive Traffic Spikes in Ruby Applications with Pitchfork
riseshia
0
160
All About Angular's New Signal Forms
manfredsteyer
PRO
0
110
複雑化したリポジトリをなんとかした話 pipenvからuvによるモノレポ構成への移行
satoshi256kbyte
1
1k
Advance Your Career with Open Source
ivargrimstad
0
480
育てるアーキテクチャ:戦い抜くPythonマイクロサービスの設計と進化戦略
fujidomoe
1
170
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
ポスターセッション: 「まっすぐ行って、右!」って言ってラズパイカーを動かしたい 〜生成AI × Raspberry Pi Pico × Gradioの試作メモ〜
komofr
0
1.2k
CI_CD「健康診断」のススメ。現場でのボトルネック特定から、健康診断を通じた組織的な改善手法
teamlab
PRO
0
200
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
460
Software Architecture
hschwentner
6
2.3k
overlayPreferenceValue で実現する ピュア SwiftUI な AdMob ネイティブ広告
uhucream
0
180
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Documentation Writing (for coders)
carmenintech
75
5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Optimizing for Happiness
mojombo
379
70k
The Cost Of JavaScript in 2023
addyosmani
53
9k
4 Signs Your Business is Dying
shpigford
185
22k
Site-Speed That Sticks
csswizardry
11
890
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
Designing for humans not robots
tammielis
254
26k
Building Applications with DynamoDB
mza
96
6.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
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!