Handling Variations
in Emerging Designs
Remus Langu
Endava
7th of November 2015
Agenda
Nature of Software Development
Emergent Design
Support Practices & Principles
Alternatives in Approaching Variations
Evolutionary Paths
Summary
The Nature
of Software Development
The Nature
of Software Development
Emergent Design
• a way of designing that allows for change,
even unforeseen change, without excessive
costs
• Evolutionary Design/Continuous Design
• based on disciplines, practices, principles,
patterns, wisdom
Emergent Design
Emergent Design
Support Practices
from Extreme Programming
• Refactor Code as Needed
• Write Clearly
• Don’t Do More than You Need
• Programming by Intention
• Write Tests First
Lessons Learned
from Design Patterns
• Avoid Redundancy
• Pull Out Things that Vary
• Separate Use from Construction
• Favor Composition over Class Inheritance
• Encapsulate by Convention and Reveal by
Need
Support Principles
• S.O.L.I.D.
• You Aren't Gonna Need It
• Don't Repeat Yourself
• Keep It Short and Simple
Alternatives
in approaching variations
Procedural Approach
Object-Oriented Approach (1)
Object-Oriented Approach (2)
Analogies
between the Two Approaches
IF with One Branch
vs. Proxy Pattern
IF with One Branch
vs. Proxy Pattern
IF with One Branch
vs. Proxy Pattern
IF with One Branch
vs. Null Object Pattern
IF with One Branch
vs. Null Object Pattern
IF with One Branch
vs. Null Object Pattern
IF with Two Branches
vs. Strategy Pattern
IF with Two Branches
vs. Strategy Pattern
IF with Two Branches
vs. Strategy Pattern
Which One to Use,
Why, When and How?
It depends on different forces
Contextual Forces
What domain problem we need to solve?
• business rule variation?
• optionally add some new functionality?
• multiple additional functions, but which and
how many we add varies?
• variation using another variation in a varying
way?
Implementation Forces
How to proceed with the implementation?
• Apply the support practices
• Follow the support principles
• Pay attention to the fundamental qualities
like: no redundancy, strong cohesion, correct
coupling, readability, focus & testability
Consequent Forces
What will happen once we decide an
approach?
• What is the cost & benefit (gain & loss)?
• Pay attention to testing issues - there is a
deep synergy between testability and good
design.
• Do we get a better design, an under-design
or an over-design?
Consequent Forces
Testability is an important consequence of
Good Design
Evolutionary Paths
From Programming by Intention
to Strategy
Step 1: Add a behaviour using Programming
by Intention
From Programming by Intention
to Strategy
Step 2: Pull out what needs to vary using
delegation
From Programming by Intention
to Strategy
Step 3: Separate Construction from Use
From Programming by Intention
to Strategy
Step 4: Pull out what needs to vary using
inheritance & OCP
From Programming by Intention
to Strategy
Step 5: Encapsulate the new variation with
Strategy pattern
From Strategy to Adapter
to Façade
Add foreign variation by encapsulating
interface with Adapter
From Strategy to Adapter
to Façade
Add foreign variation by encapsulating
interface with Façade
Summary
Handling variation in emerging designs
• is done with patterns that encapsulate the
variation
Emergent Design
• allows for unforeseen changes with minimal
costs
• prevents the quality decay of design and code
• avoids under-design & over-design
Recommendations
Handling Variations in Emerging Designs
Remus Langu
Endava
7th of November 2015
Please fill in your evaluation form

Handling variations in emerging designs