SlideShare una empresa de Scribd logo
1 de 41
Mhd Adel Alajami 1 
DESIGN PATTERN 
8/29/2014 Mhd Adel Alajami
Agenda 
Mhd Adel Alajami 8/29/2014 
2 
 Understanding the need for design patterns 
 What are design patterns 
 Using design patterns 
 State Design Patter 
 Singleton Design Patter 
 Façade Design Patter
Software Development 
Mhd Adel Alajami 8/29/2014 
3
Mhd Adel Alajami 8/29/2014 
4 
Software Development
Mhd Adel Alajami 8/29/2014 
5 
Software Development
Mhd Adel Alajami 8/29/2014 
6 
Software Development
the need for design patterns 
Mhd Adel Alajami 8/29/2014 
7 
 Software changes 
We need to add a new features - boss 
There is a change in the specification - customer 
We have found a big bug – team 
Flexible code 
Maintainable Code
Use Design Pattern 
Mhd Adel Alajami 8/29/2014 
8 
 By learning theme 
 And then applying them in your OOP designs 
 You will create more flexible and maintainable 
code
Dealing with change 
Mhd Adel Alajami 8/29/2014 
9 
 Software has lots of ways to change 
 There are many design pattern to deal with 
changes 
 Design patterns address many of the ways 
software changes over time
What are design pattern ? 
Mhd Adel Alajami 8/29/2014 
10 
 Design patterns are general solutions to 
common problems 
 A pattern is a guideline for flexible and resilient 
code design 
 It does not go in detail of implementation 
 There is no DP for Banking system and other 
for games 
 It is a general solution for common problem in 
software development
What are design pattern ? 
Mhd Adel Alajami 8/29/2014 
11 
 “I have a problem, when one of my object 
changes , I need to let all other objects know. 
Is there a good way to do that?” 
 This is a common problem in software 
development 
 There is a proven method to solve it : The 
Observer Pattern
Where did DP come from ? 
Mhd Adel Alajami 8/29/2014 
12 
 23 original pattern 
 Now, there are many patterns for many 
different software problems
How To Use Design Pattern 
Mhd Adel Alajami 8/29/2014 
13 
 A design pattern is not a library, module or 
package 
 It’s a guideline for how to solve a problem 
 Higher level than a library 
 First understand the pattern, and then use its 
design in your software
Using Design Pattern 
Mhd Adel Alajami 8/29/2014 
14 
 Ultimate in reuse 
 Build from years of software development 
experience 
 Save times, and trial and error 
 Not reusing code, but reusing experience
State Machine 
Mhd Adel Alajami 8/29/2014 
15
Classic Way – Without Pattern 
Mhd Adel Alajami 8/29/2014 
16
Mhd Adel Alajami 8/29/2014 
17 
Classic Way – Without Pattern
Mhd Adel Alajami 8/29/2014 
18 
Classic Way – Without Pattern
We Need Another State 
Mhd Adel Alajami 8/29/2014 
19
We Need Another State 
Mhd Adel Alajami 8/29/2014 
20
Disadvantage 
Mhd Adel Alajami 8/29/2014 
21 
 Is not really OO at all 
 Any additions require many change to code 
 Difficult to understand all the state and 
transitions 
 Violates open closed principle
Think of Each State as an 
object 
Mhd Adel Alajami 8/29/2014 
22
Mhd Adel Alajami 8/29/2014 
23 
Think of Each State as an 
object
Class Diagram 
Mhd Adel Alajami 8/29/2014 
24
Implement State Design Pattern 
Mhd Adel Alajami 8/29/2014 
25
Mhd Adel Alajami 8/29/2014 
26 
Implement State Design Pattern
Mhd Adel Alajami 8/29/2014 
27 
Implement State Design Pattern
Advantage 
Mhd Adel Alajami 8/29/2014 
28
Singleton Design Pattern 
Mhd Adel Alajami 8/29/2014 
29
Singleton Uses 
Mhd Adel Alajami 8/29/2014 
30
Why can’t I Just Instantiate 
One? 
Mhd Adel Alajami 8/29/2014 
31
Prevent Instantiation 
Mhd Adel Alajami 8/29/2014 
32
Prevent Instantiation 
Mhd Adel Alajami 8/29/2014 
33
Mhd Adel Alajami 8/29/2014 
34 
Prevent Instantiation
Class Diagram 
Mhd Adel Alajami 8/29/2014 
35
What About Singleton With 
Multithreading 
Mhd Adel Alajami 8/29/2014 
36 
 To Avoid creation Multi Instance in 
