Upload
terry-yin
View
1.104
Download
1
Embed Size (px)
DESCRIPTION
The software industry has an overloaded expectation for reuse. And different people have different expectation from software reuse. When reuse happens before actual use, the reality is often quite different than everybody's expectation. This talk promotes working software that has customer value, once-and-only-once over reusability, simplicity before generality, use before reuse.
Citation preview
Who Am I
2
• I am Terry Yin!• Work for Odd-e!• Experienced in software development!• Focus on technical coaching!• Love programming!• A father
Me
This talk is about
ReuseUse
Working Software That Has Customer Value
Software
Design Patterns
Common Platform Library
Framework
Object Oriented DesignGeneric Programming
Meta Pr
ogram
mingMiddleware
Domain ModellingOpen Source
3rd Party
Java
Let’s Visit A City !On The Opposite Side of the Globe
6
7
9
10
10,000 pedestrian lives are lost on Brazilian road in
2012, whom in theory do not existing in Brasilia.!
(270, 000 around the world)
"Organic planning does not begin with a preconceived goal; it moves from need to need, from opportunity to opportunity, in a series of adaptations that themselves become increasingly coherent and purposeful, so that they generate a complex final design, hardly less unified than a pre-formed geometric pattern.” !— Lewis Mumford explained further what he admired in medieval cities
what if design from use …
12
13
Software Reuse
what our graphic designer thinks it is
what programmers think it is what architects think it is
what customers think it is what managers think it is what really happens
14
what our graphic designer thinks about reuse
15
Why cannot the graphic designer think about something more
abstract?
Software developers are!trained in!
abstract thinking
17
what programmers think about reuse
Duplication
18
Duplication may be the root of all evil in
software.
Clean Code, Robert C. Martin
If Copy-Paste Is Bad• What about designing a library?!• What about inheritance?!• What about composition?!• What about using a framework?
19
Maybe Yes, Maybe No. Stop Speculating, and make something that works first!
Refactoring• Small steps!• Look for code smells!• Following design principles!
- SOLID!- High cohesion, low coupling!- Once And Only Once!
• Design emerges from working code
20
"Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure."
Refactoring: Improving the Design of Existing Code by Martin Fowler
Pattern Or Anti-Pattern
21
If you’d like to become a better software designer, studying the evolution of great software designs will be more valuable than studying the great designs themselves. For it is in the evolution that the real wisdom lies.
Refactoring to Patterns, Joshua Kerievsky
Emergent Design
22
Code, listen you shall.
Let the design be the way it wants to be!
Why Upfront Design Fails?
23
24
what architects think about reuse
The Second-System Effect
25
when an architect designs a second system, it is the most dangerous system he will ever design, because he will tend to incorporate all of the additions he
originated but did not add to the first system due to inherent time constraints. Thus, when embarking
upon a second system, an engineer should be mindful that he is susceptible to over-engineering it.
Mythical Man Month (1974), Fred Brooks
26
In theory, traditional design tries to make all design decision during speculation
In practice, we can’t
27
1.Make it work
2.Make it right
3.Make it fast
— Kent Beck, inventor of XP
28
what customers think about reuse
29
Design from the perspective of use!rather than implementation
Customer Value
30
People do not on the whole pay for (or need) generality: They tend to have a specific situation, and it is a solution to that specific situation that has value.
Simplicity before generality, use before reuse,!by Kevlin Henney
31
what managers think about reuse
Reusability Is Not Free
32
… I see that expense (of making reusable code) as exactly the effort of productising the component, discussed
in Chapter 1. So my estimate of the effort ratio would be threefold.
Mythical Man Month (1974), Fred Brooks
Reuse Is Not Free, Either
33
What’s worse than ‘copy-paste programming’ is ‘google then copy-
paste without understanding it.
All non-trivial abstractions, to some degree, are leaky.The Law of Leaky Abstractions by Joel Spolsky
34
what really happens when reuse before use
Project Or Product• When you make a product like a project!• you get Brasilia
35
What Should We Do?Only build software for
specific needs.!Build reusable parts, and
apply them in specific applications.!Start from building for
specific needs, then generalise from them gradually.
36
37
there is no such thing as reusable software, only software that has been reused.
Goals over means!Once-And-Only-Once over reusability!
Simplicity before generality!Use before reuse
38
That is, while there is value in the items on the right, we value the items on the left more.
You’ve reached the end
39
Thanks!