SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
Simon Says
“SOLID OO Design
and Clean Coding
is essential for
successful Agile
development”
Introduction
Characterisics of
a Good Agile
Codebase
Or what we need to
develop to meet the
needs of an Agile
environment.
SOLID OO Design
Principles
What they are and
how a Clean Coder
can use them to
develop robust
maintainable
software.
Summary
Some guidelines
for the Clean Coder
to live by.
1.
Characteristics of
a Good Agile
Codebase
Or what we need to develop to
meet the needs of an Agile
environment.
“
No plan survives contact with the enemy
- Field Marshall Helmuth Karl Bernhard
Graf von Moltke
Change is the only constant in life.
― Heraclitus
Agile development requires:
◎The speedy delivery of working code.
◎The management of technical debt.
◎The ability to incorporate new features
and changes to existing features quickly
This requires us to be disciplined in our
development of software, ensuring that it
has the required characteristics. Beyond
it simply “working”.
Agile software should be:
◎ Loosely coupled.
◎ Cohesive.
◎ Appropriately encapsulated.
◎ Robust
◎ Easily maintained
◎ Easy to change.
This list are not exhustive, but I believe these are the
most important structural characteristics and
qualities that our software should have.
2.
SOLID OO Design
Principles
What they are and how a Clean
Coder can use them to develop
robust maintainable software.
SOLID OO design principles:
◎Single Responsibility Principle.
◎Open Closed Principle.
◎Liskov Substitution Principle
◎Interface Segregation Principle
◎Dependency Inversion Principle
Originally compiled by “Uncle Bob” martin in the 90s.
Applying these principles to our software development
“bakes in” the characteristics we require for agile
development.
Single Responsibility Principle– Do Just One Thing Well
Definition
◎ Modules should only exist
to serve one responsibility and
may only change if that
responsibility is modified
◎ A responsibility is a reason
to change, and therefore a
class or module should have
one, and only one, reason to
change.
◎A single responsibility is
dependant on the level of
abstraction at which the
software module exists.
Single Responsibility Principle– Do Just One Thing Well
Advantages
◎ Improves cohesion of
the software modules.
◎Improve maintainability
and individual modules are
simplified and so easier to
change and extend.
◎Reduces risk of making
changes, due to removing
GOD objects.
Perils
◎You mix your levels of
abstraction, leading to
confusing code that
performs high level and low
level operations. It may still
have one responsibility but
it hasn’t delegated this
appropriately to sub
modules and components.
Single Responsibility Principle– Do Just One Thing Well
◎ Provides tests to ensure
that responsibilities of the
software module are met.
The Clean Coder
◎Focuses software modules
on a simple cohesive
responsibility.
◎Avoids mixing levels of
abstraction
Open Closed Principle – Allow for interchangable parts
Definition
◎ Software entities (classes,
modules, functions, etc.) should
be open for extension, but
closed for modification
◎ Tends to refer to the use
of abstracted interfaces, where
the implementations can be
changed and multiple
implementations could be
created
and polymorphically substituted
for each other.
Open Closed Principle – Allow for interchangable parts
Advantages
◎ Functionality can be
added by creating a new
subclass, minimising the
impact on the existing
codebase and so
minimising risk.
Perils
◎You have to modify the
interface and therefore the
client code and ALL the
implementations.
Open Closed Principle – Allow for interchangable parts
◎Uses the Interface
Segregation Principle to
extend or add abstractions
rather than changing existing
ones.
◎Provides tests for each
implementation and extension.
The Clean Coder
◎Creates abstractions to hide
what varies between
implementations from the
client code. Pushing
complexity down to the lower
levels of abstraction.
◎Spends time simplifying
their abstractions, because
once they become ubiquitous,
they become difficult to
change.
Liskov Substitution Principle - Be What They Expect You to Be
Definition
◎ An object of type T (an
abstraction) may substitute objects
derived from T without altering any
of the properties of that program.
◎ Sub types must:
○Maintain the Semantic correctness of
the abstraction.
○Maintain Contravariance of
arguments in the subtype (only be
made more abstract)
○Maintain Covariance of return types
in the subtype (only be made less
abstract)
○Not throw new types of exception
unless these are derived from the
exceptions thrown in T
Liskov Substitution Principle - Be What They Expect You to Be
Advantages
◎ Client code can work
with new implementations
that adhere to the Liskov
substitution Principle
Without needing to
change. Making it much
easier to extend.
◎Once again leading to
loosely coupled code.
Perils
◎Violations of Semantic
correctness are not always
obvious.
◎ The client code needs to
change because your
abstraction leaks
implementation details (a
LSP violation).
Liskov Substitution Principle - Be What They Expect You to Be
◎When in doubt, makes their
interfaces more abstract and
simple, reducing the likelihood
of a Liskov Substitution
violation in the client code.
The Clean Coder
◎Implements abstractions so
that the implementation
conforms with the semantics
(meaning )of the interface.
◎Implementations of the
interfaces should conform to
the Open Closed Principle
◎Provides common tests that
confirm substitutability of sub
classes and semantic
conformance to the interface.
Interface Segregation Principle - Don't Make Me Specify Things I
Don't Care About
Definition
◎ No client should be
forced to depend on
methods it does not use
◎Many small interfaces is
preferred to One all
encompassing one.
◎Keep interfaces Small
and Cohesive
Interface Segregation Principle - Don't Make Me Specify Things I
Don't Care About
Advantages
◎ Promotes loose coupling
as client code only
depends on the
abstractions that they use.
◎Makes the code easier to
refactor and extend as
each interface should be
minimal but complete.
Perils
◎The law of Leaky
Abstractions – “All non
trivial abstractions, to some
degree, are leaky”
Interface Segregation Principle - Don't Make Me Specify Things I
Don't Care About
◎Keeps interfaces separate
and cohesive. Don’t repeat
Yourself
The Clean Coder
◎Uses the Liskov
Substitution Principle to
define semantically consistent
abstractions, minimising the
law of leaky abstractions.
◎Uses the Single
Responsibility Principle to
determine the scope of
Abstractions
Dependancy Inversion Principle - I Don't Care How, Just Give Me
What I Want
Definition
◎ High-level modules
should not depend on low-
level modules. Both should
depend on Abstractions
◎Abstractions should not
depend on details. Details
should depend on
abstractions.
Dependancy Inversion Principle - I Don't Care How, Just Give Me
What I Want
Advantages
◎ Promotes loose coupling
as all interactions are
through defined interfaces
or “contracts”.
◎Allows top down Test
Driven Design, where
abstractions are defined by
client need and mocked for
testing in isolation.
◎Maximises the amount of
work not done – “Your not
going to need it”
Perils
◎ One interface to rule
them all… the “GOD”
interface.
Dependancy Inversion Principle - I Don't Care How, Just Give Me
What I Want
◎Gives Meaningful Names
to abstractions and the
methods that define the
“contract” of the abstraction.
The Clean Coder
◎ Uses the Interface
Segregation Principle and
the Single Responsibility
Principle to define the
Abstractions the Client code
requires.
◎Writes tests first, defining
and mocking abstractions as
the Need is identified. Making
appropriate use of Design
Patterns and maximising the
amount of work Not done.
3.
Summary
Some guidelines for the Clean
Coder to live by.
The Clean Coder
Is mindful of the
SOLID OO Design
Principles.
There is no good
reason not to apply
these to your day to
day work. Look them
up, practice them,
learn.
Writes tests first
as part of your
design process.
Start with the test at
the highest level of
abstraction. Identify
the client code needs
and behaviour.
Create tests for these
and create interfaces
that meet the client
codes needs. Then
move to the lower
level abstractions and
repeat. Practice,
practice, practice.
Manages
Technical Debt
with refactoring.
Unit testing MUST be
in place to reduce risk
and is the corner
stone of refactoring.
Technical debt
always exists, if it is
isolated and
managed
appropriately it wont
kill your code base.
The Clean Coder
Doesn’t repeat
themself
Minimises knowledge
duplication in the
code
Keeps things
simple
Remember Simple is
NOT the same as
quick and easy (dirty).
Simplify interatively.
Something is simple if
the dependencies are
minimised (loose
coupling),
abstractions are not
mixed and it has a
clear purpose
(Cohesive)
Uses Meanigful
names
Code is intended to
convey meaning to
the programmer and
their team. This is
why we don’t look at
zeros and ones
anymore. If the
naming is meaningful
and the methods
simple and small
there is no need to
explain it with
comments.
The Clean Coder
Minimises Scope
of Methods and
Variables
Helps reduce
complexity and the
risk of side effects /
action at a distance.
Works as part of a
team
Help your collegues
to deliver the most
important features.
You succeed and fail
as a group.
Uses the right
tools for the Job
Appropriate IDEs with
refactoring
capabilities (allows
you to work faster
and cleaner).
Technologies and
frameworks that
provide functionality
required.
The Clean Coder
Practice Practice Practice
You have to be doing
these things regularly
and refresh them
regularly. Never stop
learning and
improving.
Its no good knowing
what to do if you don’t
do it.

