SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Boutique product development company
It is amazing what you can accomplish when you have a client-centric team to deliver outstanding products.
SOLID Principles of OO Design
Waleed Bin Dawood | Software Engineer

Boutique product development company

It is amazing what you can accomplish when you have a client-centric team to deliver outstanding products.
"Any fool can write code that a computer can
understand. Good programmers write code that humans
can understand"
Martin Fowler

SOLID Principles of Object Oriented Design
●
●
●
●

Software design
What makes a design good or bad ?
Design/Code Smells
SOLID Principles

Waleed Bin Dawood | Software Engineer
SOLID Principles

What is software design ?

•
•
•
•

The source code is the design
UML diagram represents part of a design
Software design process includes coding, testing,
refactoring…
The programmer is the actual software designer.

Waleed Bin Dawood | Software Engineer
SOLID Principles

Why do we need a good design ?

•
•
•

To deliver fast
To manage change easily
To deal with complexity

Waleed Bin Dawood | Software Engineer
SOLID Principles

How to identify a bad design ?

“In my BillG review meeting, the whole
reporting hierarchy was there...and a
person...whose whole job during the
meeting was to keep an accurate
count of how many times Bill said the F
word. The lower the f***-count, the
better.”
-- Joel Spolsky, My First BillG Review

But may be we need some better criteria :)

Waleed Bin Dawood | Software Engineer
SOLID Principles

How to identify a bad design ?

Design/Code Smells
● Rigidity - The design is hard to change
● Fragility - The design is easy to break
● Immobility - The design is hard to reuse
● Viscosity - It is hard to do the right thing

Waleed Bin Dawood | Software Engineer
SOLID Principles

Good design

What are the characteristics of a good design ?
● High Cohesion
● Low Coupling

How to achieve a good design ?
Follow programming practices of your
language/framework
Follow OO design principles
Use design patterns

•
•
•

Waleed Bin Dawood | Software Engineer
SOLID Principles

Let’s go SOLID

Initial

Stands for
(acronym)

Concept

S

SRP

Single responsibility principle
a class should have only a single responsibility.

O

OCP

Open/closed principle
“software entities … should be open for extension, but closed for modification”.

L

LSP

Liskov substitution principle
“objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program”.

I

ISP

Interface segregation principle
“many client-specific interfaces are better than one general-purpose interface.”

D

DIP

Dependency inversion principle
one should “Depend upon Abstractions. Do not depend upon concretions.”

Waleed Bin Dawood | Software Engineer
SOLID Principles

Single Responsibility Principle

•
•
•
•

“There should never be more than one reason for a class
to change.” -- Robert Martin, SRP paper
Easier : A class should concentrate on doing one thing
and one thing only
It give you high cohesion
It’s often hard to identify different responsibilities

Waleed Bin Dawood | Software Engineer
SOLID Principles

Single Responsibility Principle

•

•

Is SRP violated here ?

Two responsibilities:
o Connection management
o Data Communication

Waleed Bin Dawood | Software Engineer
SOLID Principles

Single Responsibility Principle

•

•

Solution :

Two responsibilities:
o Connection management
o Data Communication

Waleed Bin Dawood | Software Engineer
SOLID Principles

Open/Closed Principle

•
•
•

“Software entities should be open for extension, but
closed for modification.” -- Robert Martin paraphrasing
Bertrand Meyer, OCP Paper
Easier : you should be able to extend the behaviour of a
module without changing it
Abstraction is the key

Waleed Bin Dawood | Software Engineer
SOLID Principles

Open/Closed Principle

•

Is OCP violated here ?

Waleed Bin Dawood | Software Engineer
SOLID Principles

Open/Closed Principle

•

Solution:

Waleed Bin Dawood | Software Engineer
SOLID Principles

Liskov Substitution Principle

•
•

“Functions that use pointers or references to base
classes must be able to use objects of derived classes
without knowing it.” -- Robert Martin, LSP Paper
Easier : Subclasses should behave nicely when used in
place of their parent class

Waleed Bin Dawood | Software Engineer
SOLID Principles

Liskov Substitution Principle

•
•
•
•

How would you model the relationship between a square
and a rectangle ?
Should the square class extends rectangle ?
Many of you would say “yes” or “why not”. Square is a
kind of Rectangle after all. An obvious IS-A relationship

