SlideShare a Scribd company logo
Architecture Refactoring 
Accelerating Business Success
Ganesh Samarthyam, Corporate Trainer and Author
www.designsmells.com
Architecture is all about
realising business needs
Abstract business
need (requirements)
Concrete implementation
(code)
Architecture
& Design
… but business needs keep
changing!
…with that we need to adapt
the software
City metaphor
“Cities grow, cities evolve, cities
have parts that simply die while other
parts flourish; each city has to be
renewed in order to meet the needs of its
populace… Software-intensive systems
are like that. They grow, they evolve,
sometimes they wither away, and
sometimes they flourish…”
Grady Booch in the foreword for “Refactoring for Software Design Smells: Managing Technical Debt”, Girish Suryanarayana, Ganesh Samarthyam, Tushar Sharma, Morgan Kaufmann/Elsevier, 2014.
What is architecture debt?
…
Architecture)
debt)
Architecture)
smells)
Architecture)
viola2ons)
Design)debt)
Design)smells)
Viola2ons)of)
design)rules)
Test)debt)
Lack)of)tests)
Inadequate)test)
coverage)
Code)debt)
Sta2c)analysis)
tool)viola2ons)
Inconsistent)
coding)style)
Key reasons for architecture
refactoring
Address new
business
needs
Increase
feature
velocity
Address
architecture
decay
Realizing
NFRs
Modernize
Reduce costs
Code refactoring
margin = c.getMargin();
if (c instanceof AbstractButton) {
margin = ((AbstractButton)c).getMargin();
} else if (c instanceof JToolBar) {
margin = ((JToolBar)c).getMargin();
} else if (c instanceof JTextComponent) {
margin = ((JTextComponent)c).getMargin();
}
Example: Refactoring for
design smells
Earlier (relatively) mature
work
Natural extension: Refactoring
for architectural smells
The$red$lines$in$this$
dependency$diagram$shows$
circular$dependencies$
Code refactoring Architecture refactoring
A module-level or class-level concern
A system level concern that cuts across
modules or sub-systems
Impact of refactoring is within a team Impact of refactoring is often across teams
Typically performed to improve the internal
structure of the code
Performed for various reasons: cost,
regulatory, security, performance, availability,
…
Management buy-in typically not required Management buy-in is typically required
Upfront planning is typically (relatively)
limited
Upfront planning and co-ordination
(sometimes between teams) is often required
Unit tests are important to ensure that
“behaviour is preserved”
Unit tests, integration tests, system tests,
NFR tests, … are required
Risk of breaking the working software is
relatively low
Risk of breaking the working software is
relatively high
Real-world analogy:
“fixing potholes”
Real-world analogy:
“metro construction”
COTS
(Commercial Off The Shelf)
FOSS
(Free and Open Source Software)
Make
Buy
/ Reuse
Proven
technologies
Cutting-edge
technologies
Architecting: the process of
taking design decisions!
Cross-cutting concerns
Error/Exception handling
ConcurrencyPersistence
Event handling
Interaction and presentation
Source: SWEBOK v3
Case study: Using
Structured EH
Source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681409(v=vs.85).aspx
Structured Exception
Handling in VC++
Standard Exception
Handling supported in
modern C++ compilers
bool SafeDiv(Number dividend, Number divisor,
Number &result) {
try {
result = dividend / divisor;
} catch(Number::divide_by_zero ex) {
return false;
}
return true;
}
BOOL SafeDiv(Number dividend, Number divisor,
Number &result) {
__try {
result = dividend / divisor;
} __catch(GetExceptionCode() == EXCEPTION_INT_DIVIDE_BY_ZERO
? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
return FALSE;
}
return TRUE;
}
Handling persistence
Oracle DB
Compo
nent-1
Compo
nent-2
Compo
nent-N
[establish
connection, SQL
queries, close
connection…]
No clone within a
component, but
duplication of code
across components
How to support
different databases?
[establish
connection, SQL
queries, close
connection…]
[establish
connection, SQL
queries, close
connection…]
Handling persistence
Compo
nent-1
Compo
nent-2
Compo
nent-N
Service layer /
DAL
Case Study #1:
Refactoring Windows
Refactoring Windows
Refactoring Windows
“A large number of dependencies at the module level
could be reduced and optimized to:
* make modular reasoning of the system more efficient
* maximize parallel development efficiency
* avoid unwanted parallel change interference
* selectively rebuild and retest subsystems effectively”
Refactoring performed to reduce
and optimize dependencies - by
creating and enforcing layering
Source: Kim, Miryung, Thomas Zimmermann, and Nachiappan Nagappan. "An Empirical Study of RefactoringChallenges and Benefits at Microsoft."
IEEE Transactions on Software Engineering 7 (2014): 1-1.
Refactoring Windows:
Significant Characteristics
Refactoring decisions made after substantial
analysis of existing dependency structure
Refactoring effort was centralized and top
down with designated team for refactoring
Use of custom refactoring tools (MaX)
and processes (quality gate check)
Source: Kim, Miryung, Thomas Zimmermann, and Nachiappan Nagappan. "An Empirical Study of RefactoringChallenges and Benefits at Microsoft."
IEEE Transactions on Software Engineering 7 (2014): 1-1.
Refactoring Windows
Source: Kim, Miryung, Thomas Zimmermann, and Nachiappan Nagappan. "An Empirical Study of RefactoringChallenges and Benefits at Microsoft."
IEEE Transactions on Software Engineering 7 (2014): 1-1.
Case Study #2:
Refactoring Date & Time
support in JDK
Poor API design in JDK for
date/time
e.g., in java.util.Date
class, days start at 0,
months start at 1, years start
at 1900!
Prior to Java 8, API design for date and
time in JDK was poor
Date/Time related woes
// using java.util.Date
Date today = new Date();
System.out.println(today);
$ java DateUse
Wed Dec 02 17:17:08 IST 2015
Why should we get the
time and timezone details
if I only want a date? Can
I get rid of these parts?
No!
Example of a design smell in
Date class
“Refused
bequest” smell
Joda API & JSR 310
JSR 310: Java Date and Time API
Stephen Colebourne
LocalDate in java.time
package
// using java.time.LocalDate
LocalDate today = LocalDate.now();

