SlideShare uma empresa Scribd logo
1 de 14
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.

Mais conteúdo relacionado

Mais procurados

Software Architecture Design for Begginers
Software Architecture Design for BegginersSoftware Architecture Design for Begginers
Software Architecture Design for BegginersChinh Ngo Nguyen
 
System Integration PowerPoint Presentation Slides
System Integration PowerPoint Presentation Slides System Integration PowerPoint Presentation Slides
System Integration PowerPoint Presentation Slides SlideTeam
 
Architecture Series 5-5 Effective Enterprise Architecture Action Plan
Architecture Series 5-5   Effective Enterprise Architecture Action PlanArchitecture Series 5-5   Effective Enterprise Architecture Action Plan
Architecture Series 5-5 Effective Enterprise Architecture Action PlanFrankie Hsiang
 
An Introduction to Software Architecture
An Introduction to Software ArchitectureAn Introduction to Software Architecture
An Introduction to Software ArchitectureRahimLotfi
 
Oracle Application Developmenr Framework
Oracle Application Developmenr FrameworkOracle Application Developmenr Framework
Oracle Application Developmenr FrameworkGurpreet singh
 
CMMI-DEV 1.3 Tool (checklist)
CMMI-DEV 1.3 Tool (checklist)CMMI-DEV 1.3 Tool (checklist)
CMMI-DEV 1.3 Tool (checklist)Robert Levy
 
Architectural structures and views
Architectural structures and viewsArchitectural structures and views
Architectural structures and viewsDr Reeja S R
 
IT Infrastructure Managed Services and RIMS
IT Infrastructure Managed Services and RIMSIT Infrastructure Managed Services and RIMS
IT Infrastructure Managed Services and RIMSRazak Mohammed Ali
 
Togaf 9.1 ADM summary
Togaf 9.1 ADM summaryTogaf 9.1 ADM summary
Togaf 9.1 ADM summaryMarco Bakker
 
Enterprise Architecture - TOGAF Overview
Enterprise Architecture - TOGAF OverviewEnterprise Architecture - TOGAF Overview
Enterprise Architecture - TOGAF OverviewMohamed Sami El-Tahawy
 
Architecture Design
Architecture DesignArchitecture Design
Architecture DesignSaqib Raza
 
Data Migration Strategies PowerPoint Presentation Slides
Data Migration Strategies PowerPoint Presentation SlidesData Migration Strategies PowerPoint Presentation Slides
Data Migration Strategies PowerPoint Presentation SlidesSlideTeam
 
Architectural Design
Architectural DesignArchitectural Design
Architectural DesignJay Thakkar
 
Aligning The Business Model to Technology Landscapes Enterprise Systems Arch...
Aligning The Business Model to  Technology Landscapes Enterprise Systems Arch...Aligning The Business Model to  Technology Landscapes Enterprise Systems Arch...
Aligning The Business Model to Technology Landscapes Enterprise Systems Arch...Daljit Banger
 

Mais procurados (20)

Software Architecture Design for Begginers
Software Architecture Design for BegginersSoftware Architecture Design for Begginers
Software Architecture Design for Begginers
 
System Integration PowerPoint Presentation Slides
System Integration PowerPoint Presentation Slides System Integration PowerPoint Presentation Slides
System Integration PowerPoint Presentation Slides
 
Architecture Series 5-5 Effective Enterprise Architecture Action Plan
Architecture Series 5-5   Effective Enterprise Architecture Action PlanArchitecture Series 5-5   Effective Enterprise Architecture Action Plan
Architecture Series 5-5 Effective Enterprise Architecture Action Plan
 
Software design
Software designSoftware design
Software design
 
An Introduction to Software Architecture
An Introduction to Software ArchitectureAn Introduction to Software Architecture
An Introduction to Software Architecture
 
Oracle Application Developmenr Framework
Oracle Application Developmenr FrameworkOracle Application Developmenr Framework
Oracle Application Developmenr Framework
 
Project managemen concept
Project managemen conceptProject managemen concept
Project managemen concept
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
CMMI-DEV 1.3 Tool (checklist)
CMMI-DEV 1.3 Tool (checklist)CMMI-DEV 1.3 Tool (checklist)
CMMI-DEV 1.3 Tool (checklist)
 
Architectural structures and views
Architectural structures and viewsArchitectural structures and views
Architectural structures and views
 
IT Infrastructure Managed Services and RIMS
IT Infrastructure Managed Services and RIMSIT Infrastructure Managed Services and RIMS
IT Infrastructure Managed Services and RIMS
 
Togaf 9.1 ADM summary
Togaf 9.1 ADM summaryTogaf 9.1 ADM summary
Togaf 9.1 ADM summary
 
Enterprise Architecture - TOGAF Overview
Enterprise Architecture - TOGAF OverviewEnterprise Architecture - TOGAF Overview
Enterprise Architecture - TOGAF Overview
 
MAPPING TOGAF® ADM AND AGILE APPROACH
MAPPING TOGAF® ADM AND AGILE APPROACHMAPPING TOGAF® ADM AND AGILE APPROACH
MAPPING TOGAF® ADM AND AGILE APPROACH
 
Architecture Design
Architecture DesignArchitecture Design
Architecture Design
 