Weitere ähnliche Inhalte

Was ist angesagt?

Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented ProgrammingAnumod Kumar
 
3.o o design -_____________lecture 3
3.o o design -_____________lecture 33.o o design -_____________lecture 3
3.o o design -_____________lecture 3Warui Maina
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#Aditya Kumar Rajan
 
Prefer Code to Comments
Prefer Code to CommentsPrefer Code to Comments
Prefer Code to CommentsKevlin Henney
 
Geecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesGeecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesBruno Bossola
 
Software Design Principles
Software Design PrinciplesSoftware Design Principles
Software Design PrinciplesOcean Dong
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship ChecklistRyan Polk
 
OO Inheritance - Not Always Evil - Refactoring to Open-Closed with Inheritance
OO Inheritance - Not Always Evil - Refactoring to Open-Closed with InheritanceOO Inheritance - Not Always Evil - Refactoring to Open-Closed with Inheritance
OO Inheritance - Not Always Evil - Refactoring to Open-Closed with InheritancePhilip Schwarz
 
Solid principles of oo design
Solid principles of oo designSolid principles of oo design
Solid principles of oo designConfiz
 
Introduction to Unit Testing
Introduction to Unit TestingIntroduction to Unit Testing
Introduction to Unit TestingSwanky Hsiao
 
