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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
William Webster
October 02, 2014
Programming
96
0
Share
Perth Code Dojo 3
Inheritance vs composition
William Webster
October 02, 2014
More Decks by William Webster
See All by William Webster
Building_Highly_Engaged_Teams.pdf
burlistic
0
120
Quantum Encryption - Advances In Data Security
burlistic
0
57
Perth Code Dojo 12
burlistic
0
88
Perth Code Dojo 11
burlistic
0
73
Introducing Agile to Enterprise
burlistic
0
79
Perth Code Dojo 6 - Decoupling the UI
burlistic
0
67
Perth Code Dojo 4
burlistic
0
52
Perth Code Dojo 5
burlistic
0
52
Perth Code Dojo 2
burlistic
0
110
Other Decks in Programming
See All in Programming
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
130
Claspは野良GASの夢をみるか
takter00
0
140
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.2k
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
4.1k
OSもどきOS
arkw
0
280
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
220
inferと仲良くなる10分間
ryokatsuse
1
270
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
260
Talking to terminals (and how they talk back) (KotlinConf 2026)
jakewharton
PRO
1
160
Inside Stream API
skrb
1
360
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
790
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.1k
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
420
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
160
Game over? The fight for quality and originality in the time of robots
wayneb77
1
180
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Color Theory Basics | Prateek | Gurzu
gurzu
0
320
Art, The Web, and Tiny UX
lynnandtonic
304
21k
HDC tutorial
michielstock
2
680
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
270
Between Models and Reality
mayunak
4
310
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
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