SlideShare a Scribd company logo
P R E S E N T E D B Y F A I Z A N H A I D E R
Design Principles to Design
Patterns
What are Design Principles
 Design principles are the desirable goals that one aims to
achieve. Design patterns are tools one can use to realize
those goals.
 It's therefore better to learn design principles first
because then you can easily understand what (and why)
a pattern is trying to achieve.
 Design principles are guidelines to be followed
throughout the software development process. Design
patterns are well accepted solutions to recurring design
problems.
 In other words: design patterns employ design
principles.
Why Use Design Principles?
 Avoid Bad Code like
 Rigidity - It is hard to change because every change
affects too many other parts of the system.
 Fragility - When you make a change, unexpected
parts of the system break.
 Immobility - It is hard to reuse in another
application because it cannot be disentangled from
the current application.
Some Desing Principles
 Open close Principle
 Dependency Inversion Principle
 Interface Segregation Principle
 Single Responsibility Principle
 Liskov's Substitution Principle
1. Open close Principle
 Software entities like classes, modules and functions
should be open for extension but closed for
modifications.
2. 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.
3. Interface Segregation Principle
 Clients should not be forced to depend upon
interfaces that they don't use.
 Avoid fat interfaces like if we code interface worker
then should keep in mind that all the workers like
worker, manager, director and robots would
implement that interface.
 Fat interfaces can be segregated using the Adapter
pattern.
 Instead of one fat interface use small ones with sub
tasks
4. Single Responsibility Principle
 A class should have only one reason to change.
5. Liskov's Substitution Principle
 Derived types must be completely substitutable for
their base types.
 Extension of the Open Close Principle in terms of
behavior meaning that we must make sure that new
derived classes are extending the base classes
without changing their behavior.
What are Design Patterns?
 Patterns focus on different types of
problems. Related patterns are grouped
together and assigned a type
 1. Creational Patterns
2. Structural Patterns
3. Behavioral Patterns
1. Creational Patterns
 All about the class instantiation
 Uses class-creation patterns and object-creational
patterns.
 Class-creation pattern uses inheritance effectively in the
instantiation process while object-creation pattern uses
delegation to get the job done
 1. Factory Pattern
 2. Abstract Factory Pattern
 3. Builder Pattern
 4. Prototype Pattern
 5. Singleton Pattern
2. Structural Patterns
 How objects and classes can be combined to form larger structures
 Class patterns describe abstraction using inheritance and
describe how it can be used to provide more useful program
interface.
 Object patterns describe how objects can be associated and
composed to form larger, more complex structures.
 1. Adapter Pattern
 2. Bridge Pattern
 3. Composite Pattern
 4. Decorator Pattern
 5. Facade Pattern
 6. Flyweight Pattern
 7. Proxy Pattern
3. Behavioral Patterns
 specifically concerned with communication (interaction) between the objects.
 Object communicating with each other and loosely coupled. The loose coupling is
the key to n-tier architectures
 The implementations and the client should be loosely coupled in order to avoid
hard-coding and dependencies.
 1. Chain of Resposibility Pattern
 2. Command Pattern
 3. Interpreter Pattern
 4. Iterator Pattern
 5. Mediator Pattern
 6. Momento Pattern
 7. Observer Pattern
 8. State Pattern
 9. Strategy Pattern
 10. Template Pattern
 11. Visitor Pattern
Conclusion
 Design principles represent a set of guidelines that
helps us to avoid having a bad design.
 While Design patterns are solution to specific
problems.
 We use Design patterns to implement a design
principle.
 If Design principles are End Game then Design
Patterns are the way to get There.

More Related Content

PPTX
Microservices Architecture
PPTX
UML and Software Modeling Tools.pptx
PDF
Machine Learning Using Cloud Services
DOCX
Online grocery store
PPTX
Distributed Computing system
DOC
online education system project report
PPT
Grid Computing
DOCX
Grade 7 Data Communication Lesson
Microservices Architecture
UML and Software Modeling Tools.pptx
Machine Learning Using Cloud Services
Online grocery store
Distributed Computing system
online education system project report
Grid Computing
Grade 7 Data Communication Lesson

What's hot (20)