The Open-Closed Principle - the Original Version and the Contemporary Version
The Open-Closed Principle - the Original Version and the Contemporary VersionThe Open-Closed Principle - the Original Version and the Contemporary Version
The Open-Closed Principle - the Original Version and the Contemporary VersionPhilip Schwarz
 
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 Developerswojtek_s
 
SOLID Design Principles applied in Java
SOLID Design Principles applied in JavaSOLID Design Principles applied in Java
SOLID Design Principles applied in JavaIonut Bilica
 
Agile development with Ruby
Agile development with RubyAgile development with Ruby
Agile development with Rubykhelll
 

Was ist angesagt? (20)

Solid principles
Solid principlesSolid principles
Solid principles
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
 
3.o o design -_____________lecture 3
3.o o design -_____________lecture 33.o o design -_____________lecture 3
3.o o design -_____________lecture 3
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#
 
Sorted
SortedSorted
Sorted
 
Inside Requirements
Inside RequirementsInside Requirements
Inside Requirements
 
Prefer Code to Comments
Prefer Code to CommentsPrefer Code to Comments
Prefer Code to Comments
 
Geecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesGeecon09: SOLID Design Principles
Geecon09: SOLID Design Principles
 
Software Design Principles
Software Design PrinciplesSoftware Design Principles
Software Design Principles
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship Checklist
 
OO Inheritance - Not Always Evil - Refactoring to Open-Closed with Inheritance
OO Inheritance - Not Always Evil - Refactoring to Open-Closed with InheritanceOO Inheritance - Not Always Evil - Refactoring to Open-Closed with Inheritance
OO Inheritance - Not Always Evil - Refactoring to Open-Closed with Inheritance
 