System.out.println(today);
$ java DateUse
2015-12-02
I can use (and hence
depend upon) only date
related functionality (not
time, zone, etc)
LocalDate in java.time
package
You can use only date,
time, or even timezone,
and combine them as
needed!
LocalDate today = LocalDate.now();
System.out.println(today);
LocalTime now = LocalTime.now();
System.out.println(now);
LocalDateTime todayAndNow = LocalDateTime.now();
System.out.println(todayAndNow);
ZonedDateTime todayAndNowInTokyo = ZonedDateTime.now(ZoneId.of("Asia/Tokyo"));
System.out.println(todayAndNowInTokyo);
2015-12-02
17:37:22.647
2015-12-02T17:37:22.648
2015-12-02T21:07:22.649+09:00[Asia/Tokyo]
Many useful classes in
java.time
Case Study #3:
Refactoring JDK!
Tangles in
JDK
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Copyright © 2015, Oracle and/or its affiliates. All rights reserved
Project Jigsaw in Java 9
Modularize JDK & JRE
Hide platform internal details such as sun.misc
Provide a module system for Java developers
Case Study #4: Linux
Kernel
Linux: Intended Architecture
Linux: Extracted Architecture
Key challenges in
architecture refactoring
Getting
management
buy-in
Fear of breaking
working software
Lack of tool
support
Merge process
problems
Using tools for architecture
refactoring
Key take-aways
Architecture refactoring plays a key role in enabling business success
Architecture smells and violations contribute to technical debt (known
as architecture debt)
Code refactoring and architecture refactoring are altogether different
ballgames
We can learn from rich experience available on architecture
refactoring
Refactoring for architecture smells is an effective way to learn
software architecture!
“Architecture refactoring
accelerates business success”
Image credits
• http://sustainablecitiescollective.com/pratik-dave/244831/bangalore-exclusive-metro-india-having-profit-making-public-
transport-system
• http://www.medsoftwaresys.com/mss/wp-content/uploads/2012/04/reengineering.png
• http://topnews.in/files/Bangalore-Metro-Rail-Corporation-Ltd.jpg
• https://www.itdp.org/wp-content/uploads/2014/07/Chennai-Rendering.jpg
• http://www.vectors4all.net/preview/database-clip-art.jpg
• http://static.planetminecraft.com/files/resource_media/screenshot/1231/Windows-Vs-Mac_3072108.jpg
• http://manuel.midoriparadise.com/public_html/icons/linux-icon.png
• http://mortalpowers.com/posse/1280x1280/0DSC03205.JPG
• http://images.clipartpanda.com/server-computer-clipart-1216179635943364667jcartier_central_computer_1.svg.hi.png
• http://images.clipartpanda.com/cloud-icon-png-clouds.png
• http://www.clipartbest.com/cliparts/dc6/M5L/dc6M5LBc9.jpeg
• http://cdn.ttgtmedia.com/rms/computerweekly/refactor.jpg
• http://yellowairplane.com/Adventures/Falkland_Islands_War_Guestbook/Falkands_War_Malvinas_War_Photos/
Jet_Fighter_Mirage_2000_Takeoff_Argentina.jpg
www.designsmells.com bit.ly/sgganesh @GSamarthyam