Multithreading
Mhd Adel Alajami 8/29/2014 
37 
What About Singleton With 
Multithreading
Before Façade Design Pattern 
Need to communicate 
with 
Mhd Adel Alajami 8/29/2014 
38 
Client Classes 
Subsystem classes
Façade Design Pattern 
Mhd Adel Alajami 8/29/2014 
39 
Client Classes 
Subsystem classes 
Facade
Benefits 
Mhd Adel Alajami 8/29/2014 
40 
 Shields clients from subsystem classes; reduces 
the number of objects that clients deal with. 
 Promotes weak coupling between subsystem and 
its clients. 
 Helps in layering the system. Helps eliminate 
circular dependencies. 
 Makes using the subsystem easier
Any Questions ? 
Mhd Adel Alajami 8/29/2014 
41

Más contenido relacionado

Destacado

De java à swift en 2 temps trois mouvements
De java à swift en 2 temps trois mouvementsDe java à swift en 2 temps trois mouvements
De java à swift en 2 temps trois mouvementsDidier Plaindoux
 
Android Bonnees pratiques
Android Bonnees pratiques Android Bonnees pratiques
Android Bonnees pratiques Patrick Bashizi
 
Design Pattern
Design PatternDesign Pattern
Design Patternnewegg
 
Design Pattern: Développement et Bonnes pratiques
Design Pattern: Développement et Bonnes pratiquesDesign Pattern: Développement et Bonnes pratiques
Design Pattern: Développement et Bonnes pratiquesAlex Wilfried OUATTARA
 
Design Patterns - 04 Adapter and Facade Pattern
Design Patterns - 04 Adapter and Facade PatternDesign Patterns - 04 Adapter and Facade Pattern
Design Patterns - 04 Adapter and Facade Patterneprafulla
 
Swift, opportunités et perspectives du dernier langage d'Apple
Swift, opportunités et perspectives du dernier langage d'AppleSwift, opportunités et perspectives du dernier langage d'Apple
Swift, opportunités et perspectives du dernier langage d'AppleDamien GOSSET
 
Design patterns - Exemples en Java
Design patterns - Exemples en JavaDesign patterns - Exemples en Java
Design patterns - Exemples en JavaOussama BEN KHIROUN
 
Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan GoleChetan Gole
 
Visitor Pattern
Visitor PatternVisitor Pattern
Visitor PatternIder Zheng
 
01 programmation mobile - android - (introduction)
01 programmation mobile - android - (introduction)01 programmation mobile - android - (introduction)
01 programmation mobile - android - (introduction)TECOS
 
Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)paramisoft
 
Design Pattern introduction
Design Pattern introductionDesign Pattern introduction
Design Pattern introductionneuros
 
Software Design Patterns - Selecting the right design pattern
Software Design Patterns - Selecting the right design patternSoftware Design Patterns - Selecting the right design pattern
Software Design Patterns - Selecting the right design patternJoao Pereira
 
Chp6 - Développement iOS
Chp6 - Développement iOSChp6 - Développement iOS
Chp6 - Développement iOSLilia Sfaxi
 
Chp2 - Conception UX-UI des Applications Mobiles
Chp2 - Conception UX-UI des Applications MobilesChp2 - Conception UX-UI des Applications Mobiles
Chp2 - Conception UX-UI des Applications MobilesLilia Sfaxi
 