Solid Principle
Solid PrincipleSolid Principle
Solid Principle
 
Solid principles of oo design
Solid principles of oo designSolid principles of oo design
Solid principles of oo design
 
Introduction to Unit Testing
Introduction to Unit TestingIntroduction to Unit Testing
Introduction to Unit Testing
 
The Open-Closed Principle - the Original Version and the Contemporary Version
The Open-Closed Principle - the Original Version and the Contemporary VersionThe Open-Closed Principle - the Original Version and the Contemporary Version
The Open-Closed Principle - the Original Version and the Contemporary Version
 
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
 
Quick Intro to Clean Coding
Quick Intro to Clean CodingQuick Intro to Clean Coding
Quick Intro to Clean Coding
 
SOLID Design Principles applied in Java
SOLID Design Principles applied in JavaSOLID Design Principles applied in Java
SOLID Design Principles applied in Java
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Agile development with Ruby
Agile development with RubyAgile development with Ruby
Agile development with Ruby
 

Andere mochten auch

Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan GoleChetan Gole
 
Design Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The WorldDesign Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The WorldSaurabh Moody
 
The State’s Responsibility In Providing For The Social Welfare Of The Retire...
The State’s Responsibility In Providing For The Social Welfare Of  The Retire...The State’s Responsibility In Providing For The Social Welfare Of  The Retire...
The State’s Responsibility In Providing For The Social Welfare Of The Retire...Jessica Kemunto Maina
 
How To Open A Restaurant In New York
How To Open A Restaurant In New YorkHow To Open A Restaurant In New York
How To Open A Restaurant In New YorkPTN Commerce
 
Rpp revisi 2016 pai & bp xii rpp diva pendidikan
Rpp revisi 2016 pai & bp xii  rpp diva pendidikanRpp revisi 2016 pai & bp xii  rpp diva pendidikan
Rpp revisi 2016 pai & bp xii rpp diva pendidikanDiva Pendidikan
 
Rpp revisi 2016 bahasa inggris peminatan xii rpp diva pendidikan
Rpp revisi 2016 bahasa inggris peminatan xii  rpp diva pendidikanRpp revisi 2016 bahasa inggris peminatan xii  rpp diva pendidikan
Rpp revisi 2016 bahasa inggris peminatan xii rpp diva pendidikanDiva Pendidikan
 
Rpp revisi 2016 ppkn xii rpp diva pendidikan
Rpp revisi 2016 ppkn xii  rpp diva pendidikanRpp revisi 2016 ppkn xii  rpp diva pendidikan
Rpp revisi 2016 ppkn xii rpp diva pendidikanDiva Pendidikan
 
Les maladies de déficits immunitaires
Les maladies de déficits immunitairesLes maladies de déficits immunitaires
Les maladies de déficits immunitairesKhadija Moussayer
 
Rpp revisi 2016 matematika wajib xi rpp diva pendidikan
Rpp revisi 2016 matematika wajib xi  rpp diva pendidikanRpp revisi 2016 matematika wajib xi  rpp diva pendidikan
Rpp revisi 2016 matematika wajib xi rpp diva pendidikanDiva Pendidikan
 
The Beast Sports Nutrition CREATure
The Beast Sports Nutrition CREATureThe Beast Sports Nutrition CREATure
The Beast Sports Nutrition CREATurePaul Davidson
 
Rpp revisi 2016 bahasa inggris wajib xi rpp diva pendidikan
Rpp revisi 2016 bahasa inggris wajib xi  rpp diva pendidikanRpp revisi 2016 bahasa inggris wajib xi  rpp diva pendidikan
Rpp revisi 2016 bahasa inggris wajib xi rpp diva pendidikanDiva Pendidikan
 
June 26 Thursday Supplies with Tazzy
June 26 Thursday Supplies with TazzyJune 26 Thursday Supplies with Tazzy
June 26 Thursday Supplies with TazzyBritney Stanley-Wyatt
 
Curiosidades de decimo b
Curiosidades de decimo bCuriosidades de decimo b
Curiosidades de decimo bCeleste Quinga
 
