SlideShare a Scribd company logo
1 of 43
Download to read offline
LEMi ORHAN ERGiN
co-founder @ craftbase
CLEAN
DESIGN
SOFTWARE
THE PRACTICES TO MAKE THE DESIGN SIMPLE
codedesign processteam
management
organization
tests customer
ux & ui culture office
architecture infrastructure
ux & uimeetingssecurity
things smell…
and if something smells bad, it means it is not clean
Let’s talk about what is so!ware design and
how we can build it clean
Jack W. Reeves
The C++ JournalVol. 2, No. 2. 1992
http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
What is So"ware Design?
https://medium.com/t%C3%BCrkiye/yaz%C4%B1l%C4%B1m-tasar%C4%B1m%C4%B1-nedir-cd8aad12c8ae
Türkçe Çevirisi: Muhammed Hilmi Koca
Source code is the real
so"ware design
Designing so!ware is an exercise in managing complexity
Jack W. Reeves
What is Software Design? The C++ JournalVol. 2, No. 2. 1992
http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
The so"ware design is
not complete until it has
been coded and tested
Testing is part of the process of refining the design
Jack W. Reeves
What is Software Design? The C++ JournalVol. 2, No. 2. 1992
http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
Programming
Source Code
SOFTWARE DESIGN ???
Programming
Source Code
Automated Testing
(Unit, Functional, etc.)
SOFTWARE DESIGN v0.1
The very first value of
so"ware is
Robert C. Martin
Author of Clean Code and Clean Coder
Owner of cleancoders.com training site
…
to tolerate and
facilitate on-going changes
Robert C. Martin
Author of Clean Code and Clean Coder
Owner of cleancoders.com training site
The very first value of
so"ware is
Each city has to be renewed in order to
meet the needs of its populace.
So!ware-intensive systems are like that.
Grady Booch
Developed UML
Wrote foreword to
“Design Patterns” and
“Technical Debt” books
Istanbul, TurkeyCredit: European Space Imaging
Testing and Refactoring 