Chp5 - Applications Android
Chp5 - Applications AndroidChp5 - Applications Android
Chp5 - Applications AndroidLilia Sfaxi
 
Introduction to Design Pattern
Introduction to Design  PatternIntroduction to Design  Pattern
Introduction to Design PatternSanae BEKKAR
 

Destacado (20)

De java à swift en 2 temps trois mouvements
De java à swift en 2 temps trois mouvementsDe java à swift en 2 temps trois mouvements
De java à swift en 2 temps trois mouvements
 
Android Bonnees pratiques
Android Bonnees pratiques Android Bonnees pratiques
Android Bonnees pratiques
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
 
Cours1
Cours1Cours1
Cours1
 
Design Pattern: Développement et Bonnes pratiques
Design Pattern: Développement et Bonnes pratiquesDesign Pattern: Développement et Bonnes pratiques
Design Pattern: Développement et Bonnes pratiques
 
Design Patterns - 04 Adapter and Facade Pattern
Design Patterns - 04 Adapter and Facade PatternDesign Patterns - 04 Adapter and Facade Pattern
Design Patterns - 04 Adapter and Facade Pattern
 
Swift, opportunités et perspectives du dernier langage d'Apple
Swift, opportunités et perspectives du dernier langage d'AppleSwift, opportunités et perspectives du dernier langage d'Apple
Swift, opportunités et perspectives du dernier langage d'Apple
 
Design patterns - Exemples en Java
Design patterns - Exemples en JavaDesign patterns - Exemples en Java
Design patterns - Exemples en Java
 
Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan Gole
 
Visitor Pattern
Visitor PatternVisitor Pattern
Visitor Pattern
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
01 programmation mobile - android - (introduction)
01 programmation mobile - android - (introduction)01 programmation mobile - android - (introduction)
01 programmation mobile - android - (introduction)
 
Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)
 
Design Pattern introduction
Design Pattern introductionDesign Pattern introduction
Design Pattern introduction
 
Software Design Patterns - Selecting the right design pattern
Software Design Patterns - Selecting the right design patternSoftware Design Patterns - Selecting the right design pattern
Software Design Patterns - Selecting the right design pattern
 
Chp6 - Développement iOS
Chp6 - Développement iOSChp6 - Développement iOS
Chp6 - Développement iOS
 
Chp2 - Conception UX-UI des Applications Mobiles
Chp2 - Conception UX-UI des Applications MobilesChp2 - Conception UX-UI des Applications Mobiles
Chp2 - Conception UX-UI des Applications Mobiles
 
Chp5 - Applications Android
Chp5 - Applications AndroidChp5 - Applications Android
Chp5 - Applications Android
 
Introduction to Design Pattern
Introduction to Design  PatternIntroduction to Design  Pattern
Introduction to Design Pattern
 

Similar a Design pattern

UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOPUNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOPAmit Midha
 
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOPUNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOPAmit Midha
 
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOPINTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOPAmit Midha
 
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOPINTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOPAmit Midha
 
Agile and Modeling / MDE : friends or foes? (Agile Tour Nantes 2010)
Agile and Modeling / MDE : friends or foes? (Agile Tour  Nantes 2010)Agile and Modeling / MDE : friends or foes? (Agile Tour  Nantes 2010)
Agile and Modeling / MDE : friends or foes? (Agile Tour Nantes 2010)Jordi Cabot
 
Design Patterns
Design PatternsDesign Patterns
Design Patternsfrgo
 
Welcome to ModelFoundry
Welcome to ModelFoundryWelcome to ModelFoundry
Welcome to ModelFoundryModelFoundry
 
Trikonf 2015 - Community, Studio and the OpenExchange
Trikonf 2015  - Community, Studio and the OpenExchangeTrikonf 2015  - Community, Studio and the OpenExchange
Trikonf 2015 - Community, Studio and the OpenExchangePaul Filkin
 