Le défi des maladies rares (dossier en français et en arabe)
Le défi des maladies rares (dossier en français et en arabe)Le défi des maladies rares (dossier en français et en arabe)
Le défi des maladies rares (dossier en français et en arabe)Khadija Moussayer
 
Rpp revisi 2016 fisika x rpp diva pendidikan
Rpp revisi 2016 fisika x  rpp diva pendidikanRpp revisi 2016 fisika x  rpp diva pendidikan
Rpp revisi 2016 fisika x rpp diva pendidikanDiva Pendidikan
 

Andere mochten auch (20)

Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan Gole
 
Design Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The WorldDesign Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The World
 
Design patterns
Design patternsDesign patterns
Design patterns
 
The State’s Responsibility In Providing For The Social Welfare Of The Retire...
The State’s Responsibility In Providing For The Social Welfare Of  The Retire...The State’s Responsibility In Providing For The Social Welfare Of  The Retire...
The State’s Responsibility In Providing For The Social Welfare Of The Retire...
 
How To Open A Restaurant In New York
How To Open A Restaurant In New YorkHow To Open A Restaurant In New York
How To Open A Restaurant In New York
 
The Recycling Problem
The Recycling Problem   The Recycling Problem
The Recycling Problem
 
Flyer ChronoViti
Flyer ChronoVitiFlyer ChronoViti
Flyer ChronoViti
 
Rpp revisi 2016 pai & bp xii rpp diva pendidikan
Rpp revisi 2016 pai & bp xii  rpp diva pendidikanRpp revisi 2016 pai & bp xii  rpp diva pendidikan
Rpp revisi 2016 pai & bp xii rpp diva pendidikan
 
Rpp revisi 2016 bahasa inggris peminatan xii rpp diva pendidikan
Rpp revisi 2016 bahasa inggris peminatan xii  rpp diva pendidikanRpp revisi 2016 bahasa inggris peminatan xii  rpp diva pendidikan
Rpp revisi 2016 bahasa inggris peminatan xii rpp diva pendidikan
 
At Your Service
At Your ServiceAt Your Service
At Your Service
 
Rpp revisi 2016 ppkn xii rpp diva pendidikan
Rpp revisi 2016 ppkn xii  rpp diva pendidikanRpp revisi 2016 ppkn xii  rpp diva pendidikan
Rpp revisi 2016 ppkn xii rpp diva pendidikan
 
Les maladies de déficits immunitaires
Les maladies de déficits immunitairesLes maladies de déficits immunitaires
Les maladies de déficits immunitaires
 
Rpp revisi 2016 matematika wajib xi rpp diva pendidikan
Rpp revisi 2016 matematika wajib xi  rpp diva pendidikanRpp revisi 2016 matematika wajib xi  rpp diva pendidikan
Rpp revisi 2016 matematika wajib xi rpp diva pendidikan
 
The Beast Sports Nutrition CREATure
The Beast Sports Nutrition CREATureThe Beast Sports Nutrition CREATure
The Beast Sports Nutrition CREATure
 
Rpp revisi 2016 bahasa inggris wajib xi rpp diva pendidikan
Rpp revisi 2016 bahasa inggris wajib xi  rpp diva pendidikanRpp revisi 2016 bahasa inggris wajib xi  rpp diva pendidikan
Rpp revisi 2016 bahasa inggris wajib xi rpp diva pendidikan
 
June 26 Thursday Supplies with Tazzy
June 26 Thursday Supplies with TazzyJune 26 Thursday Supplies with Tazzy
June 26 Thursday Supplies with Tazzy
 
Curiosidades de decimo b
Curiosidades de decimo bCuriosidades de decimo b
Curiosidades de decimo b
 
Ampul Spring 2016 Final
Ampul Spring 2016 FinalAmpul Spring 2016 Final
Ampul Spring 2016 Final
 
Le défi des maladies rares (dossier en français et en arabe)
Le défi des maladies rares (dossier en français et en arabe)Le défi des maladies rares (dossier en français et en arabe)
Le défi des maladies rares (dossier en français et en arabe)
 
