Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Perth Code Dojo 3
Inheritance vs composition
William Webster
October 02, 2014
Transcript
29 slides
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
More Decks by William Webster
See All by William Webster
Building_Highly_Engaged_Teams.pdf
burlistic
0
130
Quantum Encryption - Advances In Data Security
burlistic
0
68
Perth Code Dojo 12
burlistic
0
100
Perth Code Dojo 11
burlistic
0
79
Introducing Agile to Enterprise
burlistic
0
87
Perth Code Dojo 6 - Decoupling the UI
burlistic
0
74
Perth Code Dojo 4
burlistic
0
67
Perth Code Dojo 5
burlistic
0
61
Perth Code Dojo 2
burlistic
0
110
Other Decks in Programming
See All in Programming
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
360
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
130
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
170
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
1
470
LLM 101
dalinaum
0
500
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
190
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
330
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
580
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
210
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
430
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
180
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
200
Featured
See All Featured
Are puppies a ranking factor?
jonoalderson
2
4.2k
Optimizing for Happiness
mojombo
378
71k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
370
GitHub's CSS Performance
jonrohan
1033
470k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Odyssey Design
rkendrick25
PRO
3
950
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
60k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
350
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
3.9k