Issues in this Approach:
o Square has unnecessary attribute ‘width’
o What happens when we want to calculate area ?
o What happens if the client code is assuming height
and width to be independent of each other

Waleed Bin Dawood | Software Engineer
SOLID Principles

Dependency Inversion Principle

•
•

“A. High level modules should not depend upon low level
modules. Both should depend upon abstractions.
B. Abstractions should not depend upon details. Details
should depend upon abstractions.”-- Robert Martin, DIP
paper
Easier:
o Use lot of interfaces (program to interface)
o Use abstractions

Waleed Bin Dawood | Software Engineer
SOLID Principles

Interface Segregation Principle

•
•

“Clients should not be forced interfaces that they do not
use.”-- Robert Martin, ISP paper
Easier : avoid fat interfaces (cohesion)

Waleed Bin Dawood | Software Engineer
Human Computer Interaction

Thank you for your time

If you have any questions,
please ask now or forever
hold your peace

Waleed Bin Dawood | Software Engineer
Human Computer Interaction

References

•
•
•
•
•
•
•

http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)
http://www.slideshare.net/bbossola/geecon09-solid
http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
http://www.slideshare.net/intellizhang/the-oo-design-principles
http://www.slideshare.net/enbohm/solid-design-principles-9016117
http://www.oodesign.com/design-principles.html
http://objectmentor.com/resources/publishedArticles.html

Waleed Bin Dawood | Software Engineer

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Simplilearn
 
Design Patterns & JDK Examples
Design Patterns & JDK ExamplesDesign Patterns & JDK Examples
Design Patterns & JDK ExamplesEnder Aydin Orak
 
Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan GoleChetan Gole
 
#APIOps- Agile API Development powered by API Connect
#APIOps- Agile API Development powered by API Connect#APIOps- Agile API Development powered by API Connect
#APIOps- Agile API Development powered by API Connectpramodvallanur
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...Simplilearn
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Herofazalraja
 
Genesis and Overview of Java
Genesis and Overview of Java Genesis and Overview of Java
Genesis and Overview of Java Ravi_Kant_Sahu
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefitsAmit Manwade
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting startedMatheus Marabesi
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1PRN USM
 
Software Engineering - chp4- design patterns
Software Engineering - chp4- design patternsSoftware Engineering - chp4- design patterns
Software Engineering - chp4- design patternsLilia Sfaxi
 
Repository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryRepository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryStephen Chin
 
12 factor app an introduction
12 factor app an introduction12 factor app an introduction
12 factor app an introductionKrishna-Kumar
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding GuideSoftware architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding GuideMohammed Fazuluddin
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to ChefKnoldus Inc.
 

Was ist angesagt? (20)

Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
 
Design Patterns & JDK Examples
Design Patterns & JDK ExamplesDesign Patterns & JDK Examples
Design Patterns & JDK Examples
 
Debugging
DebuggingDebugging
Debugging
 
Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan Gole
 
#APIOps- Agile API Development powered by API Connect
#APIOps- Agile API Development powered by API Connect#APIOps- Agile API Development powered by API Connect
#APIOps- Agile API Development powered by API Connect
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
Genesis and Overview of Java
Genesis and Overview of Java Genesis and Overview of Java
Genesis and Overview of Java
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
 
DevOps Overview
DevOps OverviewDevOps Overview
DevOps Overview
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting started
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
 
Software Engineering - chp4- design patterns
Software Engineering - chp4- design patternsSoftware Engineering - chp4- design patterns
Software Engineering - chp4- design patterns
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Repository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryRepository Management with JFrog Artifactory
Repository Management with JFrog Artifactory
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
12 factor app an introduction
12 factor app an introduction12 factor app an introduction
12 factor app an introduction
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding GuideSoftware architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding Guide
 
Basic concepts of soa
Basic concepts of soaBasic concepts of soa
Basic concepts of soa
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 

Andere mochten auch

SOLID - Principles of Object Oriented Design
SOLID - Principles of Object Oriented DesignSOLID - Principles of Object Oriented Design
SOLID - Principles of Object Oriented DesignRiccardo Cardin
 
"SOLID" Object Oriented Design Principles
"SOLID" Object Oriented Design Principles"SOLID" Object Oriented Design Principles
"SOLID" Object Oriented Design PrinciplesSerhiy Oplakanets
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design PrinciplesSteve Zhang
 