are first class citizens of
so"ware design
Tests should pass
Refactoring should be continuous
Programming
Source Code
Automated Testing
(Unit, Functional, etc.)
SOFTWARE DESIGN v0.1
Refactoring
Programming
Source Code
Automated Testing
(Unit, Functional, etc.)
SOFTWARE DESIGN v0.2
SOFTWARE DESIGN v0.2
Refactoring
Programming
Source Code
Automated Testing
(Unit, Functional, etc.)
clean?
COUPLING
When readFile() is changed, do you change writeFile() too?
It shows how many places we need to change
public class CakeCooker {
private Powder cakePowder;
private Event event = new CookingEvent();
public void cook(Cake cake) {
prepareIngredients();
int numberOfLayers = cake.getNumberOfLayers();
cakePowder = new BrownCakePowder();
float weight = cakePowder.getWeightUsed();
Egg egg = new Egg();
egg.crack();
cake.getChef().getCompany().registerEvent(event);
}
private void prepareIngredients() {
// prepare ingredients here ...
}
}
Don't talk to strangers
Law of Demeter
do not reach into an object to gain
access to a third object’s methods
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
example of
high coupling
No Dependencies Loosely Coupled
Some Dependencies
Tightly Coupled
Many Dependencies
Two elements are loosely
coupled if they are not
shown in the same diff
Kent Beck
The creator of extreme programming
One of the signatories of the Agile Manifesto
Pioneered software design patterns and TDD
COHESION
Do you search a lot where to change?
It shows how easy to find the places we need to change
public class EmailMessage {
private String sendTo;
private String subject;
private String message;
private String username;
public EmailMessage(String to, String sbj, String m) {
this.sendTo = to;
this.subject = sbj;
this.message = m;
}
public void sendMessage() {
// send message using sendTo, subject, message
}
public void authenticate(String username, String pass) {
this.username = username;
// code to login
}
}
A cohesive module performs
a single task within a
so!ware procedure, requiring
li#le interaction with the
procedures being performed
in other parts of the program
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
example of
low cohesion
How many files at any
one time is still open for
edit shows the level of
cohesion
Nat Pryce
Co-Author of Growing Object-Oriented Software Guided by Tests
Early adopter of XP
Refactoring
Programming
Source Code
Automated Testing
(Unit, Functional, etc.)
SOFTWARE DESIGN v0.2
Refactoring
Low Coupling High Cohesion
SOFTWARE DESIGN v0.3
Programming
Source Code
Automated Testing
(Unit, Functional, etc.)
If people program solo, they are
more likely to make mistakes,
more likely to over design, and
more likely drop the other practices,
particularly under pressure.
Kent Beck
The creator of extreme programming
One of the signatories of the Agile Manifesto
Pioneered software design patterns and TDD
— from book “XP Explained” by Kent Beck
Higher quality in code
Faster in deployment*
Faster defect removal
Higher morale
Be"er collaboration
Shared knowledge
Quicker to market
Automatic code review
Useful for training people
Lower defect rates
https://www.flickr.com/photos/fraserspeirs/3394902061
Joe O'Brien and Jim Weirich while doing ruby code review
Benefits of Programming in Pairs
Refactoring
Low Coupling High Cohesion
SOFTWARE DESIGN v0.3
Programming
Source Code
Automated Testing
(Unit, Functional, etc.)
Pair Programming and Code Review
Refactoring
Low Coupling High Cohesion
SOFTWARE DESIGN v0.4
Programming
Source Code
Automated Testing
(Unit, Functional, etc.)
The Principlesof Clean So!ware Design
1 tests pass
Tests should always pass.
If you can’t prove that your system works and does what it is required to do
then it doesn’t really ma!er if your design is clean, simple or complex.
2
2 code expresses intent
Reveal what you are doing, not why you are doing or how you are doing
(how)
(what-generic)
(what-specific)
mailer.use_gmail_smtp_send_email()
mailer.send_email()
mailer.send_activation_email()
Give great names.
because you have to live with them forever
2 code expresses intent
manager
handler
helper
utils
facade
repository
wrapper
interceptor
controller
parser
service
validator
converter
gateway
generator
Avoid using honeypot names a!racting behaviors and functionalities
Give great names.
because you have to live with them forever
3 keep it small
Less code is cleaner and
maintainable.
Keep your methods and classes small. I mean really small.
The application shouldn’t have pieces that you don’t need. Delete the unused.
4 do not repeat yourself
Find and remove duplications.
It’s not only about code duplication, it’s also about knowledge duplication.
Every piece of knowledge should have one and only one representation.
5 tame abstractions
Align the level of abstractions.
Do not expose details and limitations of its underlying implementation
to its users that should ideally be hidden away.
5 tame abstractions
All non-trivial abstractions, to
some degree, are leaky.
Abstractions fail. Sometimes a li!le, sometimes a lot. There’s leakage. Things
go wrong. It happens all over the place when you have abstractions.
https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/
Law of Leaky Abstractions
Singletons
Meaning on Nulls
Sharing state
Static & new keywords
Framework slave coding
Composition over Aggregation
Premature optimization
Primitive obsession
Huge upfront design
Checked exceptions
Stop, or use them wisely
tests pass
code expresses intent
keep it small
do not repeat yourself
tame abstractions
1
2
3
4
5
/lemiorhan
lemiorhanergin.com
@lemiorhanLEMi ORHAN ERGiN

More Related Content

What's hot

How to Become a Conference Speaker
How to Become a Conference SpeakerHow to Become a Conference Speaker
How to Become a Conference SpeakerSven Peters
 
Professional Software Development, Practices and Ethics
Professional Software Development, Practices and EthicsProfessional Software Development, Practices and Ethics
Professional Software Development, Practices and EthicsLemi Orhan Ergin
 
GMO'less Software Development Practices
GMO'less Software Development PracticesGMO'less Software Development Practices
GMO'less Software Development PracticesLemi Orhan Ergin
 
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...Agile ME
 
My Career Journey: An Unconventional Path into DevOps
My Career Journey: An Unconventional Path into DevOpsMy Career Journey: An Unconventional Path into DevOps
My Career Journey: An Unconventional Path into DevOpsVMware Tanzu
 