Software System Engineering - Chapter 2
Software System Engineering - Chapter 2Software System Engineering - Chapter 2
Software System Engineering - Chapter 2Fadhil Ismail
 
Global Day of Coderetreat'14 - Istanbul Event
Global Day of Coderetreat'14 - Istanbul EventGlobal Day of Coderetreat'14 - Istanbul Event
Global Day of Coderetreat'14 - Istanbul EventLemi Orhan Ergin
 
UXPA 2023: Experience Maps - A designer's framework for working in Agile team...
UXPA 2023: Experience Maps - A designer's framework for working in Agile team...UXPA 2023: Experience Maps - A designer's framework for working in Agile team...
UXPA 2023: Experience Maps - A designer's framework for working in Agile team...UXPA International
 
Big Challenges in Data Modeling - Data Modelers and Project Managers
Big Challenges in Data Modeling - Data Modelers and Project ManagersBig Challenges in Data Modeling - Data Modelers and Project Managers
Big Challenges in Data Modeling - Data Modelers and Project ManagersDATAVERSITY
 
Design Patterns - The Ultimate Blueprint for Software
Design Patterns - The Ultimate Blueprint for SoftwareDesign Patterns - The Ultimate Blueprint for Software
Design Patterns - The Ultimate Blueprint for SoftwareEdureka!
 
Webinar: Design Patterns : Tailor-made solutions for Software Development
Webinar: Design Patterns : Tailor-made solutions for Software DevelopmentWebinar: Design Patterns : Tailor-made solutions for Software Development
Webinar: Design Patterns : Tailor-made solutions for Software DevelopmentEdureka!
 
How To Choose The Best Udemy Clone_ 2024 Checklist
How To Choose The Best Udemy Clone_ 2024 ChecklistHow To Choose The Best Udemy Clone_ 2024 Checklist
How To Choose The Best Udemy Clone_ 2024 ChecklistNilaadvika
 
Lightweight Model-Driven Engineering
Lightweight Model-Driven EngineeringLightweight Model-Driven Engineering
Lightweight Model-Driven EngineeringJordi Cabot
 
Real World Lessons Using Lean UX (Workshop)
Real World Lessons Using Lean UX (Workshop)Real World Lessons Using Lean UX (Workshop)
Real World Lessons Using Lean UX (Workshop)Bill Scott
 
Bring Your Mojo to the Virtual Classroom
Bring Your Mojo to the Virtual ClassroomBring Your Mojo to the Virtual Classroom
Bring Your Mojo to the Virtual ClassroomCynthia Clay
 
Drupal Camp Mumbai -Making Drupal Agile !
Drupal Camp Mumbai -Making Drupal Agile !Drupal Camp Mumbai -Making Drupal Agile !
Drupal Camp Mumbai -Making Drupal Agile !Renzil Dsilva
 

Similar a Design pattern (20)

UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOPUNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
 
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOPUNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
UNDERSTANDING OOAD AND DESIGN PATTERNS USING UML AND JAVA-TRAINING WORKSHOP
 
Orientation session
Orientation sessionOrientation session
Orientation session
 
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOPINTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
 
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOPINTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
INTRODUCTION TO SOFTWARE ARCHITECTURE-TRAINING WORKSHOP
 
Agile and Modeling / MDE : friends or foes? (Agile Tour Nantes 2010)
Agile and Modeling / MDE : friends or foes? (Agile Tour  Nantes 2010)Agile and Modeling / MDE : friends or foes? (Agile Tour  Nantes 2010)
Agile and Modeling / MDE : friends or foes? (Agile Tour Nantes 2010)
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Welcome to ModelFoundry
Welcome to ModelFoundryWelcome to ModelFoundry
Welcome to ModelFoundry
 
Trikonf 2015 - Community, Studio and the OpenExchange
Trikonf 2015  - Community, Studio and the OpenExchangeTrikonf 2015  - Community, Studio and the OpenExchange
Trikonf 2015 - Community, Studio and the OpenExchange
 