Advanced Object-Oriented/SOLID Principles
Advanced Object-Oriented/SOLID PrinciplesAdvanced Object-Oriented/SOLID Principles
Advanced Object-Oriented/SOLID PrinciplesJon Kruger
 
The Solid Principles
The Solid PrinciplesThe Solid Principles
The Solid PrinciplesLuke Smith
 
Object Oriented Design SOLID Principles
Object Oriented Design SOLID PrinciplesObject Oriented Design SOLID Principles
Object Oriented Design SOLID Principlesrainynovember12
 
Principios de diseño de código orientado a objetos SOLID
Principios de diseño de código orientado a objetos SOLIDPrincipios de diseño de código orientado a objetos SOLID
Principios de diseño de código orientado a objetos SOLIDLuis Alexander Aldazabal Gil
 
Software design principles
Software design principlesSoftware design principles
Software design principlesRitesh Singh
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility PrincipleEyal Golan
 
STL ALGORITHMS
STL ALGORITHMSSTL ALGORITHMS
STL ALGORITHMSfawzmasood
 
Operator overloading
Operator overloadingOperator overloading
Operator overloadingfarhan amjad
 
Improving The Quality of Existing Software
Improving The Quality of Existing SoftwareImproving The Quality of Existing Software
Improving The Quality of Existing SoftwareSteven Smith
 
C++ Advanced
C++ AdvancedC++ Advanced
C++ AdvancedVivek Das
 
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...Complement Verb
 

Andere mochten auch (20)

SOLID - Principles of Object Oriented Design
SOLID - Principles of Object Oriented DesignSOLID - Principles of Object Oriented Design
SOLID - Principles of Object Oriented Design
 
"SOLID" Object Oriented Design Principles
"SOLID" Object Oriented Design Principles"SOLID" Object Oriented Design Principles
"SOLID" Object Oriented Design Principles
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design Principles
 
Advanced Object-Oriented/SOLID Principles
Advanced Object-Oriented/SOLID PrinciplesAdvanced Object-Oriented/SOLID Principles
Advanced Object-Oriented/SOLID Principles
 
The Solid Principles
The Solid PrinciplesThe Solid Principles
The Solid Principles
 
Object Oriented Design SOLID Principles
Object Oriented Design SOLID PrinciplesObject Oriented Design SOLID Principles
Object Oriented Design SOLID Principles
 
Principios de diseño de código orientado a objetos SOLID
Principios de diseño de código orientado a objetos SOLIDPrincipios de diseño de código orientado a objetos SOLID
Principios de diseño de código orientado a objetos SOLID
 
Principios SOLID
Principios SOLIDPrincipios SOLID
Principios SOLID
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility Principle
 
Distributed Systems Design
Distributed Systems DesignDistributed Systems Design
Distributed Systems Design
 
The Style of C++ 11
The Style of C++ 11The Style of C++ 11
The Style of C++ 11
 
Idiomatic C++
Idiomatic C++Idiomatic C++
Idiomatic C++
 
STL ALGORITHMS
STL ALGORITHMSSTL ALGORITHMS
STL ALGORITHMS
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Improving The Quality of Existing Software
Improving The Quality of Existing SoftwareImproving The Quality of Existing Software
Improving The Quality of Existing Software
 
C++ Advanced
C++ AdvancedC++ Advanced
C++ Advanced
 
Web Service Basics and NWS Setup
Web Service  Basics and NWS SetupWeb Service  Basics and NWS Setup
Web Service Basics and NWS Setup
 
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
 
Operator overloading
Operator overloading Operator overloading
Operator overloading
 

Ähnlich wie Solid principles of oo design

SOLID design principles in Ruby
SOLID design principles in RubySOLID design principles in Ruby
SOLID design principles in RubyAnil Wadghule
 
Is your code SOLID enough?
 Is your code SOLID enough? Is your code SOLID enough?
Is your code SOLID enough?SARCCOM
 
bGenius kennissessie_20120510
bGenius kennissessie_20120510bGenius kennissessie_20120510
bGenius kennissessie_20120510bgenius
 
Refactoring to SOLID Code
Refactoring to SOLID CodeRefactoring to SOLID Code
Refactoring to SOLID CodeAdil Mughal
 