EAI example
EAI exampleEAI example
EAI example
 
Data Migration Strategies PowerPoint Presentation Slides
Data Migration Strategies PowerPoint Presentation SlidesData Migration Strategies PowerPoint Presentation Slides
Data Migration Strategies PowerPoint Presentation Slides
 
Architectural Design
Architectural DesignArchitectural Design
Architectural Design
 
Uml Diagrams
Uml DiagramsUml Diagrams
Uml Diagrams
 
Aligning The Business Model to Technology Landscapes Enterprise Systems Arch...
Aligning The Business Model to  Technology Landscapes Enterprise Systems Arch...Aligning The Business Model to  Technology Landscapes Enterprise Systems Arch...
Aligning The Business Model to Technology Landscapes Enterprise Systems Arch...
 

Destaque

Principles Of Design
Principles Of DesignPrinciples Of Design
Principles Of Designkjera
 
Principles of Design
Principles of DesignPrinciples of Design
Principles of DesignGary Freeman
 
Principles of Design
Principles of DesignPrinciples of Design
Principles of Designerinsmith.art
 
Elements & Principles of Design
Elements & Principles of DesignElements & Principles of Design
Elements & Principles of DesignZ M
 
Elements and Principles of Design
Elements and Principles of DesignElements and Principles of Design
Elements and Principles of DesignRavi Bhadauria
 
Principles Of Design
Principles Of  DesignPrinciples Of  Design
Principles Of Designguestd654d6
 
Basic design & visual arts (Elements of design)
Basic design & visual arts (Elements of design)Basic design & visual arts (Elements of design)
Basic design & visual arts (Elements of design)Ar.Shakti Nanda
 

Destaque (10)

Rhythm
RhythmRhythm
Rhythm
 
Principles Of Design
Principles Of DesignPrinciples Of Design
Principles Of Design
 
Principles of Design
Principles of DesignPrinciples of Design
Principles of Design
 
Principles of Design
Principles of DesignPrinciples of Design
Principles of Design
 
Principles of Design
Principles of DesignPrinciples of Design
Principles of Design
 
Elements & Principles of Design
Elements & Principles of DesignElements & Principles of Design
Elements & Principles of Design
 
Elements and Principles of Design
Elements and Principles of DesignElements and Principles of Design
Elements and Principles of Design
 
Principles Of Design
Principles Of  DesignPrinciples Of  Design
Principles Of Design
 
Principles of design
Principles of designPrinciples of design
Principles of design
 
Basic design & visual arts (Elements of design)
Basic design & visual arts (Elements of design)Basic design & visual arts (Elements of design)
Basic design & visual arts (Elements of design)
 

Semelhante a Design Principles to design Patterns

Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desaijinaldesailive
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsBasavaraj Patil
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignDr. C.V. Suresh Babu
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignIrwansyah Irwansyah
 
Unit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptxUnit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptxDrYogeshDeshmukh1
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in androidJay Kumarr
 
Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2Ankit Dubey
 
Applying design patterns
Applying design patternsApplying design patterns
Applying design patternsYogeshwaranT
 
System software design1
System software design1System software design1
System software design1PrityRawat2
 
Function Oriented and Object Oriented Design,Modularization techniques
Function Oriented and Object Oriented Design,Modularization techniquesFunction Oriented and Object Oriented Design,Modularization techniques
Function Oriented and Object Oriented Design,Modularization techniquesnimmik4u
 
Object Oriented Design SOLID Principles
Object Oriented Design SOLID PrinciplesObject Oriented Design SOLID Principles
Object Oriented Design SOLID Principlesrainynovember12
 
System design process.pptx
System design process.pptxSystem design process.pptx
System design process.pptxNajibMuhammad16
 
An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.ONE BCG
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsJuan Lopez
 
Basic software engineering principles - Session 1
Basic software engineering principles - Session 1Basic software engineering principles - Session 1
Basic software engineering principles - Session 1LahiruWijewardana1
 

Semelhante a Design Principles to design Patterns (20)

Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
 
Soild principles
Soild principlesSoild principles
Soild principles
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Solid
SolidSolid
Solid
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven Design
 
Unit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptxUnit No 6 Design Patterns.pptx
Unit No 6 Design Patterns.pptx
 
OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
 
Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2
 
DP PPTS by BK.pptx
DP PPTS by BK.pptxDP PPTS by BK.pptx
DP PPTS by BK.pptx
 
Applying design patterns
Applying design patternsApplying design patterns
Applying design patterns
 
System software design1
System software design1System software design1
System software design1
 
Function Oriented and Object Oriented Design,Modularization techniques
Function Oriented and Object Oriented Design,Modularization techniquesFunction Oriented and Object Oriented Design,Modularization techniques
Function Oriented and Object Oriented Design,Modularization techniques
 
Object Oriented Design SOLID Principles
Object Oriented Design SOLID PrinciplesObject Oriented Design SOLID Principles
Object Oriented Design SOLID Principles
 
System design process.pptx
System design process.pptxSystem design process.pptx
System design process.pptx
 
An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and Patterns
 
Basic software engineering principles - Session 1
Basic software engineering principles - Session 1Basic software engineering principles - Session 1
Basic software engineering principles - Session 1
 

Último

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 

Último (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

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.