Importance of the quality of code
Importance of the quality of codeImportance of the quality of code
Importance of the quality of codeShwe Yee
 
Software Craftsmanship vs Software Engineering (Lightning Talk)
Software Craftsmanship vs Software Engineering (Lightning Talk)Software Craftsmanship vs Software Engineering (Lightning Talk)
Software Craftsmanship vs Software Engineering (Lightning Talk)Andy Maleh
 
Pair programming demystified
Pair programming demystifiedPair programming demystified
Pair programming demystifiedMarek Kirejczyk
 
SCA in an Agile World | June 2010
SCA in an Agile World | June 2010SCA in an Agile World | June 2010
SCA in an Agile World | June 2010Klocwork
 
Big Ball of Mud: Software Maintenance Nightmares
Big Ball of Mud: Software Maintenance NightmaresBig Ball of Mud: Software Maintenance Nightmares
Big Ball of Mud: Software Maintenance NightmaresGonzalo Rodríguez
 
Top Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocks
Top Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocksTop Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocks
Top Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocksZeroTurnaround
 
Getting Started With QA Automation
Getting Started With QA AutomationGetting Started With QA Automation
Getting Started With QA AutomationGiovanni Scerra ☃
 
Pair Programming (2014)
Pair Programming (2014)Pair Programming (2014)
Pair Programming (2014)Peter Kofler
 
Understanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScriptUnderstanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScriptMark Daggett
 
Pair Programming Presentation
Pair Programming PresentationPair Programming Presentation
Pair Programming PresentationThoughtWorks
 
Voxxed days 2015-hakansaglam-codereview
Voxxed days 2015-hakansaglam-codereviewVoxxed days 2015-hakansaglam-codereview
Voxxed days 2015-hakansaglam-codereviewHakan Saglam
 
Tdd 4 everyone full version
Tdd 4 everyone full versionTdd 4 everyone full version
Tdd 4 everyone full versionLior Israel
 
XRebel - Real Time Insight, Faster Apps
XRebel - Real Time Insight, Faster AppsXRebel - Real Time Insight, Faster Apps
XRebel - Real Time Insight, Faster AppsZeroTurnaround
 
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkTaming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkJoseph Yoder
 

What's hot (20)

How to Become a Conference Speaker
How to Become a Conference SpeakerHow to Become a Conference Speaker
How to Become a Conference Speaker
 
Professional Software Development, Practices and Ethics
Professional Software Development, Practices and EthicsProfessional Software Development, Practices and Ethics
Professional Software Development, Practices and Ethics
 
GMO'less Software Development Practices
GMO'less Software Development PracticesGMO'less Software Development Practices
GMO'less Software Development Practices
 
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
Let the Elephants Leave the Room: Tips for Making Development Life Leaner by ...
 
My Career Journey: An Unconventional Path into DevOps
My Career Journey: An Unconventional Path into DevOpsMy Career Journey: An Unconventional Path into DevOps
My Career Journey: An Unconventional Path into DevOps
 
Importance of the quality of code
Importance of the quality of codeImportance of the quality of code
Importance of the quality of code
 
Software Craftsmanship vs Software Engineering (Lightning Talk)
Software Craftsmanship vs Software Engineering (Lightning Talk)Software Craftsmanship vs Software Engineering (Lightning Talk)
Software Craftsmanship vs Software Engineering (Lightning Talk)
 
Pair programming demystified
Pair programming demystifiedPair programming demystified
Pair programming demystified
 
SCA in an Agile World | June 2010
SCA in an Agile World | June 2010SCA in an Agile World | June 2010
SCA in an Agile World | June 2010
 
Big Ball of Mud: Software Maintenance Nightmares
Big Ball of Mud: Software Maintenance NightmaresBig Ball of Mud: Software Maintenance Nightmares
Big Ball of Mud: Software Maintenance Nightmares
 
Thoughtful Software Design
Thoughtful Software DesignThoughtful Software Design
Thoughtful Software Design
 
Top Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocks
Top Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocksTop Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocks
Top Reasons Why Java Rocks (report preview) - http:0t.ee/java-rocks
 
