SlideShare una empresa de Scribd logo
1 de 22
DESIGN PATTERNS -- Mudabbir Warsi
AGENDA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction ,[object Object],“ 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, with out ever doing it the same way twice” --   Christopher Alexander: The Timeless way of Building ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Myths about Design Patterns ,[object Object],[object Object],[object Object],[object Object],[object Object]
Design Principles ,[object Object],[object Object],“ A module should be open for extension but closed for modification.” ,[object Object],[object Object],“ Sub-classes should be substitutable for their base class .” “ There should never be more than one reason for a class to change .” ,[object Object],“ Talk only to your immediate friends .” “ Depend in the direction of stability .”
Design Principles Contd… ,[object Object],[object Object],“ Solve the most important problem in the simplest possible way.” ,[object Object],[object Object],“ Every piece of knowledge must have a single, unambiguous and authoritative representation with in the system .” “ Many client specific interfaces are better than one general purpose interface .” ,[object Object],“ Classes that aren’t used together, should not be grouped together .” “ Depend upon Abstractions. Never depend upon Concretions .”
Basic Elements of a Design Pattern ,[object Object],[object Object],[object Object],[object Object]
Categories of Design Patterns ,[object Object],Abstract Factory Factory Method Singleton Prototype Builder Structural Adapter Decorator Flyweight Composite Bridge Facade Proxy Behavioral Mediator Iterator Visitor Observer Chain of Responsibility Strategy State Momento Command Interpreter Template Method Let you compose objects and classes into larger structures Involve object Instantiation and all provide a way to decouple a client from the object  it needs to create  Concerned with how objects and classes interact and distribute responsibility
The Pattern Life Cycle Real World  Projects Pattern Mining Author Version Preliminary Document -ation Pattern Polishing Reusable Version Pattern Reuse Incident Occurs of a pattern Discover Patterns Document Document Analyse /  Rule of Three Feedback Modification PHASE 1: MINING Author World PHASE 2: POLISHING Pattern Community World PHASE 3: REUSE Pattern User World
Pattern Hatching 4. A Miracle Occurs 7. Test the Solution 6. Instantiate the Pattern 5. Evaluate Solution 1. Familiarize yourself with Patterns 2. Characterize nature of u r problem 3. Apply Matching
Pattern Refactoring ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example Design Patterns ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Singleton static getInstance( ) // Other useful Methods static uniqueInstance // Other useful data return uniqueInstance ,[object Object],[object Object]
Singleton Contd… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Singleton Contd… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Inside Model-View-Controller 1. The User did something 2. Change your state 3. Change your display 4. I have changed 5. I need your state information VIEW Gives you a presentation of the model. It gets the state and data to be displayed from the model CONTROLLER Takes user input and figures out what it means  to the model MODEL The model holds all the data, state and application logic. It provides an interface to manipulate and retrieve its state.
A Closer Look 1. The User did something 2. Change your state 3. Change your display 4. I have changed 5. I need your state information STRATEGY The view and controller implement the  STRATEGY  pattern: The view is an object that is configured with a strategy. The controller provides the strategy.  Using the strategy pattern keeps the view decoupled from the model. OBSERVER The model implements the  OBSERVER  to keep interested objects updated when the state change occurs.  Using the observer patterns keeps the model decoupled with the view n controller COMPOSITE The view implements the  COMPOSITE  pattern: The display consists of nested set of windows, panels, buttons, text boxes etc.  When the controller tells the view to update, it only has to tell the top view component and the  COMPOSITE  takes care of the rest.
Observer I’d like to register as an observer My State  has changed Observable Observers All these Observers will be notified whenever state changes in the Model Any object that’s interested in the state change of the Model registers with the Model as an Observer.  INTENT: Define a one – many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Strategy The user did something We can swap in another behavior for the View by changing the Controller The Controller is the Strategy for the View – it’s the object that knows how to handle the user action. The View delegates to the Controller to handle the user actions The View only worries about the presentation, the Controller worries about translating user inputs to actions on the Model INTENT: Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithms vary independently from the client that uses it.
Composite Paint ( ) The View is a Composite of GUI components ( buttons, labels, text boxes etc). The top level component contains other components, which contain other components and so on until you get to the leaf nodes. ,[object Object],[object Object],[object Object],INTENT: Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
MVC in Action ,[object Object],Servlet / Controller JSP / View MODEL / DB / Business Logic Bean 1. HTTP Request 5. HTTP Response 2 3 4 ,[object Object],[object Object],[object Object]
EXPERT COMMENTS Today there are more patterns than in the GOF book: Learn them as well. Go for simplicity and don’t become over-excited. If you can come up with a simpler solution without applying a pattern, then go for it. Shoot for practical extensibility. Don’t provide hypothetical generality; be extensible in ways that matter. Patterns are Tools not Rules- They need to be tweaked and adapted to your problem. John Vlissides Richard Helm Ralph Johnson Eric Gamma
Q & A