Software System Engineering - Chapter 2
Software System Engineering - Chapter 2Software System Engineering - Chapter 2
Software System Engineering - Chapter 2
 
Global Day of Coderetreat'14 - Istanbul Event
Global Day of Coderetreat'14 - Istanbul EventGlobal Day of Coderetreat'14 - Istanbul Event
Global Day of Coderetreat'14 - Istanbul Event
 
UXPA 2023: Experience Maps - A designer's framework for working in Agile team...
UXPA 2023: Experience Maps - A designer's framework for working in Agile team...UXPA 2023: Experience Maps - A designer's framework for working in Agile team...
UXPA 2023: Experience Maps - A designer's framework for working in Agile team...
 
Big Challenges in Data Modeling - Data Modelers and Project Managers
Big Challenges in Data Modeling - Data Modelers and Project ManagersBig Challenges in Data Modeling - Data Modelers and Project Managers
Big Challenges in Data Modeling - Data Modelers and Project Managers
 
Design Patterns - The Ultimate Blueprint for Software
Design Patterns - The Ultimate Blueprint for SoftwareDesign Patterns - The Ultimate Blueprint for Software
Design Patterns - The Ultimate Blueprint for Software
 
Webinar: Design Patterns : Tailor-made solutions for Software Development
Webinar: Design Patterns : Tailor-made solutions for Software DevelopmentWebinar: Design Patterns : Tailor-made solutions for Software Development
Webinar: Design Patterns : Tailor-made solutions for Software Development
 
How To Choose The Best Udemy Clone_ 2024 Checklist
How To Choose The Best Udemy Clone_ 2024 ChecklistHow To Choose The Best Udemy Clone_ 2024 Checklist
How To Choose The Best Udemy Clone_ 2024 Checklist
 
Lightweight Model-Driven Engineering
Lightweight Model-Driven EngineeringLightweight Model-Driven Engineering
Lightweight Model-Driven Engineering
 
Real World Lessons Using Lean UX (Workshop)
Real World Lessons Using Lean UX (Workshop)Real World Lessons Using Lean UX (Workshop)
Real World Lessons Using Lean UX (Workshop)
 
Bring Your Mojo to the Virtual Classroom
Bring Your Mojo to the Virtual ClassroomBring Your Mojo to the Virtual Classroom
Bring Your Mojo to the Virtual Classroom
 
Drupal Camp Mumbai -Making Drupal Agile !
Drupal Camp Mumbai -Making Drupal Agile !Drupal Camp Mumbai -Making Drupal Agile !
Drupal Camp Mumbai -Making Drupal Agile !
 