More Related Content

What's hot

Composable Software Architecture with Spring
Composable Software Architecture with SpringComposable Software Architecture with Spring
Composable Software Architecture with Spring
Sam Brannen
 
Cqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For DevelopersCqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For Developers
wojtek_s
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
Wade Wegner
 
Software Architecture - Principles, Patterns and Practices - OSI Days - 2017
Software Architecture - Principles, Patterns and Practices - OSI Days - 2017Software Architecture - Principles, Patterns and Practices - OSI Days - 2017
Software Architecture - Principles, Patterns and Practices - OSI Days - 2017
CodeOps Technologies LLP
 
Fundamentals Of Software Architecture
Fundamentals Of Software ArchitectureFundamentals Of Software Architecture
Fundamentals Of Software Architecture
Markus Voelter
 
Neal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary ArchitectureNeal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary Architecture
Thoughtworks
 
Ch06lect1 ud
Ch06lect1 udCh06lect1 ud
Ch06lect1 ud
Ahmet Balkan
 
Gof Design Pattern
Gof   Design PatternGof   Design Pattern
Gof Design Pattern
guesta4d934
 
Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014
Sandro Mancuso
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
Julie Iskander
 
Importance Of Being Driven
Importance Of Being DrivenImportance Of Being Driven
Importance Of Being Driven
Antonio Terreno
 
Ch07lect1 ud
Ch07lect1 udCh07lect1 ud
Ch07lect1 ud
Ahmet Balkan
 
Lightweight Model-Driven Engineering
Lightweight Model-Driven EngineeringLightweight Model-Driven Engineering
Lightweight Model-Driven Engineering
Jordi Cabot
 
Java technologies explained to non-technical audience
Java technologies explained to non-technical audienceJava technologies explained to non-technical audience
Java technologies explained to non-technical audience
Steinn 'Stan' Jónsson
 
Ch05lect1 ud
Ch05lect1 udCh05lect1 ud
Ch05lect1 ud
Ahmet Balkan
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLC
Abdul Karim
 
What a Good Software Architect Does
What a Good Software Architect DoesWhat a Good Software Architect Does
What a Good Software Architect Does
Eberhard Wolff
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...
Marco Brambilla
 