Rpp revisi 2016 fisika x rpp diva pendidikan
Rpp revisi 2016 fisika x  rpp diva pendidikanRpp revisi 2016 fisika x  rpp diva pendidikan
Rpp revisi 2016 fisika x rpp diva pendidikan
 

Ähnlich wie Solid OO & Clean Coding is essential to successful Agile development

SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionKnoldus Inc.
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsJuan Lopez
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design PrinciplesSteve Zhang
 
SOLID principles-Present
SOLID principles-PresentSOLID principles-Present
SOLID principles-PresentQuang Nguyen
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desaijinaldesailive
 
SOLID design principles in Ruby
SOLID design principles in RubySOLID design principles in Ruby
SOLID design principles in RubyAnil Wadghule
 
Are You a SOLID Coder?
Are You a SOLID Coder?Are You a SOLID Coder?
Are You a SOLID Coder?Steve Green
 
Create first android app with MVVM Architecture
Create first android app with MVVM ArchitectureCreate first android app with MVVM Architecture
Create first android app with MVVM Architecturekhushbu thakker
 
Maksym Ked "Plug-In C++ Application Architecture"
Maksym Ked "Plug-In C++ Application Architecture"Maksym Ked "Plug-In C++ Application Architecture"
Maksym Ked "Plug-In C++ Application Architecture"LogeekNightUkraine
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsBasavaraj Patil
 
Solid design principles
Solid design principlesSolid design principles
Solid design principlesMahmoud Asadi
 
Inversion of Control
Inversion of ControlInversion of Control
Inversion of ControlShuhab Tariq
 
Structured Software Design
Structured Software DesignStructured Software Design
Structured Software DesignGiorgio Zoppi
 
Clean Code - Part 2
Clean Code - Part 2Clean Code - Part 2
Clean Code - Part 2Knoldus Inc.
 
Is your code solid
Is your code solidIs your code solid
Is your code solidNathan Gloyn
 

Ähnlich wie Solid OO & Clean Coding is essential to successful Agile development (20)

SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and Patterns
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design Principles
 
SOLID principles-Present
SOLID principles-PresentSOLID principles-Present
SOLID principles-Present
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
 
SOLID design principles in Ruby
SOLID design principles in RubySOLID design principles in Ruby
SOLID design principles in Ruby
 
Are You a SOLID Coder?
Are You a SOLID Coder?Are You a SOLID Coder?
Are You a SOLID Coder?
 
Create first android app with MVVM Architecture
Create first android app with MVVM ArchitectureCreate first android app with MVVM Architecture
Create first android app with MVVM Architecture
 
Maksym Ked "Plug-In C++ Application Architecture"
Maksym Ked "Plug-In C++ Application Architecture"Maksym Ked "Plug-In C++ Application Architecture"
Maksym Ked "Plug-In C++ Application Architecture"
 
android principle.pptx
android principle.pptxandroid principle.pptx
android principle.pptx
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
 
Solid design principles
Solid design principlesSolid design principles
Solid design principles
 
Inversion of Control
Inversion of ControlInversion of Control
Inversion of Control
 
Structured Software Design
Structured Software DesignStructured Software Design
Structured Software Design
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Clean Code - Part 2
Clean Code - Part 2Clean Code - Part 2
Clean Code - Part 2
 
Is your code solid
Is your code solidIs your code solid
Is your code solid
 
Solid
SolidSolid
Solid
 

Kürzlich hochgeladen

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 