Object Oriented Design Principles
Object Oriented Design PrinciplesObject Oriented Design Principles
Object Oriented Design PrinciplesThang Tran Duc
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseKevin Mas Ruiz
 
It is a sunny day
It is a sunny dayIt is a sunny day
It is a sunny daybcoder
 
Friday final test
Friday final testFriday final test
Friday final testbcoder
 
Use Design Principle to Improve code quality
Use Design Principle to Improve code qualityUse Design Principle to Improve code quality
Use Design Principle to Improve code qualityHebin Wei
 
Devops On Cloud Powerpoint Template Slides Powerpoint Presentation Slides
Devops On Cloud Powerpoint Template Slides Powerpoint Presentation SlidesDevops On Cloud Powerpoint Template Slides Powerpoint Presentation Slides
Devops On Cloud Powerpoint Template Slides Powerpoint Presentation SlidesSlideTeam
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionKnoldus Inc.
 
Solid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile developmentSolid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile developmentSimon Gould
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedAlexander Makarov
 
Software Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesSoftware Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesAlfred Jett Grandeza
 
RSpec & Rails, an introduction
RSpec & Rails, an introductionRSpec & Rails, an introduction
RSpec & Rails, an introductionUtku Kaynar
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesQamar Abbas
 
From Sandbox to Production by Vadym Fedorov
From Sandbox to Production by Vadym FedorovFrom Sandbox to Production by Vadym Fedorov
From Sandbox to Production by Vadym FedorovSoftServe
 
DevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDaysJKT
 

Ähnlich wie Solid principles of oo design (20)

SOLID design principles in Ruby
SOLID design principles in RubySOLID design principles in Ruby
SOLID design principles in Ruby
 
Is your code SOLID enough?
 Is your code SOLID enough? Is your code SOLID enough?
Is your code SOLID enough?
 
Design Principles
Design PrinciplesDesign Principles
Design Principles
 
bGenius kennissessie_20120510
bGenius kennissessie_20120510bGenius kennissessie_20120510
bGenius kennissessie_20120510
 
Refactoring to SOLID Code
Refactoring to SOLID CodeRefactoring to SOLID Code
Refactoring to SOLID Code
 
Object Oriented Design Principles
Object Oriented Design PrinciplesObject Oriented Design Principles
Object Oriented Design Principles
 
Schibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD CourseSchibsted Spain - Day 1 - DDD Course
Schibsted Spain - Day 1 - DDD Course
 
It is a sunny day
It is a sunny dayIt is a sunny day
It is a sunny day
 
Friday final test
Friday final testFriday final test
Friday final test
 
Use Design Principle to Improve code quality
Use Design Principle to Improve code qualityUse Design Principle to Improve code quality
Use Design Principle to Improve code quality
 
android principle.pptx
android principle.pptxandroid principle.pptx
android principle.pptx
 
Devops On Cloud Powerpoint Template Slides Powerpoint Presentation Slides
Devops On Cloud Powerpoint Template Slides Powerpoint Presentation SlidesDevops On Cloud Powerpoint Template Slides Powerpoint Presentation Slides
Devops On Cloud Powerpoint Template Slides Powerpoint Presentation Slides
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
 
Solid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile developmentSolid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile development
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 
Software Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesSoftware Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry Practices
 
RSpec & Rails, an introduction
RSpec & Rails, an introductionRSpec & Rails, an introduction
RSpec & Rails, an introduction
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
 
From Sandbox to Production by Vadym Fedorov
From Sandbox to Production by Vadym FedorovFrom Sandbox to Production by Vadym Fedorov
From Sandbox to Production by Vadym Fedorov
 
DevOpsDays Jakarta Igites
DevOpsDays Jakarta IgitesDevOpsDays Jakarta Igites
DevOpsDays Jakarta Igites
 

Mehr von Confiz

Agile training workshop
Agile training workshopAgile training workshop
Agile training workshopConfiz
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravelConfiz
 
DMAIC-Six sigma process Improvement Approach
DMAIC-Six sigma process Improvement ApproachDMAIC-Six sigma process Improvement Approach
DMAIC-Six sigma process Improvement ApproachConfiz
 
What is UFT? HP's unified functional testing.
What is UFT? HP's unified functional testing.What is UFT? HP's unified functional testing.
What is UFT? HP's unified functional testing.Confiz
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and typesConfiz
 
