Software Components
Why - How - What
Stephan Hagemann - 2016-11-03 - RUG-B
@shageman
Slide 2
Slide 2 text
WRITE BETTER
SOFTW
ARE
@shageman
Slide 3
Slide 3 text
@shageman
Slide 4
Slide 4 text
WHAT IS A
COMPONENT?
@shageman
Slide 5
Slide 5 text
Labeled Content
+
Explicit Dependencies
@shageman
Slide 6
Slide 6 text
Labeled Content
+
Explicit Dependencies
@shageman
Slide 7
Slide 7 text
@shageman
Slide 8
Slide 8 text
Labeled Content
+
Explicit Dependencies
@shageman
Slide 9
Slide 9 text
@shageman
Slide 10
Slide 10 text
@shageman
Slide 11
Slide 11 text
@shageman
Slide 12
Slide 12 text
@shageman
Slide 13
Slide 13 text
@shageman
Slide 14
Slide 14 text
A depends on B …
A
B
@shageman
Slide 15
Slide 15 text
thus B can not depend on A
A
B
X
@shageman
Slide 16
Slide 16 text
and this doesn’t work either
A
B
X
C
@shageman
Slide 17
Slide 17 text
X and Y as the same thing
@shageman
Y
X
Slide 18
Slide 18 text
Uncle Bob says
… I like to draw these lines. Architecture is the art of
drawing lines. With the interesting rule that once you have
drawn the lines, all the dependencies that cross that line go
in the same direction…
@shageman
Slide 19
Slide 19 text
This is why objects are typically not components…
@shageman
Slide 20
Slide 20 text
@shageman
Slide 21
Slide 21 text
WHY COMPONENTS?
@shageman
Slide 22
Slide 22 text
Growing size
@shageman
Slide 23
Slide 23 text
Exploding complexity
SIZE
POSSIBLE
INTERACTIONS
@shageman
Slide 24
Slide 24 text
Effect of structure
VS
@shageman
Slide 25
Slide 25 text
SIZE
POSSIBLE
INTERACTIONS
Reduced exploding
complexity
@shageman
Slide 26
Slide 26 text
@shageman
Slide 27
Slide 27 text
Communication
@shageman
Slide 28
Slide 28 text
Collaboration
@shageman
Slide 29
Slide 29 text
Creation
@shageman
Slide 30
Slide 30 text
Maintenance
@shageman
Slide 31
Slide 31 text
Comprehension
@shageman
Slide 32
Slide 32 text
HOW TO IMPLEMENT
COMPONENTS?
@shageman
Slide 33
Slide 33 text
No content
Slide 34
Slide 34 text
Code!!
@shageman
Slide 35
Slide 35 text
And in other languages?
Ruby/Rails: Gems + Engines
Java: Modules
Go: packages
Javascript: packages (in npm lingo)
C: file compiling + linking
@shageman
Slide 36
Slide 36 text
HOW TO DETERMINE
WHAT SHOULD BE A
COMPONENT?
@shageman
Slide 37
Slide 37 text
SUMMARY
@shageman
Slide 38
Slide 38 text
Components =
Labeled Content
+
Explicit Dependencies
@shageman
WHAT
Slide 39
Slide 39 text
Components improve…
communication
creation
collaboration
maintenance
comprehension
complexity
@shageman
WHY
Slide 40
Slide 40 text
In Ruby and Rails…
gems and engines can be used as components
@shageman
HOW