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

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
 
Software architecture and software design
Software architecture and software designSoftware architecture and software design
Software architecture and software designMr. Swapnil G. Thaware
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design QuicklyMariam Hakobyan
 
Organization and team structures
Organization and team structuresOrganization and team structures
Organization and team structuresNur Islam
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software EngineeringManish Kumar
 
Software Engineering - Ch1
Software Engineering - Ch1Software Engineering - Ch1
Software Engineering - Ch1Siddharth Ayer
 
Design concept -Software Engineering
Design concept -Software EngineeringDesign concept -Software Engineering
Design concept -Software EngineeringVarsha Ajith
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and ModularityDanyal Ahmad
 
unit 5 Architectural design
 unit 5 Architectural design unit 5 Architectural design
unit 5 Architectural designdevika g
 
Software requirements engineering lecture 01
Software requirements engineering   lecture 01Software requirements engineering   lecture 01
Software requirements engineering lecture 01Abdul Basit
 
UML Class Diagram Notation
UML Class Diagram NotationUML Class Diagram Notation
UML Class Diagram Notationadnan12345678
 
User Interface Design in Software Engineering SE15
User Interface Design in Software Engineering SE15User Interface Design in Software Engineering SE15
User Interface Design in Software Engineering SE15koolkampus
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design patternMindfire Solutions
 
Introduction to Agile Software Development
Introduction to Agile Software DevelopmentIntroduction to Agile Software Development
Introduction to Agile Software DevelopmentLife Cycle Engineering
 

What's hot (20)

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
 
Software architecture and software design
Software architecture and software designSoftware architecture and software design
Software architecture and software design
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design Quickly
 
Organization and team structures
Organization and team structuresOrganization and team structures
Organization and team structures
 
Design Pattern in Software Engineering
Design Pattern in Software EngineeringDesign Pattern in Software Engineering
Design Pattern in Software Engineering
 
Software Engineering - Ch1
Software Engineering - Ch1Software Engineering - Ch1
Software Engineering - Ch1
 
Design concept -Software Engineering
Design concept -Software EngineeringDesign concept -Software Engineering
Design concept -Software Engineering
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and Modularity
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
unit 5 Architectural design
 unit 5 Architectural design unit 5 Architectural design
unit 5 Architectural design
 
4. ch 3-agile process
4. ch 3-agile process4. ch 3-agile process
4. ch 3-agile process
 
Software requirements engineering lecture 01
Software requirements engineering   lecture 01Software requirements engineering   lecture 01
Software requirements engineering lecture 01
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
UML Class Diagram Notation
UML Class Diagram NotationUML Class Diagram Notation
UML Class Diagram Notation
 
Requirements Engineering
Requirements EngineeringRequirements Engineering
Requirements Engineering
 
User Interface Design in Software Engineering SE15
User Interface Design in Software Engineering SE15User Interface Design in Software Engineering SE15
User Interface Design in Software Engineering SE15
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design pattern
 
Introduction to Agile Software Development
Introduction to Agile Software DevelopmentIntroduction to Agile Software Development
Introduction to Agile Software Development
 
Design Principles
Design PrinciplesDesign Principles
Design Principles
 

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

cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 
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
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
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
 
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
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 

Recently uploaded (20)

cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
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
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
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
 
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
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 

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