Sqa, test scenarios and test cases
Sqa, test scenarios and test casesSqa, test scenarios and test cases
Sqa, test scenarios and test casesConfiz
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code firstConfiz
 
Security testing presentation
Security testing presentationSecurity testing presentation
Security testing presentationConfiz
 
Ts seo t ech session
Ts   seo t ech sessionTs   seo t ech session
Ts seo t ech sessionConfiz
 
Learning as a creative professional
Learning as a creative professionalLearning as a creative professional
Learning as a creative professionalConfiz
 
Learning as a creative professional
Learning as a creative professionalLearning as a creative professional
Learning as a creative professionalConfiz
 
Ts archiving
Ts   archivingTs   archiving
Ts archivingConfiz
 
Advance text rendering in i os
Advance text rendering in i osAdvance text rendering in i os
Advance text rendering in i osConfiz
 
Ts threading
Ts   threadingTs   threading
Ts threadingConfiz
 
Ts android supporting multiple screen
Ts   android supporting multiple screenTs   android supporting multiple screen
Ts android supporting multiple screenConfiz
 
Ts drupal6 module development v0.2
Ts   drupal6 module development v0.2Ts   drupal6 module development v0.2
Ts drupal6 module development v0.2Confiz
 
Photoshop manners
Photoshop mannersPhotoshop manners
Photoshop mannersConfiz
 
Monkey talk
Monkey talkMonkey talk
Monkey talkConfiz
 
An insight to microsoft platform
An insight to microsoft platformAn insight to microsoft platform
An insight to microsoft platformConfiz
 
Ts branching over the top
Ts   branching over the topTs   branching over the top
Ts branching over the topConfiz
 

Mehr von Confiz (20)

Agile training workshop
Agile training workshopAgile training workshop
Agile training workshop
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravel
 
DMAIC-Six sigma process Improvement Approach
DMAIC-Six sigma process Improvement ApproachDMAIC-Six sigma process Improvement Approach
DMAIC-Six sigma process Improvement Approach
 
What is UFT? HP's unified functional testing.
What is UFT? HP's unified functional testing.What is UFT? HP's unified functional testing.
What is UFT? HP's unified functional testing.
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
 
Sqa, test scenarios and test cases
Sqa, test scenarios and test casesSqa, test scenarios and test cases
Sqa, test scenarios and test cases
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
 
Security testing presentation
Security testing presentationSecurity testing presentation
Security testing presentation
 
Ts seo t ech session
Ts   seo t ech sessionTs   seo t ech session
Ts seo t ech session
 
Learning as a creative professional
Learning as a creative professionalLearning as a creative professional
Learning as a creative professional
 
Learning as a creative professional
Learning as a creative professionalLearning as a creative professional
Learning as a creative professional
 
Ts archiving
Ts   archivingTs   archiving
Ts archiving
 
Advance text rendering in i os
Advance text rendering in i osAdvance text rendering in i os
Advance text rendering in i os
 
Ts threading
Ts   threadingTs   threading
Ts threading
 
Ts android supporting multiple screen
Ts   android supporting multiple screenTs   android supporting multiple screen
Ts android supporting multiple screen
 
Ts drupal6 module development v0.2
Ts   drupal6 module development v0.2Ts   drupal6 module development v0.2
Ts drupal6 module development v0.2
 
Photoshop manners
Photoshop mannersPhotoshop manners
Photoshop manners
 
Monkey talk
Monkey talkMonkey talk
Monkey talk
 
An insight to microsoft platform
An insight to microsoft platformAn insight to microsoft platform
An insight to microsoft platform
 
Ts branching over the top
Ts   branching over the topTs   branching over the top
Ts branching over the top
 

