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
William Webster
October 02, 2014
Programming
0
88
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
46
Perth Code Dojo 12
burlistic
0
78
Perth Code Dojo 11
burlistic
0
59
Introducing Agile to Enterprise
burlistic
0
70
Perth Code Dojo 6 - Decoupling the UI
burlistic
0
58
Perth Code Dojo 4
burlistic
0
43
Perth Code Dojo 5
burlistic
0
43
Perth Code Dojo 2
burlistic
0
98
Other Decks in Programming
See All in Programming
Range on Rails ―「多重範囲型」という新たな選択肢が、複雑ロジックを劇的にシンプルにしたワケ
rizap_tech
0
120
その面倒な作業、「Dart」にやらせませんか? Flutter開発者のための業務効率化
yordgenome03
1
120
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
410
Le côté obscur des IA génératives
pascallemerrer
0
140
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
2
830
チームの境界をブチ抜いていけ
tokai235
0
170
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
230
登壇は dynamic! な営みである / speech is dynamic
da1chi
0
310
Leading Effective Engineering Teams in the AI Era
addyosmani
2
320
開発生産性を上げるための生成AI活用術
starfish719
3
610
オープンソースソフトウェアへの解像度🔬
utam0k
15
2.7k
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
900
Become a Pro
speakerdeck
PRO
29
5.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
870
Agile that works and the tools we love
rasmusluckow
331
21k
How to Ace a Technical Interview
jacobian
280
24k
Gamification - CAS2011
davidbonilla
81
5.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Visualization
eitanlees
149
16k
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