SlideShare a Scribd company logo
1 of 36
Software Design Principles
Software design principles represent a set of
guidelines that helps us to avoid having a bad design
Why Design?
 Manage complexity of a system
 Improve software quality factors
 Manage changes easily with
minimum cost
 Facilitate reusability
Abstract Design Guideline
High Cohesion
Low Coupling
Art of Unix Programming
 Rule of Clarity: Clarity is better than
cleverness.
 Rule of Composition: Design programs to
be connected to other programs.
 Rule of Separation: Separate policy from
mechanism; separate interfaces from
engines
 Rule of Simplicity: Design for simplicity;
add complexity only where you must
Art of Unix Programming
 Rule of Transparency: Design for visibility to
make inspection and debugging easier
 Rule of Robustness: Robustness is the child
of transparency and simplicity
 Rule of Least Surprise: In interface design,
always do the least surprising thing
 Rule of Silence: When a program has
nothing surprising to say, it should say
nothing
Art of Unix Programming
 Rule of Repair: When you must fail, fail noisily
and as soon as possible
 Rule of Economy: Programmer time is
expensive; conserve it in preference to
machine time
 Rule of Optimization: Prototype before
polishing. Get it working before you optimize
it
 Rule of Extensibility: Design for the future,
because it will be here sooner than you think
Symptoms of Rotting Design
Rigidity
Fragility
Immobility
Viscosity
Rigidity
• Difficult to change
• Ripple Effect
• Entering roach motel
A software can be called a
rigid when it is difficult to
change even in a sample
way
When the manager’s fears become so acute that they refuse to allow changes to
software, official rigidity sets in. Thus, what starts as a design deficiency, winds
up being adverse management policy.
Fragility
• Conceptually irrelevant pieces
breaking in multiple places
• Such software is impossible to
maintain. Every fix makes it
worse, introducing more
problems than are solved
• Managers and Customers have
a feeling that Developers have
lost control over the project
Closely related to rigidity is
fragility. Fragility is the tendency
of the software to break in
many places every time it is
changed. Often the breakage
occurs in areas that have no
conceptual relationship with the
area that was changed
Immobility
• Inability to reuse
software
• Software is simply
rewritten instead of
reused
Immobility is the inability to
reuse software from other
projects or from parts of the
same project. It often happens
that one engineer will discover
that he needs a module that is
similar to one that another
engineer wrote
I am asking for someone NOT everyone
Viscosity
• It is easy to do the wrong thing, but
hard to do the right thing
• When the design preserving
methods are harder to employ
than the hacks, then the viscosity
of the design is high
• Viscosity of environment comes
about when the development
environment is slow and inefficient
These four symptoms are the tell-tale signs of
poor architecture. Any application that
exhibits them is suffering from a design that is
rotting from the inside out. But what causes
that rot to take place?
 Changing Requirements
 Changing Technologies
 Human Error
 Dependency Management
OO Design Principles
• Single Responsibility Principle (SRP)
• Open Closed Principle (OCP)
• Liskov Substitution Principle (LSP)
• Interface Segregation Principle (ISP)
• Dependency Inversion Principle (DIP)
• Tell Don’t Ask
• DRY – Don’t Repeat yourself
• Once and only once
• The Law of Demeter
• Package Principles
• DRY
• YAGNI
Single Responsibility Principle (SRP)
There should never be more than
one reason for a class to change.
SRP (Cont’d)
SRP (Cont’d)
Open Closed Principle (OCP)
• A module should be
open for extension but
closed for modification
OCP (Cont’d)
OCP (Cont’d)
Liskov Substitution Principle (LSP)
• Subclasses should be
substitutable for their
base classes.
LSP (Cont’d)
Interface Segregation Principle (ISP)
• Many client specific
interfaces are better
than one general
purpose interface
ISP (Cont’d)
Dependency Inversion Principle (DIP)
• Depend upon
Abstractions. Do not
depend upon
concretions
DIP (Cont’d)
DIP (Cont’d)
Tell Don’t Ask
• Don't call us we will call you
• Hollywood Principle
Tell Don’t Ask (Cont’d)
if(getStateOfSomething())
doThis();
else
doThat();
object.doSomethingForMe();
V/S
DRY – Don’t Repeat yourself
Once
and only
once
Every piece of knowledge must
have a single, unambiguous,
authoritative representation
within a system
Refactoring has as a primary objective
getting each piece of functionality to
exist in exactly one place in the software.
–Ron Jeffries
The Law of Demeter
• Any method of an object should only call
methods belonging to:
– itself
– any composite objects
– any parameters that were passed in to the
method
– any objects it created
Train Wreck?
• Methods belonging to
objects that were returned
from some other call.
my_television.front_panel.swit
ches.power.on();
v/s
my_television.power_up();
• Talk only to your neighbors,
not with their neighbors.
YAGNI (You ain’t gonna need it)
"Always implement things when
you actually need them, never
when you just foresee that you
need them.” – Ron Jeffries
The need for combining it with
the supporting practices, rather
than using it standalone
Package Principles
 Cohesion Principles
 Coupling Principles