Getting Started With Testing
Getting Started With TestingGetting Started With Testing
Getting Started With Testing
Giovanni Scerra ☃
 

What's hot (19)

Composable Software Architecture with Spring
Composable Software Architecture with SpringComposable Software Architecture with Spring
Composable Software Architecture with Spring
 
Cqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For DevelopersCqrs and Event Sourcing Intro For Developers
Cqrs and Event Sourcing Intro For Developers
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
 
Software Architecture - Principles, Patterns and Practices - OSI Days - 2017
Software Architecture - Principles, Patterns and Practices - OSI Days - 2017Software Architecture - Principles, Patterns and Practices - OSI Days - 2017
Software Architecture - Principles, Patterns and Practices - OSI Days - 2017
 
Fundamentals Of Software Architecture
Fundamentals Of Software ArchitectureFundamentals Of Software Architecture
Fundamentals Of Software Architecture
 
Neal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary ArchitectureNeal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary Architecture
 
Ch06lect1 ud
Ch06lect1 udCh06lect1 ud
Ch06lect1 ud
 
Gof Design Pattern
Gof   Design PatternGof   Design Pattern
Gof Design Pattern
 
Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
 
Importance Of Being Driven
Importance Of Being DrivenImportance Of Being Driven
Importance Of Being Driven
 
Ch07lect1 ud
Ch07lect1 udCh07lect1 ud
Ch07lect1 ud
 
Lightweight Model-Driven Engineering
Lightweight Model-Driven EngineeringLightweight Model-Driven Engineering
Lightweight Model-Driven Engineering
 
Java technologies explained to non-technical audience
Java technologies explained to non-technical audienceJava technologies explained to non-technical audience
Java technologies explained to non-technical audience
 
Ch05lect1 ud
Ch05lect1 udCh05lect1 ud
Ch05lect1 ud
 
How to Implement Domain Driven Design in Real Life SDLC
How to Implement Domain Driven Design  in Real Life SDLCHow to Implement Domain Driven Design  in Real Life SDLC
How to Implement Domain Driven Design in Real Life SDLC
 
What a Good Software Architect Does
What a Good Software Architect DoesWhat a Good Software Architect Does
What a Good Software Architect Does
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...
 
Getting Started With Testing
Getting Started With TestingGetting Started With Testing
Getting Started With Testing
 

Similar to Architecture refactoring - accelerating business success

Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
CodeOps Technologies LLP
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
Ganesh Samarthyam
 
Reactive web applications using MeteorJS
Reactive web applications using MeteorJSReactive web applications using MeteorJS
Reactive web applications using MeteorJS
NodeXperts
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate Javascript
Andrew Lovett-Barron
 
...and thus your forms automagically disappeared
...and thus your forms automagically disappeared...and thus your forms automagically disappeared
...and thus your forms automagically disappeared
Luc Bors
 
Resume (1)
Resume (1)Resume (1)
The 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for Java
David Chandler
 
Architecture for scalable Angular applications
Architecture for scalable Angular applicationsArchitecture for scalable Angular applications
Architecture for scalable Angular applications
Paweł Żurowski
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!
Garth Gilmour
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
Gianluca Padovani
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Enea Gabriel
 
Dot Net Accenture
Dot Net AccentureDot Net Accenture
Dot Net Accenture
Sri K
 
ICT C++
ICT C++ ICT C++
ICT C++
Karthikeyan A K
 
Java Programming
Java ProgrammingJava Programming
Java Programming
Tracy Clark
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
Kevin Read
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
Kevin Read
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
David Solivan
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
Salesforce Developers
 
Going open source with small teams
Going open source with small teamsGoing open source with small teams
Going open source with small teams
Jamie Thomas
 
Uday Resume
Uday ResumeUday Resume
Uday Resume
uday kiran
 

Similar to Architecture refactoring - accelerating business success (20)

Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
 
