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
Perth Code Dojo 3
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
William Webster
October 02, 2014
Programming
0
90
Perth Code Dojo 3
Inheritance vs composition
William Webster
October 02, 2014
Tweet
Share
More Decks by William Webster
See All by William Webster
Building_Highly_Engaged_Teams.pdf
burlistic
0
110
Quantum Encryption - Advances In Data Security
burlistic
0
51
Perth Code Dojo 12
burlistic
0
82
Perth Code Dojo 11
burlistic
0
62
Introducing Agile to Enterprise
burlistic
0
73
Perth Code Dojo 6 - Decoupling the UI
burlistic
0
62
Perth Code Dojo 4
burlistic
0
46
Perth Code Dojo 5
burlistic
0
46
Perth Code Dojo 2
burlistic
0
100
Other Decks in Programming
See All in Programming
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
380
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
200
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
160
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
5
390
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
120
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
710
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
410
AHC061解説
shun_pi
0
360
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
160
Ruby and LLM Ecosystem 2nd
koic
1
590
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.3k
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
400
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
250
The Cult of Friendly URLs
andyhume
79
6.8k
Paper Plane (Part 1)
katiecoart
PRO
0
5.5k
Producing Creativity
orderedlist
PRO
348
40k
The agentic SEO stack - context over prompts
schlessera
0
690
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
WENDY [Excerpt]
tessaabrams
9
36k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
160
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
210
Transcript
Perth Code Dojo 3 @willwebst #CodeDojo
Check-In ➔ Your name ➔ What you do (at work)
➔ A random fact about yourself
Code Dojo Format A Coding Dojo is a coding session
centered around a programming challenge. The dojo provides a safe place to learn and experiment away from the pressures of business delivery. All programmers of varying skill levels meet as equals to learn and share.
Software Craftsmanship We were all rookies once Sharing of experiences
Key concepts, new audience
Dojo Rules ➔ Paired Programming ➔ Simple Design ➔ Test
Driven Development ➔ Refactoring
XP Practices ➔ Paired Programming ◆ A better design ◆
Collective code ownership ◆ Improved quality / less defects ◆ High standards ◆ Focus / A pair is harder to distract
Pomodoro ➔ Pomodoro Technique ◆ 25 mins on, 5 mins
off ◆ http://tomatoi.st/perthcodedojo ➔ Four iterations
Retro & Pizza Closing with Pizza and a mini retrospective
➔ Share solutions on the big screen ➔ Discuss challenge / approach ➔ Feedback on the dojo
Polite Notice Please respect each others commitment. During a Pomodoro.
➔ No Facebook ➔ Mobile phones ➔ Etc.
Have Fun! Most importantly have fun! ➔ Drinks are available
- help yourselves
Virtual garden!
Objective Composition and Inheritance What’s the difference? When to use?
Objective Inheritance for: ◦ versioning / commonality ◦ keeping state
◦ not forcing implementation - can stick with base
Objective Composition for: ◦ Applied to many disparate objects ◦
Has-a concept ◦ Polymorphism Liskov substitution principle ◦ Breaking changes
Create a basic garden Dimensions (50 metres x 10 metres)
Soil type = clay Last watered Positional (X / Y) 1 x trees 2 x flowers
Begin! 25 mins
Stop! 5 mins
Extend Add a Mulch method Once called will mulch all
applicable items
Begin! 25 mins
Stop! 5 mins
Second garden type Japanese Garden Dimensions (80 metres x 20
metres) Soil type = silt Positional (X / Y) 1 x ornate bridge 2 x trees
Begin! 25 mins
Stop! 5 mins
Third garden type Modern Low Maintenance Dimensions (20 metres x
12 metres) Soil type = na Area covered 1 x Artificial Lawn
Begin! 25 mins
Stop! 5 mins
Mini Retro How would you refactor to improve the design?
Discuss when to apply inheritance for re-use? Any real examples where you have felt inheritance pain?
Bring a friend
Thank you sponsors! Code - http://github.com/burlistic Slides - http://speakerdeck.com/burlistic @willwebst