Package Cohesion Principles
Classes are a necessary, but
insufficient, means of
organizing a design. The larger
granularity of packages are
needed to help bring order. But
how do we choose which
classes belong in which
packages. There are three
principles known as the
Package Cohesion Principles,
that attempt to help the
software architect.
 Release Reuse Equivalency
Principle (REP)
- The granule of reuse is the granule
of release.
 Common Closure Principle (CCP)
- Classes that change together,
belong together.
 Common Reuse Principle (CRP)
- Classes that aren’t reused together
should not be grouped together.
Package Coupling Principles
three packages govern the
interrelationships between
packages. Applications
tend to be large networks
of interrelated packages.
The rules that govern these
interrelationship are some
of the most important
rules in object oriented
architecture.
 Acyclic Dependencies Principle
(ADP)
-The dependencies between
packages must not form cycles.
 Stable Dependencies Principle
(SDP)
- Depend in the direction of stability.
 Stable Abstractions Principle
(SAP)
- Stable packages should be abstract
packages.
DIP IoC DI & Factory Pattern
• Dependency Injection Principle
• Inversion of Control
• Dependency Injection
• Practice: Information retrieving from several
file types. By applying DIP, IoC, DI and Factory
Pattern

More Related Content

What's hot

ScrumOps - Scrum + Practical DevOps
ScrumOps - Scrum + Practical DevOpsScrumOps - Scrum + Practical DevOps
ScrumOps - Scrum + Practical DevOpsNaveen Kumar Singh
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitWeaveworks
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesAmazon Web Services
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignRyan Riley
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes waysparkfabrik
 
GIT presentation
GIT presentationGIT presentation
GIT presentationNaim Latifi
 
Fundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDFundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDBatyr Nuryyev
 
Gitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operationsGitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operationsMariano Cunietti
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes VMware Tanzu
 
extreme Programming
extreme Programmingextreme Programming
extreme ProgrammingBilal Shah
 
Modern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOpsModern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOpsGlobalLogic Ukraine
 
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-designOliver Cheng
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationOğuzhan Soykan
 
RHEL8 Kernel Management Manual in Korean
RHEL8 Kernel Management Manual in KoreanRHEL8 Kernel Management Manual in Korean
RHEL8 Kernel Management Manual in KoreanJun Hee Shin
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICDKnoldus Inc.
 

What's hot (20)

ScrumOps - Scrum + Practical DevOps
ScrumOps - Scrum + Practical DevOpsScrumOps - Scrum + Practical DevOps
ScrumOps - Scrum + Practical DevOps
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 
Software design
Software designSoftware design
Software design
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
DevOps Overview
DevOps OverviewDevOps Overview
DevOps Overview
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 
GIT presentation
GIT presentationGIT presentation
GIT presentation
 
Fundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDFundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CD
 
Gitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operationsGitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operations
 
Software design
Software designSoftware design
Software design
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes
 
extreme Programming
extreme Programmingextreme Programming
extreme Programming
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Modern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOpsModern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOps
 
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-design
 
Domain Driven Design(DDD) Presentation
Domain Driven Design(DDD) PresentationDomain Driven Design(DDD) Presentation
Domain Driven Design(DDD) Presentation
 
RHEL8 Kernel Management Manual in Korean
RHEL8 Kernel Management Manual in KoreanRHEL8 Kernel Management Manual in Korean
RHEL8 Kernel Management Manual in Korean
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICD
 

Viewers also liked

software design principles
software design principlessoftware design principles
software design principlesCristal Ngo
 
Design concepts and principles
Design concepts and principlesDesign concepts and principles
Design concepts and principlessaurabhshertukde
 