Kürzlich hochgeladen (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 

Solid OO & Clean Coding is essential to successful Agile development

  • 1. Simon Says “SOLID OO Design and Clean Coding is essential for successful Agile development”
  • 2. Introduction Characterisics of a Good Agile Codebase Or what we need to develop to meet the needs of an Agile environment. SOLID OO Design Principles What they are and how a Clean Coder can use them to develop robust maintainable software. Summary Some guidelines for the Clean Coder to live by.
  • 3. 1. Characteristics of a Good Agile Codebase Or what we need to develop to meet the needs of an Agile environment.
  • 4. “ No plan survives contact with the enemy - Field Marshall Helmuth Karl Bernhard Graf von Moltke Change is the only constant in life. ― Heraclitus
  • 5. Agile development requires: ◎The speedy delivery of working code. ◎The management of technical debt. ◎The ability to incorporate new features and changes to existing features quickly This requires us to be disciplined in our development of software, ensuring that it has the required characteristics. Beyond it simply “working”.
  • 6. Agile software should be: ◎ Loosely coupled. ◎ Cohesive. ◎ Appropriately encapsulated. ◎ Robust ◎ Easily maintained ◎ Easy to change. This list are not exhustive, but I believe these are the most important structural characteristics and qualities that our software should have.
  • 7. 2. SOLID OO Design Principles What they are and how a Clean Coder can use them to develop robust maintainable software.
  • 8. SOLID OO design principles: ◎Single Responsibility Principle. ◎Open Closed Principle. ◎Liskov Substitution Principle ◎Interface Segregation Principle ◎Dependency Inversion Principle Originally compiled by “Uncle Bob” martin in the 90s. Applying these principles to our software development “bakes in” the characteristics we require for agile development.
  • 9. Single Responsibility Principle– Do Just One Thing Well Definition ◎ Modules should only exist to serve one responsibility and may only change if that responsibility is modified ◎ A responsibility is a reason to change, and therefore a class or module should have one, and only one, reason to change. ◎A single responsibility is dependant on the level of abstraction at which the software module exists.
  • 10. Single Responsibility Principle– Do Just One Thing Well Advantages ◎ Improves cohesion of the software modules. ◎Improve maintainability and individual modules are simplified and so easier to change and extend. ◎Reduces risk of making changes, due to removing GOD objects. Perils ◎You mix your levels of abstraction, leading to confusing code that performs high level and low level operations. It may still have one responsibility but it hasn’t delegated this appropriately to sub modules and components.
  • 11. Single Responsibility Principle– Do Just One Thing Well ◎ Provides tests to ensure that responsibilities of the software module are met. The Clean Coder ◎Focuses software modules on a simple cohesive responsibility. ◎Avoids mixing levels of abstraction
  • 12. Open Closed Principle – Allow for interchangable parts Definition ◎ Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification ◎ Tends to refer to the use of abstracted interfaces, where the implementations can be changed and multiple implementations could be created and polymorphically substituted for each other.
  • 13. Open Closed Principle – Allow for interchangable parts Advantages ◎ Functionality can be added by creating a new subclass, minimising the impact on the existing codebase and so minimising risk. Perils ◎You have to modify the interface and therefore the client code and ALL the implementations.
  • 14. Open Closed Principle – Allow for interchangable parts ◎Uses the Interface Segregation Principle to extend or add abstractions rather than changing existing ones. ◎Provides tests for each implementation and extension. The Clean Coder ◎Creates abstractions to hide what varies between implementations from the client code. Pushing complexity down to the lower levels of abstraction. ◎Spends time simplifying their abstractions, because once they become ubiquitous, they become difficult to change.
  • 15. Liskov Substitution Principle - Be What They Expect You to Be Definition ◎ An object of type T (an abstraction) may substitute objects derived from T without altering any of the properties of that program. ◎ Sub types must: ○Maintain the Semantic correctness of the abstraction. ○Maintain Contravariance of arguments in the subtype (only be made more abstract) ○Maintain Covariance of return types in the subtype (only be made less abstract) ○Not throw new types of exception unless these are derived from the exceptions thrown in T
  • 16. Liskov Substitution Principle - Be What They Expect You to Be Advantages ◎ Client code can work with new implementations that adhere to the Liskov substitution Principle Without needing to change. Making it much easier to extend. ◎Once again leading to loosely coupled code. Perils ◎Violations of Semantic correctness are not always obvious. ◎ The client code needs to change because your abstraction leaks implementation details (a LSP violation).
  • 17. Liskov Substitution Principle - Be What They Expect You to Be ◎When in doubt, makes their interfaces more abstract and simple, reducing the likelihood of a Liskov Substitution violation in the client code. The Clean Coder ◎Implements abstractions so that the implementation conforms with the semantics (meaning )of the interface. ◎Implementations of the interfaces should conform to the Open Closed Principle ◎Provides common tests that confirm substitutability of sub classes and semantic conformance to the interface.
  • 18. Interface Segregation Principle - Don't Make Me Specify Things I Don't Care About Definition ◎ No client should be forced to depend on methods it does not use ◎Many small interfaces is preferred to One all encompassing one. ◎Keep interfaces Small and Cohesive
  • 19. Interface Segregation Principle - Don't Make Me Specify Things I Don't Care About Advantages ◎ Promotes loose coupling as client code only depends on the abstractions that they use. ◎Makes the code easier to refactor and extend as each interface should be minimal but complete. Perils ◎The law of Leaky Abstractions – “All non trivial abstractions, to some degree, are leaky”
  • 20. Interface Segregation Principle - Don't Make Me Specify Things I Don't Care About ◎Keeps interfaces separate and cohesive. Don’t repeat Yourself The Clean Coder ◎Uses the Liskov Substitution Principle to define semantically consistent abstractions, minimising the law of leaky abstractions. ◎Uses the Single Responsibility Principle to determine the scope of Abstractions
  • 21. Dependancy Inversion Principle - I Don't Care How, Just Give Me What I Want Definition ◎ High-level modules should not depend on low- level modules. Both should depend on Abstractions ◎Abstractions should not depend on details. Details should depend on abstractions.
  • 22. Dependancy Inversion Principle - I Don't Care How, Just Give Me What I Want Advantages ◎ Promotes loose coupling as all interactions are through defined interfaces or “contracts”. ◎Allows top down Test Driven Design, where abstractions are defined by client need and mocked for testing in isolation. ◎Maximises the amount of work not done – “Your not going to need it” Perils ◎ One interface to rule them all… the “GOD” interface.
  • 23. Dependancy Inversion Principle - I Don't Care How, Just Give Me What I Want ◎Gives Meaningful Names to abstractions and the methods that define the “contract” of the abstraction. The Clean Coder ◎ Uses the Interface Segregation Principle and the Single Responsibility Principle to define the Abstractions the Client code requires. ◎Writes tests first, defining and mocking abstractions as the Need is identified. Making appropriate use of Design Patterns and maximising the amount of work Not done.
  • 24. 3. Summary Some guidelines for the Clean Coder to live by.
  • 25. The Clean Coder Is mindful of the SOLID OO Design Principles. There is no good reason not to apply these to your day to day work. Look them up, practice them, learn. Writes tests first as part of your design process. Start with the test at the highest level of abstraction. Identify the client code needs and behaviour. Create tests for these and create interfaces that meet the client codes needs. Then move to the lower level abstractions and repeat. Practice, practice, practice. Manages Technical Debt with refactoring. Unit testing MUST be in place to reduce risk and is the corner stone of refactoring. Technical debt always exists, if it is isolated and managed appropriately it wont kill your code base.
  • 26. The Clean Coder Doesn’t repeat themself Minimises knowledge duplication in the code Keeps things simple Remember Simple is NOT the same as quick and easy (dirty). Simplify interatively. Something is simple if the dependencies are minimised (loose coupling), abstractions are not mixed and it has a clear purpose (Cohesive) Uses Meanigful names Code is intended to convey meaning to the programmer and their team. This is why we don’t look at zeros and ones anymore. If the naming is meaningful and the methods simple and small there is no need to explain it with comments.
  • 27. The Clean Coder Minimises Scope of Methods and Variables Helps reduce complexity and the risk of side effects / action at a distance. Works as part of a team Help your collegues to deliver the most important features. You succeed and fail as a group. Uses the right tools for the Job Appropriate IDEs with refactoring capabilities (allows you to work faster and cleaner). Technologies and frameworks that provide functionality required.
  • 28. The Clean Coder Practice Practice Practice You have to be doing these things regularly and refresh them regularly. Never stop learning and improving. Its no good knowing what to do if you don’t do it.