Kürzlich hochgeladen

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Kürzlich hochgeladen (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

Solid principles of oo design

  • 1. Boutique product development company It is amazing what you can accomplish when you have a client-centric team to deliver outstanding products.
  • 2. SOLID Principles of OO Design Waleed Bin Dawood | Software Engineer Boutique product development company It is amazing what you can accomplish when you have a client-centric team to deliver outstanding products.
  • 3. "Any fool can write code that a computer can understand. Good programmers write code that humans can understand" Martin Fowler SOLID Principles of Object Oriented Design ● ● ● ● Software design What makes a design good or bad ? Design/Code Smells SOLID Principles Waleed Bin Dawood | Software Engineer
  • 4. SOLID Principles What is software design ? • • • • The source code is the design UML diagram represents part of a design Software design process includes coding, testing, refactoring… The programmer is the actual software designer. Waleed Bin Dawood | Software Engineer
  • 5. SOLID Principles Why do we need a good design ? • • • To deliver fast To manage change easily To deal with complexity Waleed Bin Dawood | Software Engineer
  • 6. SOLID Principles How to identify a bad design ? “In my BillG review meeting, the whole reporting hierarchy was there...and a person...whose whole job during the meeting was to keep an accurate count of how many times Bill said the F word. The lower the f***-count, the better.” -- Joel Spolsky, My First BillG Review But may be we need some better criteria :) Waleed Bin Dawood | Software Engineer
  • 7. SOLID Principles How to identify a bad design ? Design/Code Smells ● Rigidity - The design is hard to change ● Fragility - The design is easy to break ● Immobility - The design is hard to reuse ● Viscosity - It is hard to do the right thing Waleed Bin Dawood | Software Engineer
  • 8. SOLID Principles Good design What are the characteristics of a good design ? ● High Cohesion ● Low Coupling How to achieve a good design ? Follow programming practices of your language/framework Follow OO design principles Use design patterns • • • Waleed Bin Dawood | Software Engineer
  • 9. SOLID Principles Let’s go SOLID Initial Stands for (acronym) Concept S SRP Single responsibility principle a class should have only a single responsibility. O OCP Open/closed principle “software entities … should be open for extension, but closed for modification”. L LSP Liskov substitution principle “objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program”. I ISP Interface segregation principle “many client-specific interfaces are better than one general-purpose interface.” D DIP Dependency inversion principle one should “Depend upon Abstractions. Do not depend upon concretions.” Waleed Bin Dawood | Software Engineer
  • 10. SOLID Principles Single Responsibility Principle • • • • “There should never be more than one reason for a class to change.” -- Robert Martin, SRP paper Easier : A class should concentrate on doing one thing and one thing only It give you high cohesion It’s often hard to identify different responsibilities Waleed Bin Dawood | Software Engineer
  • 11. SOLID Principles Single Responsibility Principle • • Is SRP violated here ? Two responsibilities: o Connection management o Data Communication Waleed Bin Dawood | Software Engineer
  • 12. SOLID Principles Single Responsibility Principle • • Solution : Two responsibilities: o Connection management o Data Communication Waleed Bin Dawood | Software Engineer
  • 13. SOLID Principles Open/Closed Principle • • • “Software entities should be open for extension, but closed for modification.” -- Robert Martin paraphrasing Bertrand Meyer, OCP Paper Easier : you should be able to extend the behaviour of a module without changing it Abstraction is the key Waleed Bin Dawood | Software Engineer
  • 14. SOLID Principles Open/Closed Principle • Is OCP violated here ? Waleed Bin Dawood | Software Engineer
  • 16. SOLID Principles Liskov Substitution Principle • • “Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.” -- Robert Martin, LSP Paper Easier : Subclasses should behave nicely when used in place of their parent class Waleed Bin Dawood | Software Engineer
  • 17. SOLID Principles Liskov Substitution Principle • • • • How would you model the relationship between a square and a rectangle ? Should the square class extends rectangle ? Many of you would say “yes” or “why not”. Square is a kind of Rectangle after all. An obvious IS-A relationship Issues in this Approach: o Square has unnecessary attribute ‘width’ o What happens when we want to calculate area ? o What happens if the client code is assuming height and width to be independent of each other Waleed Bin Dawood | Software Engineer
  • 18. SOLID Principles Dependency Inversion Principle • • “A. High level modules should not depend upon low level modules. Both should depend upon abstractions. B. Abstractions should not depend upon details. Details should depend upon abstractions.”-- Robert Martin, DIP paper Easier: o Use lot of interfaces (program to interface) o Use abstractions Waleed Bin Dawood | Software Engineer
  • 19. SOLID Principles Interface Segregation Principle • • “Clients should not be forced interfaces that they do not use.”-- Robert Martin, ISP paper Easier : avoid fat interfaces (cohesion) Waleed Bin Dawood | Software Engineer
  • 20. Human Computer Interaction Thank you for your time If you have any questions, please ask now or forever hold your peace Waleed Bin Dawood | Software Engineer