Último

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
🐬 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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Último (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Design pattern

  • 1. Mhd Adel Alajami 1 DESIGN PATTERN 8/29/2014 Mhd Adel Alajami
  • 2. Agenda Mhd Adel Alajami 8/29/2014 2  Understanding the need for design patterns  What are design patterns  Using design patterns  State Design Patter  Singleton Design Patter  Façade Design Patter
  • 3. Software Development Mhd Adel Alajami 8/29/2014 3
  • 4. Mhd Adel Alajami 8/29/2014 4 Software Development
  • 5. Mhd Adel Alajami 8/29/2014 5 Software Development
  • 6. Mhd Adel Alajami 8/29/2014 6 Software Development
  • 7. the need for design patterns Mhd Adel Alajami 8/29/2014 7  Software changes We need to add a new features - boss There is a change in the specification - customer We have found a big bug – team Flexible code Maintainable Code
  • 8. Use Design Pattern Mhd Adel Alajami 8/29/2014 8  By learning theme  And then applying them in your OOP designs  You will create more flexible and maintainable code
  • 9. Dealing with change Mhd Adel Alajami 8/29/2014 9  Software has lots of ways to change  There are many design pattern to deal with changes  Design patterns address many of the ways software changes over time
  • 10. What are design pattern ? Mhd Adel Alajami 8/29/2014 10  Design patterns are general solutions to common problems  A pattern is a guideline for flexible and resilient code design  It does not go in detail of implementation  There is no DP for Banking system and other for games  It is a general solution for common problem in software development
  • 11. What are design pattern ? Mhd Adel Alajami 8/29/2014 11  “I have a problem, when one of my object changes , I need to let all other objects know. Is there a good way to do that?”  This is a common problem in software development  There is a proven method to solve it : The Observer Pattern
  • 12. Where did DP come from ? Mhd Adel Alajami 8/29/2014 12  23 original pattern  Now, there are many patterns for many different software problems
  • 13. How To Use Design Pattern Mhd Adel Alajami 8/29/2014 13  A design pattern is not a library, module or package  It’s a guideline for how to solve a problem  Higher level than a library  First understand the pattern, and then use its design in your software
  • 14. Using Design Pattern Mhd Adel Alajami 8/29/2014 14  Ultimate in reuse  Build from years of software development experience  Save times, and trial and error  Not reusing code, but reusing experience
  • 15. State Machine Mhd Adel Alajami 8/29/2014 15
  • 16. Classic Way – Without Pattern Mhd Adel Alajami 8/29/2014 16
  • 17. Mhd Adel Alajami 8/29/2014 17 Classic Way – Without Pattern
  • 18. Mhd Adel Alajami 8/29/2014 18 Classic Way – Without Pattern
  • 19. We Need Another State Mhd Adel Alajami 8/29/2014 19
  • 20. We Need Another State Mhd Adel Alajami 8/29/2014 20
  • 21. Disadvantage Mhd Adel Alajami 8/29/2014 21  Is not really OO at all  Any additions require many change to code  Difficult to understand all the state and transitions  Violates open closed principle
  • 22. Think of Each State as an object Mhd Adel Alajami 8/29/2014 22
  • 23. Mhd Adel Alajami 8/29/2014 23 Think of Each State as an object
  • 24. Class Diagram Mhd Adel Alajami 8/29/2014 24
  • 25. Implement State Design Pattern Mhd Adel Alajami 8/29/2014 25
  • 26. Mhd Adel Alajami 8/29/2014 26 Implement State Design Pattern
  • 27. Mhd Adel Alajami 8/29/2014 27 Implement State Design Pattern
  • 28. Advantage Mhd Adel Alajami 8/29/2014 28
  • 29. Singleton Design Pattern Mhd Adel Alajami 8/29/2014 29
  • 30. Singleton Uses Mhd Adel Alajami 8/29/2014 30
  • 31. Why can’t I Just Instantiate One? Mhd Adel Alajami 8/29/2014 31
  • 32. Prevent Instantiation Mhd Adel Alajami 8/29/2014 32
  • 33. Prevent Instantiation Mhd Adel Alajami 8/29/2014 33
  • 34. Mhd Adel Alajami 8/29/2014 34 Prevent Instantiation
  • 35. Class Diagram Mhd Adel Alajami 8/29/2014 35
  • 36. What About Singleton With Multithreading Mhd Adel Alajami 8/29/2014 36  To Avoid creation Multi Instance in Multithreading
  • 37. Mhd Adel Alajami 8/29/2014 37 What About Singleton With Multithreading
  • 38. Before Façade Design Pattern Need to communicate with Mhd Adel Alajami 8/29/2014 38 Client Classes Subsystem classes
  • 39. Façade Design Pattern Mhd Adel Alajami 8/29/2014 39 Client Classes Subsystem classes Facade
  • 40. Benefits Mhd Adel Alajami 8/29/2014 40  Shields clients from subsystem classes; reduces the number of objects that clients deal with.  Promotes weak coupling between subsystem and its clients.  Helps in layering the system. Helps eliminate circular dependencies.  Makes using the subsystem easier
  • 41. Any Questions ? Mhd Adel Alajami 8/29/2014 41