SlideShare a Scribd company logo
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

More Related Content

Viewers also liked

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
Didier Plaindoux
 
Android Bonnees pratiques
Android Bonnees pratiques Android Bonnees pratiques
Android Bonnees pratiques Patrick Bashizi
 
Design Pattern
Design PatternDesign Pattern
Design Pattern
newegg
 
Cours1
Cours1Cours1
Cours1
jppellet82
 
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
Alex 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 Pattern
eprafulla
 
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
Damien GOSSET
 
Design patterns - Exemples en Java
Design patterns - Exemples en JavaDesign patterns - Exemples en Java
Design patterns - Exemples en Java
Oussama BEN KHIROUN
 
Design Patterns Presentation - Chetan Gole
Design Patterns Presentation -  Chetan GoleDesign Patterns Presentation -  Chetan Gole
Design Patterns Presentation - Chetan Gole
Chetan Gole
 
Visitor Pattern
Visitor PatternVisitor Pattern
Visitor Pattern
Ider Zheng
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
Anuja Arosha
 
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 introduction
neuros
 
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
Joao Pereira
 
Chp6 - Développement iOS
Chp6 - Développement iOSChp6 - Développement iOS
Chp6 - Développement iOS
Lilia 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 Mobiles
Lilia Sfaxi
 
Chp5 - Applications Android
Chp5 - Applications AndroidChp5 - Applications Android
Chp5 - Applications Android
Lilia Sfaxi
 
Introduction to Design Pattern
Introduction to Design  PatternIntroduction to Design  Pattern
Introduction to Design Pattern
Sanae BEKKAR
 

Viewers also liked (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 to 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
 
Orientation session
Orientation sessionOrientation session
Orientation session
GoogleDeveloperStude2
 
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 Patterns
frgo
 
Welcome to ModelFoundry
Welcome to ModelFoundryWelcome to ModelFoundry
Welcome to ModelFoundry
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
Paul Filkin
 
Software System Engineering - Chapter 2
Software System Engineering - Chapter 2Software System Engineering - Chapter 2
Software System Engineering - Chapter 2
Fadhil 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 Event
Lemi 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 Managers
DATAVERSITY
 
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
Edureka!
 
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
Edureka!
 
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
Nilaadvika
 
Lightweight Model-Driven Engineering
Lightweight Model-Driven EngineeringLightweight Model-Driven Engineering
Lightweight Model-Driven Engineering
Jordi 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 Classroom
Cynthia 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 to 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 !
 

Recently uploaded

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 

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