Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Less Abstract! Surprising effects of expressing OOP in pictures
Ivan Nemytchenko
November 18, 2019
Technology
1
130
Less Abstract! Surprising effects of expressing OOP in pictures
Ivan Nemytchenko
November 18, 2019
Tweet
Share
More Decks by Ivan Nemytchenko
See All by Ivan Nemytchenko
inem
0
130
inem
0
55
inem
0
95
inem
0
17
inem
1
2.3k
inem
1
47
inem
0
72
inem
0
41
inem
3
840
Other Decks in Technology
See All in Technology
puhitaku
3
1.1k
kanaugust
PRO
0
150
youtalk
0
250
yoku0825
PRO
3
120
adhorn
0
340
lancers_pr
4
1.4k
ayanadesu
0
110
fufuhu
3
130
karamem0
1
690
clustervr
0
130
1027kg
0
160
taxin
0
140
Featured
See All Featured
eileencodes
113
25k
philhawksworth
190
17k
addyosmani
1347
190k
mthomps
39
2.3k
qrush
285
19k
roundedbygravity
242
21k
akmur
252
19k
jmmastey
10
600
ddemaree
273
31k
zakiwarfel
88
3.4k
imathis
479
150k
iamctodd
18
2k
Transcript
Less Abstract! Effects of expressing OOP in pictures Ivan Nemytchenko
@inemation inem.at
Who is this guy? • Educator • Freelance consultant •
Complexity fighter • GitLab fan • Serbian Siberian • inem.at • @inemation
Serbian Siberian ??
I am Russian
None
None
Omsk is in Siberia
I live in Serbia
Serbia != Siberia
Serbia != Siberia != Syria
What’s the problem? Abstractions on top of abstractions on top
of other abstractions!
What’s the problem? Very hard to see the big picture
in real projects
What’s the problem? Very hard to see the big picture
in real projects CRC Cards
What’s the problem? Very hard to see the big picture
in real projects UML :(
What to expect here? 1. It is gonna be fun!
2. You’ll become better at: • Learning, teaching, explaining complex concepts • Visualizing big picture • Finding architecture flaws •Tracking dynamics
OOP in pictures Foundation Advanced concepts Using in practice
How to illustrate Dependency Injection * with one picture **
so that everyone understands ?
“Smart kettle” task Boil water correctly and safely! 1. No
code 2. Just classes 3. And their methods
Artistic soldiers method
Kettle components (objects) small dudes == objects
Kettle components (objects) small dudes == objects
Kettle components (objects) small dudes == objects
Kettle components (objects) small dudes == objects
Objects with methods! arms == methods
A method number of fingers == number of arguments
Instance variables Stored inside the brain
Instance variables Can be reused later
But how other stuff is going to look like?…
Returning results door on the body
Private methods “internal arms”
Exception puking
Basic anti-patterns
Too many arguments
Too many methods
Too long methods
Too many instance variables
Too much conditional logic in methods Swallen arms
Too much of everything!!!
OOP in pictures Foundation Advanced concepts Using in practice
Polymorphism same number of hands with same number of fingers
None
None
Classes A spawning platforms
Classes A spawning platform
same topology Object & classes have the
Topology Cups and donuts share the same topology
same topology Object & classes have the
Execution flow
Execution flow
Execution flow
Execution flow == Rube Goldberg machine
Execution flow
Execution flow
Execution flow
Dependencies have to remember about classes to use them
Dependencies
Side effects
Dependency Injection Instead of remembering thing we pass them as
arguments
None
OOP in pictures Foundation Advanced concepts Using in practice
Visual language!
None
None
None
None
None
None
None
None
None
None
None
Big picture
Dynamic anti-patterns
Dynamic anti-patterns
Dynamic anti-patterns
Dynamic anti-patterns
Dynamic anti-patterns
None
None
None
None
None
None
None
OOP in pictures Foundation Advanced concepts Using in practice
None
– George Box “All models are wrong but some are
useful.”
• Big picture • Modelling • Documenting • Sharing knowledge
• Explaining What can you use it for
Ivan Nemytchenko, inem.at, @inemation RubyConf 2019 Questions?