Applying software design principles in practice
Applying software design principles in practiceApplying software design principles in practice
Applying software design principles in practiceGanesh Samarthyam
 
Software design principles
Software design principlesSoftware design principles
Software design principlesRitesh Singh
 
Goals Of Software Design - The main goals
Goals Of Software Design - The main goalsGoals Of Software Design - The main goals
Goals Of Software Design - The main goalsparag
 
Six Principles of Software Design to Empower Scientists
Six Principles of Software Design to Empower ScientistsSix Principles of Software Design to Empower Scientists
Six Principles of Software Design to Empower ScientistsDavid De Roure
 
Software design principles for evolving architectures
Software design principles for evolving architecturesSoftware design principles for evolving architectures
Software design principles for evolving architecturesFirat Atagun
 
Chapter 4 software design
Chapter 4  software designChapter 4  software design
Chapter 4 software designCliftone Mullah
 
The Role of Enterprise Integration in Digital Transformation
The Role of Enterprise Integration in Digital TransformationThe Role of Enterprise Integration in Digital Transformation
The Role of Enterprise Integration in Digital TransformationKasun Indrasiri
 
Chapter 5 software design
Chapter 5 software designChapter 5 software design
Chapter 5 software designPiyush Gogia
 

Viewers also liked (13)

software design principles
software design principlessoftware design principles
software design principles
 
Design concepts and principles
Design concepts and principlesDesign concepts and principles
Design concepts and principles
 
Applying software design principles in practice
Applying software design principles in practiceApplying software design principles in practice
Applying software design principles in practice
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
Goals Of Software Design - The main goals
Goals Of Software Design - The main goalsGoals Of Software Design - The main goals
Goals Of Software Design - The main goals
 
Six Principles of Software Design to Empower Scientists
Six Principles of Software Design to Empower ScientistsSix Principles of Software Design to Empower Scientists
Six Principles of Software Design to Empower Scientists
 
Software design principles for evolving architectures
Software design principles for evolving architecturesSoftware design principles for evolving architectures
Software design principles for evolving architectures
 
Chapter 4 software design
Chapter 4  software designChapter 4  software design
Chapter 4 software design
 
Software Design Concepts
Software Design ConceptsSoftware Design Concepts
Software Design Concepts
 
The Role of Enterprise Integration in Digital Transformation
The Role of Enterprise Integration in Digital TransformationThe Role of Enterprise Integration in Digital Transformation
The Role of Enterprise Integration in Digital Transformation
 
Codesmells for AspectJ
Codesmells for AspectJCodesmells for AspectJ
Codesmells for AspectJ
 
Chapter 5 software design
Chapter 5 software designChapter 5 software design
Chapter 5 software design
 
Software design
Software designSoftware design
Software design
 

Similar to Software design principles

DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsBasavaraj Patil
 
Improving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesImproving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesDr. Syed Hassan Amin
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design PrinciplesSteve Zhang
 
The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practicesBill Buchan
 
Evgeniy Khyst - why does software design matter and how to keep it in good shape
Evgeniy Khyst - why does software design matter and how to keep it in good shapeEvgeniy Khyst - why does software design matter and how to keep it in good shape
Evgeniy Khyst - why does software design matter and how to keep it in good shapeAnna Shymchenko
 
Software development philosophies v1
Software development philosophies v1Software development philosophies v1
Software development philosophies v1Praveen Nair
 
Agile design pattern
Agile design patternAgile design pattern
Agile design patternPoppy Martono
 
Are You a SOLID Coder?
Are You a SOLID Coder?Are You a SOLID Coder?
Are You a SOLID Coder?Steve Green
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship ChecklistRyan Polk
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionKnoldus Inc.
 
Clean Code .Net Cheetsheets
Clean Code .Net CheetsheetsClean Code .Net Cheetsheets
Clean Code .Net CheetsheetsNikitaGoncharuk1
 
Segue to design patterns
Segue to design patternsSegue to design patterns
Segue to design patternsRahul Singh
 
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
 
Digests for the book "Scalability Rules: 50 Principles for Scaling Web Sites"
Digests for the book "Scalability Rules: 50 Principles for Scaling Web Sites"Digests for the book "Scalability Rules: 50 Principles for Scaling Web Sites"
Digests for the book "Scalability Rules: 50 Principles for Scaling Web Sites"Cyril Wang
 
Modern Software Architecture
Modern Software Architecture Modern Software Architecture
Modern Software Architecture Ahmed Marzouk
 