PPT
Grid Computing
PPTX
Financial impact of Cloud Computing
PPTX
Cloud computing presentation
PPTX
Computer Science Career Guidance
PDF
Introducing Pair Programming
PPTX
Agile Methodology - Introduction
DOCX
Hostel management System PHP and MySQL Project.docx
PPTX
Prototyping
DOC
Inventory Managment
PPT
E commerce
PPTX
iOder (Food Ordering System)
DOC
School management System
PPTX
Software Project Management for 'Weather Forecasting using Data mining'
PPT
Lead Allocation System - Attribute Driven Design (ADD)
PPTX
Library Management system
PPT
User Interface Design Chapter 2 Galiz
PPT
Cluster Computing
RTF
Project report-on-student-information-management-system-php-mysql
PPTX
The Psychology of Human-Computer Interaction
DOCX
Online attendance management system
Grid Computing
Financial impact of Cloud Computing
Cloud computing presentation
Computer Science Career Guidance
Introducing Pair Programming
Agile Methodology - Introduction
Hostel management System PHP and MySQL Project.docx
Prototyping
Inventory Managment
E commerce
iOder (Food Ordering System)
School management System
Software Project Management for 'Weather Forecasting using Data mining'
Lead Allocation System - Attribute Driven Design (ADD)
Library Management system
User Interface Design Chapter 2 Galiz
Cluster Computing
Project report-on-student-information-management-system-php-mysql
The Psychology of Human-Computer Interaction
Online attendance management system
Ad

Viewers also liked (10)

PPTX
Rhythm
PPT
Principles Of Design
PDF
Principles of Design
PPT
Principles of Design
PPT
Principles of Design
PPS
Elements & Principles of Design
 
PPTX
Elements and Principles of Design
PPT
Principles Of Design
PDF
PDF
Basic design & visual arts (Elements of design)
Rhythm
Principles Of Design
Principles of Design
Principles of Design
Principles of Design
Elements & Principles of Design
 
Elements and Principles of Design
Principles Of Design
Basic design & visual arts (Elements of design)
Ad

Similar to Design Principles to design Patterns (20)

