SlideShare une entreprise Scribd logo
1  sur  13
Presentation
        on
Design Patterns



             By
    Samundra Shrestha
Patterns
Each pattern describes a problem which occurs over and
over again in our environment and then describes the core
of the solution to that problem, in such a way that you can
use this solution a million times over, without ever doing it
the same twice.




                             - Christopher Alexander, The
                             Timeless Way of Building, 1979



          So what are patterns?
What are Patterns, really?

            Patterns catalog solutions to
            categories of problems

            They consist of
            A name
            A solution to a problem
            A description of the solution
            An assessment of the pros and
            cons of the pattern
What are Patterns Not?

1. An algorithm.
2. An implementation.
3. The same every time you see them.
Introduction to Design Patterns
Gang of Four (GOF)

    Erich Gamma, Richard Helm, Ralph Johnson,
and John Vlissides

    Authors of the original Design Patterns book


Problem in software design

    What – business and functionality requirements

    How – particular design to meet the requirements

    Work – Actual implementation, How put into practice.
Principal and Strategies
      
           Open Closed Principle
      
           Dependency Inversion
      
           Single Responsibility Policy


Why ?


  
          improve abilities as analyst and designer.
  
          tackle situation in which no design pattern can be
          applied or design pattern has not been discovered yet.
Contextual Design
Open Closed Principle (OCP)


   "Modules, methods, classes should be open for extension,
   while closed for modifications."


    
        Loose Coupling


    
        Encapsulation
Dependency Inversion Principle

    Depend on the abstractions



    Higher level module should not depend on lower
    level module. Both high and low level should depend
    on abstractions



    Abstraction should not depend on details. Details
    should depend on abstractions.
Categorization
Creational Patterns

     Abstract Factory, Builder, Factory Method,
     Prototype, Singleton

Behavioral Patterns

     Adapter, Bridge, Composite, Decorator,
     Facade, Flyweight, Proxy

Structural Patterns

     Chain of Responsibility, Command,
     Interpreter, Iterator, Mediator, Memento,
     Observer, State, Strategy, Template,
     Method, Visitor

                          Single instance in the whole application/platform
Singleton Patterns                                Patterns by Examples

Problem : Ensure a class has only one instance available in the system anytime.



                                                   Output:

                                                   Design Patterns Example
Factory Pattern                                   Patterns by Examples

dynamically create instances of multiple classes based on runtime input.




                                                  Output:

                                                  This is system generated
                                                  messageThis is console
                                                  generated message
Decorator Pattern                                     Patterns by Examples
best suited for altering or decorating portions of an existing object’s content or
functionality without modifying the structure of the original object.




                                           Output :

                                           The CD contains the following tracks:
                                           1) what-it-means. 2) brr. 3) good-bye.
Thank you :)

Contenu connexe

Similaire à Design patterns

Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2Ankit Dubey
 
Why Design Patterns Are Important In Software Engineering
Why Design Patterns Are Important In Software EngineeringWhy Design Patterns Are Important In Software Engineering
Why Design Patterns Are Important In Software EngineeringProtelo, Inc.
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patternssukumarraju6
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design patternMindfire Solutions
 
Design Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The WorldDesign Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The WorldSaurabh Moody
 
P Training Presentation
P Training PresentationP Training Presentation
P Training PresentationGaurav Tyagi
 
Cs 1023 lec 9 design pattern (week 2)
Cs 1023 lec 9 design pattern (week 2)Cs 1023 lec 9 design pattern (week 2)
Cs 1023 lec 9 design pattern (week 2)stanbridge
 
GoF Design patterns I: Introduction + Structural Patterns
GoF Design patterns I:   Introduction + Structural PatternsGoF Design patterns I:   Introduction + Structural Patterns
GoF Design patterns I: Introduction + Structural PatternsSameh Deabes
 
Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan GoleChetan Gole
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General IntroductionAsma CHERIF
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2Julie Iskander
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in androidJay Kumarr
 
Oops design pattern intro
Oops design pattern intro Oops design pattern intro
Oops design pattern intro anshu_atri
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...Anil Sharma
 
Design pattern & categories
Design pattern & categoriesDesign pattern & categories
Design pattern & categoriesHimanshu
 

Similaire à Design patterns (20)

Design patterns
Design patternsDesign patterns
Design patterns
 
Module 2 design patterns-2
Module 2   design patterns-2Module 2   design patterns-2
Module 2 design patterns-2
 