Reactive web applications using MeteorJS
Reactive web applications using MeteorJSReactive web applications using MeteorJS
Reactive web applications using MeteorJS
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate Javascript
 
...and thus your forms automagically disappeared
...and thus your forms automagically disappeared...and thus your forms automagically disappeared
...and thus your forms automagically disappeared
 
Resume (1)
Resume (1)Resume (1)
Resume (1)
 
The 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for Java
 
Architecture for scalable Angular applications
Architecture for scalable Angular applicationsArchitecture for scalable Angular applications
Architecture for scalable Angular applications
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
 
Dot Net Accenture
Dot Net AccentureDot Net Accenture
Dot Net Accenture
 
ICT C++
ICT C++ ICT C++
ICT C++
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
 
Going open source with small teams
Going open source with small teamsGoing open source with small teams
Going open source with small teams
 
Uday Resume
Uday ResumeUday Resume
Uday Resume
 

More from Ganesh Samarthyam

Wonders of the Sea
Wonders of the SeaWonders of the Sea
Wonders of the Sea
Ganesh Samarthyam
 
Animals - for kids
Animals - for kids Animals - for kids
Animals - for kids
Ganesh Samarthyam
 
Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in Practice
Ganesh Samarthyam
 
CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”
Ganesh Samarthyam
 
Great Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGreat Coding Skills Aren't Enough
Great Coding Skills Aren't Enough
Ganesh Samarthyam
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
Ganesh Samarthyam
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean Code
Ganesh Samarthyam
 
Design Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on ExamplesDesign Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on Examples
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief Presentation
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
Ganesh Samarthyam
 
Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)
Ganesh Samarthyam
 
OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ OO Design and Design Patterns in C++
OO Design and Design Patterns in C++
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckBangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship Deck
Ganesh Samarthyam
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
Ganesh Samarthyam
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
Ganesh Samarthyam
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz Questions
Ganesh Samarthyam
 
Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
Ganesh Samarthyam
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
Ganesh Samarthyam
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
Ganesh Samarthyam
 
Core Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizCore Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quiz
Ganesh Samarthyam
 

More from Ganesh Samarthyam (20)

Wonders of the Sea
Wonders of the SeaWonders of the Sea
Wonders of the Sea
 
Animals - for kids
Animals - for kids Animals - for kids
Animals - for kids
 
Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in Practice
 
CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”
 
Great Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGreat Coding Skills Aren't Enough
Great Coding Skills Aren't Enough
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean Code
 
Design Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on ExamplesDesign Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on Examples
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief Presentation
 
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
 
Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)
 
OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ OO Design and Design Patterns in C++
OO Design and Design Patterns in C++
 
Bangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckBangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship Deck
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz Questions
 
Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Core Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizCore Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quiz
 

Recently uploaded

GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 

Recently uploaded (20)

GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 