Similar to Software design principles (20)

DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
 
Improving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design PrinciplesImproving Software Quality Using Object Oriented Design Principles
Improving Software Quality Using Object Oriented Design Principles
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design Principles
 
Code quality
Code quality Code quality
Code quality
 
The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practices
 
Evgeniy Khyst - why does software design matter and how to keep it in good shape
Evgeniy Khyst - why does software design matter and how to keep it in good shapeEvgeniy Khyst - why does software design matter and how to keep it in good shape
Evgeniy Khyst - why does software design matter and how to keep it in good shape
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Software development philosophies v1
Software development philosophies v1Software development philosophies v1
Software development philosophies v1
 
Agile design pattern
Agile design patternAgile design pattern
Agile design pattern
 
android principle.pptx
android principle.pptxandroid principle.pptx
android principle.pptx
 
Soild principles
Soild principlesSoild principles
Soild principles
 
Are You a SOLID Coder?
Are You a SOLID Coder?Are You a SOLID Coder?
Are You a SOLID Coder?
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship Checklist
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
 
Clean Code .Net Cheetsheets
Clean Code .Net CheetsheetsClean Code .Net Cheetsheets
Clean Code .Net Cheetsheets
 
Segue to design patterns
Segue to design patternsSegue to design patterns
Segue to design patterns
 
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
 
Software development fundamentals
Software development fundamentalsSoftware development fundamentals
Software development fundamentals
 
Digests for the book "Scalability Rules: 50 Principles for Scaling Web Sites"
Digests for the book "Scalability Rules: 50 Principles for Scaling Web Sites"Digests for the book "Scalability Rules: 50 Principles for Scaling Web Sites"
Digests for the book "Scalability Rules: 50 Principles for Scaling Web Sites"
 
Modern Software Architecture
Modern Software Architecture Modern Software Architecture
Modern Software Architecture
 

More from Md.Mojibul Hoque

More from Md.Mojibul Hoque (11)

Facebook Marketing
Facebook Marketing Facebook Marketing
Facebook Marketing
 
Surela
SurelaSurela
Surela
 
Harvard University database
Harvard University databaseHarvard University database
Harvard University database
 
Business level strategy
Business level strategyBusiness level strategy
Business level strategy
 
Establishing objectives
Establishing objectivesEstablishing objectives
Establishing objectives
 
Value chain and SWOT analysis
Value chain and SWOT analysisValue chain and SWOT analysis
Value chain and SWOT analysis
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 
University Student Payment System ( USPS )
University Student Payment System ( USPS )University Student Payment System ( USPS )
University Student Payment System ( USPS )
 
Code smells and remedies
Code smells and remediesCode smells and remedies
Code smells and remedies
 
Writing a research report
Writing a research reportWriting a research report
Writing a research report
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 

Recently uploaded

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 

Recently uploaded (20)

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 