Why Design Patterns Are Important In Software Engineering
Why Design Patterns Are Important In Software EngineeringWhy Design Patterns Are Important In Software Engineering
Why Design Patterns Are Important In Software Engineering
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patterns
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design pattern
 
Patterns Overview
Patterns OverviewPatterns Overview
Patterns Overview
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Design Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The WorldDesign Patterns For 70% Of Programmers In The World
Design Patterns For 70% Of Programmers In The World
 
Introduction to Design Patterns
Introduction to Design PatternsIntroduction to Design Patterns
Introduction to Design Patterns
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 
Cs 1023 lec 9 design pattern (week 2)
Cs 1023 lec 9 design pattern (week 2)Cs 1023 lec 9 design pattern (week 2)
Cs 1023 lec 9 design pattern (week 2)
 
GoF Design patterns I: Introduction + Structural Patterns
GoF Design patterns I:   Introduction + Structural PatternsGoF Design patterns I:   Introduction + Structural Patterns
GoF Design patterns I: Introduction + Structural Patterns
 
Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan Gole
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
 
Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
 
Oops design pattern intro
Oops design pattern intro Oops design pattern intro
Oops design pattern intro
 
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
dotnet stuff.com tutorials-design-patterns_exploring-net-design-patterns-in-s...
 
Design pattern & categories
Design pattern & categoriesDesign pattern & categories
Design pattern & categories
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 

Plus de Prawesh Shrestha

Presentation: Follow up on hackathon - FightVAW
Presentation: Follow up on hackathon - FightVAWPresentation: Follow up on hackathon - FightVAW
Presentation: Follow up on hackathon - FightVAWPrawesh Shrestha
 
Company registration, conduction and renewal
Company registration, conduction and renewalCompany registration, conduction and renewal
Company registration, conduction and renewalPrawesh Shrestha
 
Orientation to Pivot Nepal Finalists
Orientation to Pivot Nepal FinalistsOrientation to Pivot Nepal Finalists
Orientation to Pivot Nepal FinalistsPrawesh Shrestha
 
Business plan and presentation iii - financials and risk
Business plan and presentation   iii - financials and riskBusiness plan and presentation   iii - financials and risk
Business plan and presentation iii - financials and riskPrawesh Shrestha
 
Business plan and presentation ii - marketing and operations
Business plan and presentation   ii - marketing and operationsBusiness plan and presentation   ii - marketing and operations
Business plan and presentation ii - marketing and operationsPrawesh Shrestha
 
Business plan and presentation i - concept-growth-risk
Business plan and presentation   i - concept-growth-riskBusiness plan and presentation   i - concept-growth-risk
Business plan and presentation i - concept-growth-riskPrawesh Shrestha
 
Technology Entrepreneurship - Making Business Sense
Technology Entrepreneurship - Making Business SenseTechnology Entrepreneurship - Making Business Sense
Technology Entrepreneurship - Making Business SensePrawesh Shrestha
 
Pivot Nepal - Presentation
Pivot Nepal - PresentationPivot Nepal - Presentation
Pivot Nepal - PresentationPrawesh Shrestha
 
Swktm gdg presentation v1.0
Swktm gdg presentation v1.0Swktm gdg presentation v1.0
Swktm gdg presentation v1.0Prawesh Shrestha
 
I os 101:basic training rajan
I os 101:basic training   rajanI os 101:basic training   rajan
I os 101:basic training rajanPrawesh Shrestha
 
GSMA mWomen design challenge 2012
GSMA mWomen design challenge 2012GSMA mWomen design challenge 2012
GSMA mWomen design challenge 2012Prawesh Shrestha
 
Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in androidPrawesh Shrestha
 
N locate - market perspective
N locate - market perspectiveN locate - market perspective
N locate - market perspectivePrawesh Shrestha
 
Android trainingforbeginners
Android trainingforbeginnersAndroid trainingforbeginners
Android trainingforbeginnersPrawesh Shrestha
 
Scooba talk about your apps - vol 2
Scooba   talk about your apps - vol 2Scooba   talk about your apps - vol 2
Scooba talk about your apps - vol 2Prawesh Shrestha
 
Software quality and mobile apps
Software quality and mobile appsSoftware quality and mobile apps
Software quality and mobile appsPrawesh Shrestha
 

Plus de Prawesh Shrestha (20)

Presentation: Follow up on hackathon - FightVAW
Presentation: Follow up on hackathon - FightVAWPresentation: Follow up on hackathon - FightVAW
Presentation: Follow up on hackathon - FightVAW
 
Company registration, conduction and renewal
Company registration, conduction and renewalCompany registration, conduction and renewal
Company registration, conduction and renewal
 