PPTX
Applying design patterns
PDF
The maze of Design Patterns & SOLID Principles
PPT
Introduction to design patterns
DOCX
Design pattern application
PPTX
Cs 1023 lec 9 design pattern (week 2)
PDF
Design Patterns
PPT
5 Design Patterns Explained
PPTX
System design process.pptx
PPTX
Final sdp ppt
PPTX
Some Cool Design Patterns, Practices, and Principles
PPTX
Design Patterns - General Introduction
PPTX
OOPSDesign PPT ( introduction to opps and design (
PPTX
Design patterns
PPTX
Design Patterns: From STUPID to SOLID code
PDF
software engineering Design Patterns.pdf
PPT
Daniel leon design principles in the functional world
PPTX
Design Pattern - Introduction
PPTX
Design Patterns- Course for students .pptx
PPTX
Sofwear deasign and need of design pattern
PDF
Benefits of using software design patterns and when to use design pattern
Applying design patterns
The maze of Design Patterns & SOLID Principles
Introduction to design patterns
Design pattern application
Cs 1023 lec 9 design pattern (week 2)
Design Patterns
5 Design Patterns Explained
System design process.pptx
Final sdp ppt
Some Cool Design Patterns, Practices, and Principles
Design Patterns - General Introduction
OOPSDesign PPT ( introduction to opps and design (
Design patterns
Design Patterns: From STUPID to SOLID code
software engineering Design Patterns.pdf
Daniel leon design principles in the functional world
Design Pattern - Introduction
Design Patterns- Course for students .pptx
Sofwear deasign and need of design pattern
Benefits of using software design patterns and when to use design pattern

Recently uploaded (20)

PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Basic Mud Logging Guide for educational purpose
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Lesson notes of climatology university.
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Complications of Minimal Access Surgery at WLH
PPTX
GDM (1) (1).pptx small presentation for students
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Pharma ospi slides which help in ospi learning
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Classroom Observation Tools for Teachers
PDF
Insiders guide to clinical Medicine.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Institutional Correction lecture only . . .
PPTX
master seminar digital applications in india
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Microbial diseases, their pathogenesis and prophylaxis
Basic Mud Logging Guide for educational purpose
Sports Quiz easy sports quiz sports quiz
Lesson notes of climatology university.
Module 4: Burden of Disease Tutorial Slides S2 2025
Complications of Minimal Access Surgery at WLH
GDM (1) (1).pptx small presentation for students
VCE English Exam - Section C Student Revision Booklet
Pharma ospi slides which help in ospi learning
O7-L3 Supply Chain Operations - ICLT Program
Classroom Observation Tools for Teachers
Insiders guide to clinical Medicine.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Anesthesia in Laparoscopic Surgery in India
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Institutional Correction lecture only . . .
master seminar digital applications in india

Design Principles to design Patterns

  • 1. P R E S E N T E D B Y F A I Z A N H A I D E R Design Principles to Design Patterns
  • 2. What are Design Principles  Design principles are the desirable goals that one aims to achieve. Design patterns are tools one can use to realize those goals.  It's therefore better to learn design principles first because then you can easily understand what (and why) a pattern is trying to achieve.  Design principles are guidelines to be followed throughout the software development process. Design patterns are well accepted solutions to recurring design problems.  In other words: design patterns employ design principles.
  • 3. Why Use Design Principles?  Avoid Bad Code like  Rigidity - It is hard to change because every change affects too many other parts of the system.  Fragility - When you make a change, unexpected parts of the system break.  Immobility - It is hard to reuse in another application because it cannot be disentangled from the current application.
  • 4. Some Desing Principles  Open close Principle  Dependency Inversion Principle  Interface Segregation Principle  Single Responsibility Principle  Liskov's Substitution Principle
  • 5. 1. Open close Principle  Software entities like classes, modules and functions should be open for extension but closed for modifications.
  • 6. 2. 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.
  • 7. 3. Interface Segregation Principle  Clients should not be forced to depend upon interfaces that they don't use.  Avoid fat interfaces like if we code interface worker then should keep in mind that all the workers like worker, manager, director and robots would implement that interface.  Fat interfaces can be segregated using the Adapter pattern.  Instead of one fat interface use small ones with sub tasks
  • 8. 4. Single Responsibility Principle  A class should have only one reason to change.
  • 9. 5. Liskov's Substitution Principle  Derived types must be completely substitutable for their base types.  Extension of the Open Close Principle in terms of behavior meaning that we must make sure that new derived classes are extending the base classes without changing their behavior.
  • 10. What are Design Patterns?  Patterns focus on different types of problems. Related patterns are grouped together and assigned a type  1. Creational Patterns 2. Structural Patterns 3. Behavioral Patterns
  • 11. 1. Creational Patterns  All about the class instantiation  Uses class-creation patterns and object-creational patterns.  Class-creation pattern uses inheritance effectively in the instantiation process while object-creation pattern uses delegation to get the job done  1. Factory Pattern  2. Abstract Factory Pattern  3. Builder Pattern  4. Prototype Pattern  5. Singleton Pattern
  • 12. 2. Structural Patterns  How objects and classes can be combined to form larger structures  Class patterns describe abstraction using inheritance and describe how it can be used to provide more useful program interface.  Object patterns describe how objects can be associated and composed to form larger, more complex structures.  1. Adapter Pattern  2. Bridge Pattern  3. Composite Pattern  4. Decorator Pattern  5. Facade Pattern  6. Flyweight Pattern  7. Proxy Pattern
  • 13. 3. Behavioral Patterns  specifically concerned with communication (interaction) between the objects.  Object communicating with each other and loosely coupled. The loose coupling is the key to n-tier architectures  The implementations and the client should be loosely coupled in order to avoid hard-coding and dependencies.  1. Chain of Resposibility Pattern  2. Command Pattern  3. Interpreter Pattern  4. Iterator Pattern  5. Mediator Pattern  6. Momento Pattern  7. Observer Pattern  8. State Pattern  9. Strategy Pattern  10. Template Pattern  11. Visitor Pattern
  • 14. Conclusion  Design principles represent a set of guidelines that helps us to avoid having a bad design.  While Design patterns are solution to specific problems.  We use Design patterns to implement a design principle.  If Design principles are End Game then Design Patterns are the way to get There.