Software design principles

  • 1. Software Design Principles Software design principles represent a set of guidelines that helps us to avoid having a bad design
  • 2. Why Design?  Manage complexity of a system  Improve software quality factors  Manage changes easily with minimum cost  Facilitate reusability
  • 3. Abstract Design Guideline High Cohesion Low Coupling
  • 4. Art of Unix Programming  Rule of Clarity: Clarity is better than cleverness.  Rule of Composition: Design programs to be connected to other programs.  Rule of Separation: Separate policy from mechanism; separate interfaces from engines  Rule of Simplicity: Design for simplicity; add complexity only where you must
  • 5. Art of Unix Programming  Rule of Transparency: Design for visibility to make inspection and debugging easier  Rule of Robustness: Robustness is the child of transparency and simplicity  Rule of Least Surprise: In interface design, always do the least surprising thing  Rule of Silence: When a program has nothing surprising to say, it should say nothing
  • 6. Art of Unix Programming  Rule of Repair: When you must fail, fail noisily and as soon as possible  Rule of Economy: Programmer time is expensive; conserve it in preference to machine time  Rule of Optimization: Prototype before polishing. Get it working before you optimize it  Rule of Extensibility: Design for the future, because it will be here sooner than you think
  • 7. Symptoms of Rotting Design Rigidity Fragility Immobility Viscosity
  • 8. Rigidity • Difficult to change • Ripple Effect • Entering roach motel A software can be called a rigid when it is difficult to change even in a sample way When the manager’s fears become so acute that they refuse to allow changes to software, official rigidity sets in. Thus, what starts as a design deficiency, winds up being adverse management policy.
  • 9. Fragility • Conceptually irrelevant pieces breaking in multiple places • Such software is impossible to maintain. Every fix makes it worse, introducing more problems than are solved • Managers and Customers have a feeling that Developers have lost control over the project Closely related to rigidity is fragility. Fragility is the tendency of the software to break in many places every time it is changed. Often the breakage occurs in areas that have no conceptual relationship with the area that was changed
  • 10. Immobility • Inability to reuse software • Software is simply rewritten instead of reused Immobility is the inability to reuse software from other projects or from parts of the same project. It often happens that one engineer will discover that he needs a module that is similar to one that another engineer wrote I am asking for someone NOT everyone
  • 11. Viscosity • It is easy to do the wrong thing, but hard to do the right thing • When the design preserving methods are harder to employ than the hacks, then the viscosity of the design is high • Viscosity of environment comes about when the development environment is slow and inefficient
  • 12. These four symptoms are the tell-tale signs of poor architecture. Any application that exhibits them is suffering from a design that is rotting from the inside out. But what causes that rot to take place?  Changing Requirements  Changing Technologies  Human Error  Dependency Management
  • 13. OO Design Principles • Single Responsibility Principle (SRP) • Open Closed Principle (OCP) • Liskov Substitution Principle (LSP) • Interface Segregation Principle (ISP) • Dependency Inversion Principle (DIP) • Tell Don’t Ask • DRY – Don’t Repeat yourself • Once and only once • The Law of Demeter • Package Principles • DRY • YAGNI
  • 14. Single Responsibility Principle (SRP) There should never be more than one reason for a class to change.
  • 17. Open Closed Principle (OCP) • A module should be open for extension but closed for modification
  • 20. Liskov Substitution Principle (LSP) • Subclasses should be substitutable for their base classes.
  • 22. Interface Segregation Principle (ISP) • Many client specific interfaces are better than one general purpose interface
  • 24. Dependency Inversion Principle (DIP) • Depend upon Abstractions. Do not depend upon concretions
  • 27. Tell Don’t Ask • Don't call us we will call you • Hollywood Principle
  • 28. Tell Don’t Ask (Cont’d) if(getStateOfSomething()) doThis(); else doThat(); object.doSomethingForMe(); V/S
  • 29. DRY – Don’t Repeat yourself Once and only once Every piece of knowledge must have a single, unambiguous, authoritative representation within a system Refactoring has as a primary objective getting each piece of functionality to exist in exactly one place in the software. –Ron Jeffries
  • 30. The Law of Demeter • Any method of an object should only call methods belonging to: – itself – any composite objects – any parameters that were passed in to the method – any objects it created
  • 31. Train Wreck? • Methods belonging to objects that were returned from some other call. my_television.front_panel.swit ches.power.on(); v/s my_television.power_up(); • Talk only to your neighbors, not with their neighbors.
  • 32. YAGNI (You ain’t gonna need it) "Always implement things when you actually need them, never when you just foresee that you need them.” – Ron Jeffries The need for combining it with the supporting practices, rather than using it standalone
  • 33. Package Principles  Cohesion Principles  Coupling Principles
  • 34. Package Cohesion Principles Classes are a necessary, but insufficient, means of organizing a design. The larger granularity of packages are needed to help bring order. But how do we choose which classes belong in which packages. There are three principles known as the Package Cohesion Principles, that attempt to help the software architect.  Release Reuse Equivalency Principle (REP) - The granule of reuse is the granule of release.  Common Closure Principle (CCP) - Classes that change together, belong together.  Common Reuse Principle (CRP) - Classes that aren’t reused together should not be grouped together.
  • 35. Package Coupling Principles three packages govern the interrelationships between packages. Applications tend to be large networks of interrelated packages. The rules that govern these interrelationship are some of the most important rules in object oriented architecture.  Acyclic Dependencies Principle (ADP) -The dependencies between packages must not form cycles.  Stable Dependencies Principle (SDP) - Depend in the direction of stability.  Stable Abstractions Principle (SAP) - Stable packages should be abstract packages.
  • 36. DIP IoC DI & Factory Pattern • Dependency Injection Principle • Inversion of Control • Dependency Injection • Practice: Information retrieving from several file types. By applying DIP, IoC, DI and Factory Pattern