Getting Started With QA Automation
Getting Started With QA AutomationGetting Started With QA Automation
Getting Started With QA Automation
 
Pair Programming (2014)
Pair Programming (2014)Pair Programming (2014)
Pair Programming (2014)
 
Understanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScriptUnderstanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScript
 
Pair Programming Presentation
Pair Programming PresentationPair Programming Presentation
Pair Programming Presentation
 
Voxxed days 2015-hakansaglam-codereview
Voxxed days 2015-hakansaglam-codereviewVoxxed days 2015-hakansaglam-codereview
Voxxed days 2015-hakansaglam-codereview
 
Tdd 4 everyone full version
Tdd 4 everyone full versionTdd 4 everyone full version
Tdd 4 everyone full version
 
XRebel - Real Time Insight, Faster Apps
XRebel - Real Time Insight, Faster AppsXRebel - Real Time Insight, Faster Apps
XRebel - Real Time Insight, Faster Apps
 
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard WorkTaming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
Taming Big Balls of Mud with Diligence, Agile Practices, and Hard Work
 

Similar to Clean Software Design: The Practices to Make The Design Simple

Test Driven Design
Test Driven DesignTest Driven Design
Test Driven DesignSaad Ahmed
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Lemi Orhan Ergin
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Gianluca Padovani
 
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 PublicDavid Solivan
 
Deploy Angular to the Cloud
Deploy Angular to the CloudDeploy Angular to the Cloud
Deploy Angular to the CloudSimona Cotin
 
A sweet taste of clean code and software design
A sweet taste of clean code and software designA sweet taste of clean code and software design
A sweet taste of clean code and software designKfir Bloch
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principlesEdorian
 
Managing and evolving JavaScript Code
Managing and evolving JavaScript CodeManaging and evolving JavaScript Code
Managing and evolving JavaScript CodeJean Carlo Emer
 
Behavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineBehavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineRemus Langu
 
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...Abdelkrim Boujraf
 
Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4Darwin Biler
 
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 FirstEnea Gabriel
 
Agile development with Ruby
Agile development with RubyAgile development with Ruby
Agile development with Rubykhelll
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2Hammad Rajjoub
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2Hammad Rajjoub
 
Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...
Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...
Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...DicodingEvent
 

Similar to Clean Software Design: The Practices to Make The Design Simple (20)

Test Driven Design
Test Driven DesignTest Driven Design
Test Driven Design
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016
 
Tdd is not about testing (OOP)
Tdd is not about testing (OOP)Tdd is not about testing (OOP)
Tdd is not about testing (OOP)
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
 
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
 
Deploy Angular to the Cloud
Deploy Angular to the CloudDeploy Angular to the Cloud
Deploy Angular to the Cloud
 
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
 
A sweet taste of clean code and software design
A sweet taste of clean code and software designA sweet taste of clean code and software design
A sweet taste of clean code and software design
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principles
 
Managing and evolving JavaScript Code
Managing and evolving JavaScript CodeManaging and evolving JavaScript Code
Managing and evolving JavaScript Code
 
Behavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & JasmineBehavior Driven Development with AngularJS & Jasmine
Behavior Driven Development with AngularJS & Jasmine
 
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...
 
Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4Building Large Scale PHP Web Applications with Laravel 4
Building Large Scale PHP Web Applications with Laravel 4
 
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
 
Agile development with Ruby
Agile development with RubyAgile development with Ruby
Agile development with Ruby
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
 
Coding Naked 2023
Coding Naked 2023Coding Naked 2023
Coding Naked 2023
 
Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...
Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...
Dicoding Developer Coaching #31: Android | Menerapkan Clean Architecture di A...
 

More from Lemi Orhan Ergin

Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...Lemi Orhan Ergin
 
Scrum Events and Artifacts in Action
Scrum Events and Artifacts in ActionScrum Events and Artifacts in Action
Scrum Events and Artifacts in ActionLemi Orhan Ergin
 
Git Anti Patterns - XP Days Ukraine 2017
Git Anti Patterns - XP Days Ukraine 2017Git Anti Patterns - XP Days Ukraine 2017
Git Anti Patterns - XP Days Ukraine 2017Lemi Orhan Ergin
 
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Lemi Orhan Ergin
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Lemi Orhan Ergin
 
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...Lemi Orhan Ergin
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainLemi Orhan Ergin
 
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...Lemi Orhan Ergin
 