Architecture refactoring - accelerating business success

  • 1. Architecture Refactoring  Accelerating Business Success Ganesh Samarthyam, Corporate Trainer and Author www.designsmells.com
  • 2. Architecture is all about realising business needs Abstract business need (requirements) Concrete implementation (code) Architecture & Design
  • 3. … but business needs keep changing!
  • 4. …with that we need to adapt the software
  • 5. City metaphor “Cities grow, cities evolve, cities have parts that simply die while other parts flourish; each city has to be renewed in order to meet the needs of its populace… Software-intensive systems are like that. They grow, they evolve, sometimes they wither away, and sometimes they flourish…” Grady Booch in the foreword for “Refactoring for Software Design Smells: Managing Technical Debt”, Girish Suryanarayana, Ganesh Samarthyam, Tushar Sharma, Morgan Kaufmann/Elsevier, 2014.
  • 6. What is architecture debt? … Architecture) debt) Architecture) smells) Architecture) viola2ons) Design)debt) Design)smells) Viola2ons)of) design)rules) Test)debt) Lack)of)tests) Inadequate)test) coverage) Code)debt) Sta2c)analysis) tool)viola2ons) Inconsistent) coding)style)
  • 7. Key reasons for architecture refactoring Address new business needs Increase feature velocity Address architecture decay Realizing NFRs Modernize Reduce costs
  • 8. Code refactoring margin = c.getMargin(); if (c instanceof AbstractButton) { margin = ((AbstractButton)c).getMargin(); } else if (c instanceof JToolBar) { margin = ((JToolBar)c).getMargin(); } else if (c instanceof JTextComponent) { margin = ((JTextComponent)c).getMargin(); }
  • 11. Natural extension: Refactoring for architectural smells The$red$lines$in$this$ dependency$diagram$shows$ circular$dependencies$
  • 12. Code refactoring Architecture refactoring A module-level or class-level concern A system level concern that cuts across modules or sub-systems Impact of refactoring is within a team Impact of refactoring is often across teams Typically performed to improve the internal structure of the code Performed for various reasons: cost, regulatory, security, performance, availability, … Management buy-in typically not required Management buy-in is typically required Upfront planning is typically (relatively) limited Upfront planning and co-ordination (sometimes between teams) is often required Unit tests are important to ensure that “behaviour is preserved” Unit tests, integration tests, system tests, NFR tests, … are required Risk of breaking the working software is relatively low Risk of breaking the working software is relatively high Real-world analogy: “fixing potholes” Real-world analogy: “metro construction”
  • 13. COTS (Commercial Off The Shelf) FOSS (Free and Open Source Software) Make Buy / Reuse Proven technologies Cutting-edge technologies Architecting: the process of taking design decisions!
  • 14. Cross-cutting concerns Error/Exception handling ConcurrencyPersistence Event handling Interaction and presentation Source: SWEBOK v3
  • 15. Case study: Using Structured EH Source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681409(v=vs.85).aspx Structured Exception Handling in VC++ Standard Exception Handling supported in modern C++ compilers bool SafeDiv(Number dividend, Number divisor, Number &result) { try { result = dividend / divisor; } catch(Number::divide_by_zero ex) { return false; } return true; } BOOL SafeDiv(Number dividend, Number divisor, Number &result) { __try { result = dividend / divisor; } __catch(GetExceptionCode() == EXCEPTION_INT_DIVIDE_BY_ZERO ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { return FALSE; } return TRUE; }
  • 16. Handling persistence Oracle DB Compo nent-1 Compo nent-2 Compo nent-N [establish connection, SQL queries, close connection…] No clone within a component, but duplication of code across components How to support different databases? [establish connection, SQL queries, close connection…] [establish connection, SQL queries, close connection…]
  • 20. Refactoring Windows “A large number of dependencies at the module level could be reduced and optimized to: * make modular reasoning of the system more efficient * maximize parallel development efficiency * avoid unwanted parallel change interference * selectively rebuild and retest subsystems effectively” Refactoring performed to reduce and optimize dependencies - by creating and enforcing layering Source: Kim, Miryung, Thomas Zimmermann, and Nachiappan Nagappan. "An Empirical Study of RefactoringChallenges and Benefits at Microsoft." IEEE Transactions on Software Engineering 7 (2014): 1-1.
  • 21. Refactoring Windows: Significant Characteristics Refactoring decisions made after substantial analysis of existing dependency structure Refactoring effort was centralized and top down with designated team for refactoring Use of custom refactoring tools (MaX) and processes (quality gate check) Source: Kim, Miryung, Thomas Zimmermann, and Nachiappan Nagappan. "An Empirical Study of RefactoringChallenges and Benefits at Microsoft." IEEE Transactions on Software Engineering 7 (2014): 1-1.
  • 22. Refactoring Windows Source: Kim, Miryung, Thomas Zimmermann, and Nachiappan Nagappan. "An Empirical Study of RefactoringChallenges and Benefits at Microsoft." IEEE Transactions on Software Engineering 7 (2014): 1-1.
  • 23. Case Study #2: Refactoring Date & Time support in JDK
  • 24. Poor API design in JDK for date/time e.g., in java.util.Date class, days start at 0, months start at 1, years start at 1900! Prior to Java 8, API design for date and time in JDK was poor
  • 25. Date/Time related woes // using java.util.Date Date today = new Date(); System.out.println(today); $ java DateUse Wed Dec 02 17:17:08 IST 2015 Why should we get the time and timezone details if I only want a date? Can I get rid of these parts? No!
  • 26. Example of a design smell in Date class “Refused bequest” smell
  • 27. Joda API & JSR 310 JSR 310: Java Date and Time API Stephen Colebourne
  • 28. LocalDate in java.time package // using java.time.LocalDate LocalDate today = LocalDate.now();
 System.out.println(today); $ java DateUse 2015-12-02 I can use (and hence depend upon) only date related functionality (not time, zone, etc)
  • 29. LocalDate in java.time package You can use only date, time, or even timezone, and combine them as needed! LocalDate today = LocalDate.now(); System.out.println(today); LocalTime now = LocalTime.now(); System.out.println(now); LocalDateTime todayAndNow = LocalDateTime.now(); System.out.println(todayAndNow); ZonedDateTime todayAndNowInTokyo = ZonedDateTime.now(ZoneId.of("Asia/Tokyo")); System.out.println(todayAndNowInTokyo); 2015-12-02 17:37:22.647 2015-12-02T17:37:22.648 2015-12-02T21:07:22.649+09:00[Asia/Tokyo]
  • 30. Many useful classes in java.time
  • 33. Copyright © 2015, Oracle and/or its affiliates. All rights reserved
  • 34. Copyright © 2015, Oracle and/or its affiliates. All rights reserved
  • 35. Copyright © 2015, Oracle and/or its affiliates. All rights reserved
  • 36. Project Jigsaw in Java 9 Modularize JDK & JRE Hide platform internal details such as sun.misc Provide a module system for Java developers
  • 37. Case Study #4: Linux Kernel
  • 40. Key challenges in architecture refactoring Getting management buy-in Fear of breaking working software Lack of tool support Merge process problems
  • 41. Using tools for architecture refactoring
  • 42.
  • 43.
  • 44.
  • 45. Key take-aways Architecture refactoring plays a key role in enabling business success Architecture smells and violations contribute to technical debt (known as architecture debt) Code refactoring and architecture refactoring are altogether different ballgames We can learn from rich experience available on architecture refactoring Refactoring for architecture smells is an effective way to learn software architecture!
  • 47. Image credits • http://sustainablecitiescollective.com/pratik-dave/244831/bangalore-exclusive-metro-india-having-profit-making-public- transport-system • http://www.medsoftwaresys.com/mss/wp-content/uploads/2012/04/reengineering.png • http://topnews.in/files/Bangalore-Metro-Rail-Corporation-Ltd.jpg • https://www.itdp.org/wp-content/uploads/2014/07/Chennai-Rendering.jpg • http://www.vectors4all.net/preview/database-clip-art.jpg • http://static.planetminecraft.com/files/resource_media/screenshot/1231/Windows-Vs-Mac_3072108.jpg • http://manuel.midoriparadise.com/public_html/icons/linux-icon.png • http://mortalpowers.com/posse/1280x1280/0DSC03205.JPG • http://images.clipartpanda.com/server-computer-clipart-1216179635943364667jcartier_central_computer_1.svg.hi.png • http://images.clipartpanda.com/cloud-icon-png-clouds.png • http://www.clipartbest.com/cliparts/dc6/M5L/dc6M5LBc9.jpeg • http://cdn.ttgtmedia.com/rms/computerweekly/refactor.jpg • http://yellowairplane.com/Adventures/Falkland_Islands_War_Guestbook/Falkands_War_Malvinas_War_Photos/ Jet_Fighter_Mirage_2000_Takeoff_Argentina.jpg