Más contenido relacionado

La actualidad más candente

Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design patternMindfire Solutions
 
Structural patterns
Structural patternsStructural patterns
Structural patternsHimanshu
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternNishith Shukla
 
GOF Design pattern with java
GOF Design pattern with javaGOF Design pattern with java
GOF Design pattern with javaRajiv Gupta
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaEdureka!
 
Lecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design PatternsLecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design Patternsop205
 
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
 
Factory Design Pattern
Factory Design PatternFactory Design Pattern
Factory Design PatternJaswant Singh
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Luis Valencia
 
Java Design Pattern Interview Questions
Java Design Pattern Interview QuestionsJava Design Pattern Interview Questions
Java Design Pattern Interview Questionsjbashask
 
Design Pattern
Design PatternDesign Pattern
Design PatternHimanshu
 
Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)paramisoft
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their applicationHiệp Tiến
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns pptmkruthika
 
Design patterns - Proxy & Composite
Design patterns - Proxy & CompositeDesign patterns - Proxy & Composite
Design patterns - Proxy & CompositeSarath C
 

La actualidad más candente (19)

Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design pattern
 
Structural patterns
Structural patternsStructural patterns
Structural patterns
 
Go f designpatterns 130116024923-phpapp02
Go f designpatterns 130116024923-phpapp02Go f designpatterns 130116024923-phpapp02
Go f designpatterns 130116024923-phpapp02
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design Pattern
 
GOF Design pattern with java
GOF Design pattern with javaGOF Design pattern with java
GOF Design pattern with java
 
Java Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | EdurekaJava Design Patterns Tutorial | Edureka
Java Design Patterns Tutorial | Edureka
 
Lecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design PatternsLecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design Patterns
 
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
 
Composite Pattern
Composite PatternComposite Pattern
Composite Pattern
 
Factory Design Pattern
Factory Design PatternFactory Design Pattern
Factory Design Pattern
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
 
Java Design Pattern Interview Questions
Java Design Pattern Interview QuestionsJava Design Pattern Interview Questions
Java Design Pattern Interview Questions
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 
Design Patterns (Examples in .NET)
Design Patterns (Examples in .NET)Design Patterns (Examples in .NET)
Design Patterns (Examples in .NET)
 
Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their application
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns ppt
 
Design patterns - Proxy & Composite
Design patterns - Proxy & CompositeDesign patterns - Proxy & Composite
Design patterns - Proxy & Composite
 
Design patterns
Design patternsDesign patterns
Design patterns
 

Destacado

01 J2EE patrones
01 J2EE patrones01 J2EE patrones
01 J2EE patronesjuani ruiz
 
Cuebc slides 2
Cuebc slides 2Cuebc slides 2
Cuebc slides 2egregory
 
Line, texture, pattern
Line, texture, patternLine, texture, pattern
Line, texture, patternSimon Gummer
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1Shahzad
 
Texture-Element of Design-Art Lesson
Texture-Element of Design-Art LessonTexture-Element of Design-Art Lesson
Texture-Element of Design-Art LessonDara Cepeda, M. Ed.
 
Element of design texture
Element of design   textureElement of design   texture
Element of design textureMau Palm
 
Principles of Design
Principles of DesignPrinciples of Design
Principles of Designerinsmith.art
 
Окружающий мир_Где живут белые медведи
Окружающий мир_Где живут белые медведиОкружающий мир_Где живут белые медведи
Окружающий мир_Где живут белые медведиМКОУ СОШ № 1 г. Сим
 