Happy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of DevelopersHappy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of DevelopersLemi Orhan Ergin
 
Git - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilGit - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilLemi Orhan Ergin
 
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationCode Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationLemi Orhan Ergin
 
Lost in Motivation in an Agile World
Lost in Motivation in an Agile WorldLost in Motivation in an Agile World
Lost in Motivation in an Agile WorldLemi Orhan Ergin
 
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)Lemi Orhan Ergin
 
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)Lemi Orhan Ergin
 
Trespassing The Forgotten and Abandoned: Ethics in Software Development
Trespassing The Forgotten and Abandoned:  Ethics in Software DevelopmentTrespassing The Forgotten and Abandoned:  Ethics in Software Development
Trespassing The Forgotten and Abandoned: Ethics in Software DevelopmentLemi Orhan Ergin
 
Software Craftsmanship - Building A Culture For The Future (GDG DevFest Istan...
Software Craftsmanship - Building A Culture For The Future (GDG DevFest Istan...Software Craftsmanship - Building A Culture For The Future (GDG DevFest Istan...
Software Craftsmanship - Building A Culture For The Future (GDG DevFest Istan...Lemi Orhan Ergin
 
Teoriden Pratiğe Mikroservisler - Özgür Web Teknolojileri Günü 2014
Teoriden Pratiğe Mikroservisler - Özgür Web Teknolojileri Günü 2014Teoriden Pratiğe Mikroservisler - Özgür Web Teknolojileri Günü 2014
Teoriden Pratiğe Mikroservisler - Özgür Web Teknolojileri Günü 2014Lemi Orhan Ergin
 
Let The Elephants Leave The Room - Tips For Making Your Development Life Leaner
Let The Elephants Leave The Room - Tips For Making Your Development Life LeanerLet The Elephants Leave The Room - Tips For Making Your Development Life Leaner
Let The Elephants Leave The Room - Tips For Making Your Development Life LeanerLemi Orhan Ergin
 
A Gentle Introduction to Micro Services - From Theory into Practice
A Gentle Introduction to Micro Services - From Theory into PracticeA Gentle Introduction to Micro Services - From Theory into Practice
A Gentle Introduction to Micro Services - From Theory into PracticeLemi Orhan Ergin
 
Coderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your CraftsCoderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your CraftsLemi Orhan Ergin
 

More from Lemi Orhan Ergin (20)

Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
 
Scrum Events and Artifacts in Action
Scrum Events and Artifacts in ActionScrum Events and Artifacts in Action
Scrum Events and Artifacts in Action
 
Git Anti Patterns - XP Days Ukraine 2017
Git Anti Patterns - XP Days Ukraine 2017Git Anti Patterns - XP Days Ukraine 2017
Git Anti Patterns - XP Days Ukraine 2017
 
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
 
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it Again
 
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
 
Happy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of DevelopersHappy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
 
Git - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilGit - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi Değil
 
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationCode Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
 
Lost in Motivation in an Agile World
Lost in Motivation in an Agile WorldLost in Motivation in an Agile World
Lost in Motivation in an Agile World
 
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
 
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
 
Trespassing The Forgotten and Abandoned: Ethics in Software Development
Trespassing The Forgotten and Abandoned:  Ethics in Software DevelopmentTrespassing The Forgotten and Abandoned:  Ethics in Software Development
Trespassing The Forgotten and Abandoned: Ethics in Software Development
 
Software Craftsmanship - Building A Culture For The Future (GDG DevFest Istan...
Software Craftsmanship - Building A Culture For The Future (GDG DevFest Istan...Software Craftsmanship - Building A Culture For The Future (GDG DevFest Istan...
Software Craftsmanship - Building A Culture For The Future (GDG DevFest Istan...
 
Teoriden Pratiğe Mikroservisler - Özgür Web Teknolojileri Günü 2014
Teoriden Pratiğe Mikroservisler - Özgür Web Teknolojileri Günü 2014Teoriden Pratiğe Mikroservisler - Özgür Web Teknolojileri Günü 2014
Teoriden Pratiğe Mikroservisler - Özgür Web Teknolojileri Günü 2014
 
Let The Elephants Leave The Room - Tips For Making Your Development Life Leaner
Let The Elephants Leave The Room - Tips For Making Your Development Life LeanerLet The Elephants Leave The Room - Tips For Making Your Development Life Leaner
Let The Elephants Leave The Room - Tips For Making Your Development Life Leaner
 
A Gentle Introduction to Micro Services - From Theory into Practice
A Gentle Introduction to Micro Services - From Theory into PracticeA Gentle Introduction to Micro Services - From Theory into Practice
A Gentle Introduction to Micro Services - From Theory into Practice
 
Coderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your CraftsCoderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your Crafts
 

Recently uploaded

Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 

Recently uploaded (20)

Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 

Clean Software Design: The Practices to Make The Design Simple

  • 1. LEMi ORHAN ERGiN co-founder @ craftbase CLEAN DESIGN SOFTWARE THE PRACTICES TO MAKE THE DESIGN SIMPLE
  • 2. codedesign processteam management organization tests customer ux & ui culture office architecture infrastructure ux & uimeetingssecurity
  • 3. things smell… and if something smells bad, it means it is not clean
  • 4. Let’s talk about what is so!ware design and how we can build it clean
  • 5. Jack W. Reeves The C++ JournalVol. 2, No. 2. 1992 http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf What is So"ware Design? https://medium.com/t%C3%BCrkiye/yaz%C4%B1l%C4%B1m-tasar%C4%B1m%C4%B1-nedir-cd8aad12c8ae Türkçe Çevirisi: Muhammed Hilmi Koca
  • 6. Source code is the real so"ware design Designing so!ware is an exercise in managing complexity Jack W. Reeves What is Software Design? The C++ JournalVol. 2, No. 2. 1992 http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
  • 7. The so"ware design is not complete until it has been coded and tested Testing is part of the process of refining the design Jack W. Reeves What is Software Design? The C++ JournalVol. 2, No. 2. 1992 http://user.it.uu.se/~carle/softcraft/notes/Reeve_SourceCodeIsTheDesign.pdf
  • 9. Programming Source Code Automated Testing (Unit, Functional, etc.) SOFTWARE DESIGN v0.1
  • 10.
  • 11. The very first value of so"ware is Robert C. Martin Author of Clean Code and Clean Coder Owner of cleancoders.com training site …
  • 12. to tolerate and facilitate on-going changes Robert C. Martin Author of Clean Code and Clean Coder Owner of cleancoders.com training site The very first value of so"ware is
  • 13. Each city has to be renewed in order to meet the needs of its populace. So!ware-intensive systems are like that. Grady Booch Developed UML Wrote foreword to “Design Patterns” and “Technical Debt” books Istanbul, TurkeyCredit: European Space Imaging
  • 14. Testing and Refactoring 
 are first class citizens of so"ware design Tests should pass Refactoring should be continuous
  • 15. Programming Source Code Automated Testing (Unit, Functional, etc.) SOFTWARE DESIGN v0.1
  • 16. Refactoring Programming Source Code Automated Testing (Unit, Functional, etc.) SOFTWARE DESIGN v0.2
  • 17. SOFTWARE DESIGN v0.2 Refactoring Programming Source Code Automated Testing (Unit, Functional, etc.) clean?
  • 18. COUPLING When readFile() is changed, do you change writeFile() too? It shows how many places we need to change
  • 19. public class CakeCooker { private Powder cakePowder; private Event event = new CookingEvent(); public void cook(Cake cake) { prepareIngredients(); int numberOfLayers = cake.getNumberOfLayers(); cakePowder = new BrownCakePowder(); float weight = cakePowder.getWeightUsed(); Egg egg = new Egg(); egg.crack(); cake.getChef().getCompany().registerEvent(event); } private void prepareIngredients() { // prepare ingredients here ... } } Don't talk to strangers Law of Demeter do not reach into an object to gain access to a third object’s methods 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 example of high coupling
  • 20. No Dependencies Loosely Coupled Some Dependencies Tightly Coupled Many Dependencies
  • 21. Two elements are loosely coupled if they are not shown in the same diff Kent Beck The creator of extreme programming One of the signatories of the Agile Manifesto Pioneered software design patterns and TDD
  • 22. COHESION Do you search a lot where to change? It shows how easy to find the places we need to change
  • 23. public class EmailMessage { private String sendTo; private String subject; private String message; private String username; public EmailMessage(String to, String sbj, String m) { this.sendTo = to; this.subject = sbj; this.message = m; } public void sendMessage() { // send message using sendTo, subject, message } public void authenticate(String username, String pass) { this.username = username; // code to login } } A cohesive module performs a single task within a so!ware procedure, requiring li#le interaction with the procedures being performed in other parts of the program 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 example of low cohesion
  • 24. How many files at any one time is still open for edit shows the level of cohesion Nat Pryce Co-Author of Growing Object-Oriented Software Guided by Tests Early adopter of XP
  • 25. Refactoring Programming Source Code Automated Testing (Unit, Functional, etc.) SOFTWARE DESIGN v0.2
  • 26. Refactoring Low Coupling High Cohesion SOFTWARE DESIGN v0.3 Programming Source Code Automated Testing (Unit, Functional, etc.)
  • 27. If people program solo, they are more likely to make mistakes, more likely to over design, and more likely drop the other practices, particularly under pressure. Kent Beck The creator of extreme programming One of the signatories of the Agile Manifesto Pioneered software design patterns and TDD — from book “XP Explained” by Kent Beck
  • 28. Higher quality in code Faster in deployment* Faster defect removal Higher morale Be"er collaboration Shared knowledge Quicker to market Automatic code review Useful for training people Lower defect rates https://www.flickr.com/photos/fraserspeirs/3394902061 Joe O'Brien and Jim Weirich while doing ruby code review Benefits of Programming in Pairs
  • 29. Refactoring Low Coupling High Cohesion SOFTWARE DESIGN v0.3 Programming Source Code Automated Testing (Unit, Functional, etc.)
  • 30. Pair Programming and Code Review Refactoring Low Coupling High Cohesion SOFTWARE DESIGN v0.4 Programming Source Code Automated Testing (Unit, Functional, etc.)
  • 31. The Principlesof Clean So!ware Design
  • 32. 1 tests pass Tests should always pass. If you can’t prove that your system works and does what it is required to do then it doesn’t really ma!er if your design is clean, simple or complex.
  • 33. 2
  • 34. 2 code expresses intent Reveal what you are doing, not why you are doing or how you are doing (how) (what-generic) (what-specific) mailer.use_gmail_smtp_send_email() mailer.send_email() mailer.send_activation_email() Give great names. because you have to live with them forever
  • 35. 2 code expresses intent manager handler helper utils facade repository wrapper interceptor controller parser service validator converter gateway generator Avoid using honeypot names a!racting behaviors and functionalities Give great names. because you have to live with them forever
  • 36. 3 keep it small Less code is cleaner and maintainable. Keep your methods and classes small. I mean really small. The application shouldn’t have pieces that you don’t need. Delete the unused.
  • 37. 4 do not repeat yourself Find and remove duplications. It’s not only about code duplication, it’s also about knowledge duplication. Every piece of knowledge should have one and only one representation.
  • 38. 5 tame abstractions Align the level of abstractions. Do not expose details and limitations of its underlying implementation to its users that should ideally be hidden away.
  • 39. 5 tame abstractions All non-trivial abstractions, to some degree, are leaky. Abstractions fail. Sometimes a li!le, sometimes a lot. There’s leakage. Things go wrong. It happens all over the place when you have abstractions. https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/ Law of Leaky Abstractions
  • 40. Singletons Meaning on Nulls Sharing state Static & new keywords Framework slave coding Composition over Aggregation Premature optimization Primitive obsession Huge upfront design Checked exceptions Stop, or use them wisely
  • 41. tests pass code expresses intent keep it small do not repeat yourself tame abstractions 1 2 3 4 5
  • 42.