SlideShare a Scribd company logo
THINKING IN OBJECT-
ORIENTED
Sadad PSP, IT Dept
Winter-Spring 2019
SYMPTOMS OF ROTTING(POOR)
DESIGN
The design is hard to change.
The design is easy to break.
The design is hard to reuse.
It is hard to do the right thing.
Overdesign.
Mouse abuse.
Disorganized expression.
RIGIDITY
THE DESIGN IS HARD TO CHANGE
The system is hard to change because every change forces many
other changes to other parts of the system.
FRAGILITY
THE DESIGN IS EASY TO BREAK
Changes cause the system to break in places that have no conceptual
relationship to the part that was changed
IMMOBILITY
THE DESIGN IS HARD TO REUSE
It is hard to disentangle the system into components that can be
reused in other systems
VISCOSITY
IT IS HARD TO DO THE RIGHT THING
Doing things right is harder than doing things wrong. A viscous
project is a project in which the design of the software is hard to
preserve
viscosity of the software
viscosity of the environment
NEEDLESS COMPLEXITY
OVERDESIGN
The design contains infrastructure that adds no direct benefit
NEEDLESS REPETITION
MOUSE ABUSE
The design contains repeating structures that could be unified under
a single abstraction.
OPACITY
DISORGANIZED EXPRESSION
It is hard to read and understand. It does not express its intent well
REFACTORING
The process of changing a software system in such a way that it does
not alter the external behavior of the code yet improves its internal
structure. [Fowler]
NOTE: COUPLING
is a measure of how strongly one element is connected to,
has knowledge of or relies on other elements. A class with high (or
strong) coupling suffers from:
Changes in related classes force local changes.
Harder to understand in isolation.
Harder to reuse because its use requires the additional presence of
the classes on which it is dependent.
NOTE: COHESION
(or more specifically, functional cohesion) is a measure of
how strongly related and focused the responsibilities of an element
are. A class with low cohesion suffers from:
hard to comprehend
hard to reuse
hard to maintain
delicate; constantly effected by change
S.O.L.I.D
Single responsibility principle (SRP)
Open Closed Principle (OCP)
Liskov Substitution Principle (LSP)
Interface Segregation Principle (ISP)
Dependency Inversion Principle (DIP)
SRP: THE SINGLE-RESPONSIBILITY
PRINCIPLE
A class should have only one reason to change
It give you high cohesion
It’s often hard to identify different responsibilities
SRP PROBLEM EXAMPLE
Two responsibility:
Data management
Data presentation
SRP SOLUTION EXAMPLE
Tow responsibility:
Data management
Data representation
OCP: THE OPEN–CLOSED
PRINCIPLE
Software entities (classes, modules, functions, etc.) should be open
for extension, but closed for modification.
You should be able to extend the behavior of a module without
changing it
Abstraction is the key
LSP: THE LISKOV SUBSTITUTION
PRINCIPLE
Subtypes must be substitutable for their base types
ISP: THE INTERFACE-
SEGREGATION PRINCIPLE
Clients should not be forced to depend upon the interfaces that they
do not use.
DIP: THE DEPENDENCY-INVERSION
PRINCIPLE
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

More Related Content

Similar to Thinking in object oriented - Part 3

Solid Principles, for better cohesion and lower coupling
Solid Principles, for better cohesion and lower coupling Solid Principles, for better cohesion and lower coupling
Solid Principles, for better cohesion and lower coupling
Mohammad Shawahneh
 
OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
Anju Kanjirathingal
 
Software design principles for evolving architectures
Software design principles for evolving architecturesSoftware design principles for evolving architectures
Software design principles for evolving architectures
Firat Atagun
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
jinaldesailive
 
Clean code-v2.2
Clean code-v2.2Clean code-v2.2
Clean code-v2.2
Bình Trọng Án
 
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
SalesforceBY
 
How is repetition of components different from redundancy- How are the.docx
How is repetition of components different from redundancy- How are the.docxHow is repetition of components different from redundancy- How are the.docx
How is repetition of components different from redundancy- How are the.docx
cliftonl1
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
Ritu Mangla
 
Software design principles
Software design principlesSoftware design principles
Software design principles
Md.Mojibul Hoque
 
TEST PPT
TEST PPTTEST PPT
TEST PPT
berryzed
 
Object Interconnections
Object InterconnectionsObject Interconnections
Object Interconnections
adil raja
 
Design Principles to design Patterns
Design Principles to design PatternsDesign Principles to design Patterns
Design Principles to design Patterns
Faizan Haider
 
Agile design pattern
Agile design patternAgile design pattern
Agile design pattern
Poppy Martono
 
SOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User GroupSOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User Group
Adnan Masood
 
Geecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesGeecon09: SOLID Design Principles
Geecon09: SOLID Design Principles
Bruno Bossola
 
SOLID principles-Present
SOLID principles-PresentSOLID principles-Present
SOLID principles-PresentQuang Nguyen
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
Gaurav Mishra
 
SOLID Software Principles with C#
SOLID Software Principles with C#SOLID Software Principles with C#
SOLID Software Principles with C#
Ken Burkhardt
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and Patterns
Juan Lopez
 