Destacado (20)

01 J2EE patrones
01 J2EE patrones01 J2EE patrones
01 J2EE patrones
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Pattern making
Pattern makingPattern making
Pattern making
 
Cuebc slides 2
Cuebc slides 2Cuebc slides 2
Cuebc slides 2
 
Texture
TextureTexture
Texture
 
Design patterns tutorials
Design patterns tutorialsDesign patterns tutorials
Design patterns tutorials
 
Line, texture, pattern
Line, texture, patternLine, texture, pattern
Line, texture, pattern
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1
 
Texture-Element of Design-Art Lesson
Texture-Element of Design-Art LessonTexture-Element of Design-Art Lesson
Texture-Element of Design-Art Lesson
 
Industrial pattern making
Industrial pattern makingIndustrial pattern making
Industrial pattern making
 
Pattern making
Pattern makingPattern making
Pattern making
 
Element of design texture
Element of design   textureElement of design   texture
Element of design texture
 
Patternmaking
PatternmakingPatternmaking
Patternmaking
 
Principles of Design
Principles of DesignPrinciples of Design
Principles of Design
 
Что окружает нас дома
Что окружает нас домаЧто окружает нас дома
Что окружает нас дома
 
агния лювовна барто. верёвочка
агния лювовна барто. верёвочкаагния лювовна барто. верёвочка
агния лювовна барто. верёвочка
 
Великая забытая война
Великая забытая войнаВеликая забытая война
Великая забытая война
 
Окружающий мир_Где живут белые медведи
Окружающий мир_Где живут белые медведиОкружающий мир_Где живут белые медведи
Окружающий мир_Где живут белые медведи
 
Шлях ад пачатку стагоддзя: да 115-годдзя з дня нараджэння Міхаіла Ганчарыка
Шлях ад пачатку стагоддзя: да 115-годдзя з дня нараджэння Міхаіла ГанчарыкаШлях ад пачатку стагоддзя: да 115-годдзя з дня нараджэння Міхаіла Ганчарыка
Шлях ад пачатку стагоддзя: да 115-годдзя з дня нараджэння Міхаіла Ганчарыка
 
Marketing personal 01
Marketing personal 01Marketing personal 01
Marketing personal 01
 

Similar a Design patterns

Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in androidJay Kumarr
 
Design Principles to design Patterns
Design Principles to design PatternsDesign Principles to design Patterns
Design Principles to design PatternsFaizan Haider
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patternssukumarraju6
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignDr. C.V. Suresh Babu
 
Design Pattern with Actionscript
Design Pattern with ActionscriptDesign Pattern with Actionscript
Design Pattern with ActionscriptDaniel Swid
 
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
 
lecture10-patterns.ppt
lecture10-patterns.pptlecture10-patterns.ppt
lecture10-patterns.pptAnkitPangasa1
 
lecture10-patterns.ppt
lecture10-patterns.pptlecture10-patterns.ppt
lecture10-patterns.pptbryafaissal
 
ActionScript Design Patterns
ActionScript Design Patterns ActionScript Design Patterns
ActionScript Design Patterns Yoss Cohen
 
Modular Web Design With Components
Modular Web Design With ComponentsModular Web Design With Components
Modular Web Design With ComponentsNadal Soler
 
SOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureSOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureMohamed Galal
 
Design and Implementation in Software Engineering
Design and Implementation in Software EngineeringDesign and Implementation in Software Engineering
Design and Implementation in Software EngineeringKourosh Sajjadi
 
P Training Presentation
P Training PresentationP Training Presentation
P Training PresentationGaurav Tyagi
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsLalit Kale
 

Similar a Design patterns (20)

Design pattern in android
Design pattern in androidDesign pattern in android
Design pattern in android
 
Design Principles to design Patterns
Design Principles to design PatternsDesign Principles to design Patterns
Design Principles to design Patterns
 
Introduction To Design Patterns
Introduction To Design PatternsIntroduction To Design Patterns
Introduction To Design Patterns
 