Orientation to Pivot Nepal Finalists
Orientation to Pivot Nepal FinalistsOrientation to Pivot Nepal Finalists
Orientation to Pivot Nepal Finalists
 
Business plan and presentation iii - financials and risk
Business plan and presentation   iii - financials and riskBusiness plan and presentation   iii - financials and risk
Business plan and presentation iii - financials and risk
 
Business plan and presentation ii - marketing and operations
Business plan and presentation   ii - marketing and operationsBusiness plan and presentation   ii - marketing and operations
Business plan and presentation ii - marketing and operations
 
Business plan and presentation i - concept-growth-risk
Business plan and presentation   i - concept-growth-riskBusiness plan and presentation   i - concept-growth-risk
Business plan and presentation i - concept-growth-risk
 
Technology Entrepreneurship - Making Business Sense
Technology Entrepreneurship - Making Business SenseTechnology Entrepreneurship - Making Business Sense
Technology Entrepreneurship - Making Business Sense
 
Pivot Nepal - Presentation
Pivot Nepal - PresentationPivot Nepal - Presentation
Pivot Nepal - Presentation
 
Swktm gdg presentation v1.0
Swktm gdg presentation v1.0Swktm gdg presentation v1.0
Swktm gdg presentation v1.0
 
I os 101:basic training rajan
I os 101:basic training   rajanI os 101:basic training   rajan
I os 101:basic training rajan
 
GSMA mWomen design challenge 2012
GSMA mWomen design challenge 2012GSMA mWomen design challenge 2012
GSMA mWomen design challenge 2012
 
Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in android
 
N locate - market perspective
N locate - market perspectiveN locate - market perspective
N locate - market perspective
 
Nepal load shedding apps
Nepal load shedding appsNepal load shedding apps
Nepal load shedding apps
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Ncell's scheme
Ncell's schemeNcell's scheme
Ncell's scheme
 
Android trainingforbeginners
Android trainingforbeginnersAndroid trainingforbeginners
Android trainingforbeginners
 
Scooba talk about your apps - vol 2
Scooba   talk about your apps - vol 2Scooba   talk about your apps - vol 2
Scooba talk about your apps - vol 2
 
Software quality and mobile apps
Software quality and mobile appsSoftware quality and mobile apps
Software quality and mobile apps
 
Mvc - Titanium
Mvc - TitaniumMvc - Titanium
Mvc - Titanium
 

Dernier

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Design patterns

  • 1. Presentation on Design Patterns By Samundra Shrestha
  • 2. Patterns Each pattern describes a problem which occurs over and over again in our environment and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same twice. - Christopher Alexander, The Timeless Way of Building, 1979 So what are patterns?
  • 3. What are Patterns, really? Patterns catalog solutions to categories of problems They consist of A name A solution to a problem A description of the solution An assessment of the pros and cons of the pattern
  • 4. What are Patterns Not? 1. An algorithm. 2. An implementation. 3. The same every time you see them.
  • 5. Introduction to Design Patterns Gang of Four (GOF)  Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides  Authors of the original Design Patterns book Problem in software design  What – business and functionality requirements  How – particular design to meet the requirements  Work – Actual implementation, How put into practice.
  • 6. Principal and Strategies  Open Closed Principle  Dependency Inversion  Single Responsibility Policy Why ?  improve abilities as analyst and designer.  tackle situation in which no design pattern can be applied or design pattern has not been discovered yet.
  • 7. Contextual Design Open Closed Principle (OCP) "Modules, methods, classes should be open for extension, while closed for modifications."  Loose Coupling  Encapsulation
  • 8. Dependency Inversion Principle  Depend on the abstractions  Higher level module should not depend on lower level module. Both high and low level should depend on abstractions  Abstraction should not depend on details. Details should depend on abstractions.
  • 9. Categorization Creational Patterns Abstract Factory, Builder, Factory Method, Prototype, Singleton Behavioral Patterns Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy Structural Patterns Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template, Method, Visitor Single instance in the whole application/platform
  • 10. Singleton Patterns Patterns by Examples Problem : Ensure a class has only one instance available in the system anytime. Output: Design Patterns Example
  • 11. Factory Pattern Patterns by Examples dynamically create instances of multiple classes based on runtime input. Output: This is system generated messageThis is console generated message
  • 12. Decorator Pattern Patterns by Examples best suited for altering or decorating portions of an existing object’s content or functionality without modifying the structure of the original object. Output : The CD contains the following tracks: 1) what-it-means. 2) brr. 3) good-bye.