Similar to Thinking in object oriented - Part 3 (20)

Solid Principles, for better cohesion and lower coupling
Solid Principles, for better cohesion and lower coupling Solid Principles, for better cohesion and lower coupling
Solid Principles, for better cohesion and lower coupling
 
OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
 
Software design principles for evolving architectures
Software design principles for evolving architecturesSoftware design principles for evolving architectures
Software design principles for evolving architectures
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
 
Clean code-v2.2
Clean code-v2.2Clean code-v2.2
Clean code-v2.2
 
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
 
How is repetition of components different from redundancy- How are the.docx
How is repetition of components different from redundancy- How are the.docxHow is repetition of components different from redundancy- How are the.docx
How is repetition of components different from redundancy- How are the.docx
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
TEST PPT
TEST PPTTEST PPT
TEST PPT
 
Object Interconnections
Object InterconnectionsObject Interconnections
Object Interconnections
 
Design Principles to design Patterns
Design Principles to design PatternsDesign Principles to design Patterns
Design Principles to design Patterns
 
Agile design pattern
Agile design patternAgile design pattern
Agile design pattern
 
SOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User GroupSOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User Group
 
Geecon09: SOLID Design Principles
Geecon09: SOLID Design PrinciplesGeecon09: SOLID Design Principles
Geecon09: SOLID Design Principles
 
SOLID principles-Present
SOLID principles-PresentSOLID principles-Present
SOLID principles-Present
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Design perfume
Design perfumeDesign perfume
Design perfume
 
SOLID Software Principles with C#
SOLID Software Principles with C#SOLID Software Principles with C#
SOLID Software Principles with C#
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and Patterns
 

Recently uploaded

A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 

Recently uploaded (20)

A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 

Thinking in object oriented - Part 3

  • 1. THINKING IN OBJECT- ORIENTED Sadad PSP, IT Dept Winter-Spring 2019
  • 2. SYMPTOMS OF ROTTING(POOR) DESIGN The design is hard to change. The design is easy to break. The design is hard to reuse. It is hard to do the right thing. Overdesign. Mouse abuse. Disorganized expression.
  • 3. RIGIDITY THE DESIGN IS HARD TO CHANGE The system is hard to change because every change forces many other changes to other parts of the system.
  • 4. FRAGILITY THE DESIGN IS EASY TO BREAK Changes cause the system to break in places that have no conceptual relationship to the part that was changed
  • 5. IMMOBILITY THE DESIGN IS HARD TO REUSE It is hard to disentangle the system into components that can be reused in other systems
  • 6. VISCOSITY IT IS HARD TO DO THE RIGHT THING Doing things right is harder than doing things wrong. A viscous project is a project in which the design of the software is hard to preserve viscosity of the software viscosity of the environment
  • 7. NEEDLESS COMPLEXITY OVERDESIGN The design contains infrastructure that adds no direct benefit
  • 8. NEEDLESS REPETITION MOUSE ABUSE The design contains repeating structures that could be unified under a single abstraction.
  • 9. OPACITY DISORGANIZED EXPRESSION It is hard to read and understand. It does not express its intent well
  • 10. REFACTORING The process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure. [Fowler]
  • 11. NOTE: COUPLING is a measure of how strongly one element is connected to, has knowledge of or relies on other elements. A class with high (or strong) coupling suffers from: Changes in related classes force local changes. Harder to understand in isolation. Harder to reuse because its use requires the additional presence of the classes on which it is dependent.
  • 12. NOTE: COHESION (or more specifically, functional cohesion) is a measure of how strongly related and focused the responsibilities of an element are. A class with low cohesion suffers from: hard to comprehend hard to reuse hard to maintain delicate; constantly effected by change
  • 13. S.O.L.I.D Single responsibility principle (SRP) Open Closed Principle (OCP) Liskov Substitution Principle (LSP) Interface Segregation Principle (ISP) Dependency Inversion Principle (DIP)
  • 14. SRP: THE SINGLE-RESPONSIBILITY PRINCIPLE A class should have only one reason to change It give you high cohesion It’s often hard to identify different responsibilities
  • 15. SRP PROBLEM EXAMPLE Two responsibility: Data management Data presentation
  • 16. SRP SOLUTION EXAMPLE Tow responsibility: Data management Data representation
  • 17. OCP: THE OPEN–CLOSED PRINCIPLE Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. You should be able to extend the behavior of a module without changing it Abstraction is the key
  • 18. LSP: THE LISKOV SUBSTITUTION PRINCIPLE Subtypes must be substitutable for their base types
  • 19. ISP: THE INTERFACE- SEGREGATION PRINCIPLE Clients should not be forced to depend upon the interfaces that they do not use.
  • 20. DIP: THE DEPENDENCY-INVERSION PRINCIPLE 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

Editor's Notes

  1. Rigidity is the tendency for software to be difficult to change, even in simple ways A single change causes a cascade of subsequent changes in dependent modules
  2. Fragility is the tendency of a program to break in many places when a single change is made