Introduction to Design Patterns
Introduction to Design PatternsIntroduction to Design Patterns
Introduction to Design Patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Design Pattern with Actionscript
Design Pattern with ActionscriptDesign Pattern with Actionscript
Design Pattern with Actionscript
 
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
 
Testing method pptx
Testing method pptxTesting method pptx
Testing method pptx
 
Design patterns
Design patternsDesign patterns
Design patterns
 
lecture10-patterns.ppt
lecture10-patterns.pptlecture10-patterns.ppt
lecture10-patterns.ppt
 
lecture10-patterns.ppt
lecture10-patterns.pptlecture10-patterns.ppt
lecture10-patterns.ppt
 
ActionScript Design Patterns
ActionScript Design Patterns ActionScript Design Patterns
ActionScript Design Patterns
 
Modular Web Design With Components
Modular Web Design With ComponentsModular Web Design With Components
Modular Web Design With Components
 
L03 Design Patterns
L03 Design PatternsL03 Design Patterns
L03 Design Patterns
 
SOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureSOLID Principles and The Clean Architecture
SOLID Principles and The Clean Architecture
 
Design and Implementation in Software Engineering
Design and Implementation in Software EngineeringDesign and Implementation in Software Engineering
Design and Implementation in Software Engineering
 
Design pattern
Design patternDesign pattern
Design pattern
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design Patterns
 

Último

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
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
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
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
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
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
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
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
 

Último (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
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...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
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
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.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
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).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...
 

Design patterns

  • 1. DESIGN PATTERNS -- Mudabbir Warsi
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. The Pattern Life Cycle Real World Projects Pattern Mining Author Version Preliminary Document -ation Pattern Polishing Reusable Version Pattern Reuse Incident Occurs of a pattern Discover Patterns Document Document Analyse / Rule of Three Feedback Modification PHASE 1: MINING Author World PHASE 2: POLISHING Pattern Community World PHASE 3: REUSE Pattern User World
  • 10. Pattern Hatching 4. A Miracle Occurs 7. Test the Solution 6. Instantiate the Pattern 5. Evaluate Solution 1. Familiarize yourself with Patterns 2. Characterize nature of u r problem 3. Apply Matching
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Inside Model-View-Controller 1. The User did something 2. Change your state 3. Change your display 4. I have changed 5. I need your state information VIEW Gives you a presentation of the model. It gets the state and data to be displayed from the model CONTROLLER Takes user input and figures out what it means to the model MODEL The model holds all the data, state and application logic. It provides an interface to manipulate and retrieve its state.
  • 16. A Closer Look 1. The User did something 2. Change your state 3. Change your display 4. I have changed 5. I need your state information STRATEGY The view and controller implement the STRATEGY pattern: The view is an object that is configured with a strategy. The controller provides the strategy. Using the strategy pattern keeps the view decoupled from the model. OBSERVER The model implements the OBSERVER to keep interested objects updated when the state change occurs. Using the observer patterns keeps the model decoupled with the view n controller COMPOSITE The view implements the COMPOSITE pattern: The display consists of nested set of windows, panels, buttons, text boxes etc. When the controller tells the view to update, it only has to tell the top view component and the COMPOSITE takes care of the rest.
  • 17. Observer I’d like to register as an observer My State has changed Observable Observers All these Observers will be notified whenever state changes in the Model Any object that’s interested in the state change of the Model registers with the Model as an Observer. INTENT: Define a one – many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
  • 18. Strategy The user did something We can swap in another behavior for the View by changing the Controller The Controller is the Strategy for the View – it’s the object that knows how to handle the user action. The View delegates to the Controller to handle the user actions The View only worries about the presentation, the Controller worries about translating user inputs to actions on the Model INTENT: Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithms vary independently from the client that uses it.
  • 19.
  • 20.
  • 21. EXPERT COMMENTS Today there are more patterns than in the GOF book: Learn them as well. Go for simplicity and don’t become over-excited. If you can come up with a simpler solution without applying a pattern, then go for it. Shoot for practical extensibility. Don’t provide hypothetical generality; be extensible in ways that matter. Patterns are Tools not Rules- They need to be tweaked and adapted to your problem. John Vlissides Richard Helm Ralph Johnson Eric Gamma
  • 22. Q & A