SlideShare a Scribd company logo
1 of 61
Welcome to DEVDAY
Da Nang 2016
I’m Tuan
• Live in Da Nang.
• Working in Axon Active
Vietnam.
• 6 years in development
• Scrum Master, Team Leader,
Software Engineer.
• Java, Javascript, Code
Generator. tuan.do@axonactive.com
Questions
• Who joined Devday Da Nang 2015 ?
• Who knows about refactoring ?
• Who knows about clean code ?
Design Pattern 

at a glance
–Do Minh Tuan
What is a design pattern ?
“Each pattern describes a problem which occurs over
and over again in our environment, and then describes
the core of the solution to that problem, in such a way
that you can use this solution a million times over,
without ever doing it the same way twice”
- Christopher Wolfgang
Alexander (1936)
Elements of Pattern
The pattern name The problem
The consequences The solution
PATTERN
Advantages of Pattern
• Enhances code readability.
• Robust, Scalable.
• Enhances software development.
• Well-structured system.
• Well-tested system.
Ready for change
Gift Question
Organize the catalog
Design pattern relationship
How to select a design
pattern
How design patterns solve
design problems
• Finding appropriate objects.
• Determining Object Granularity.
• Specifying Object Interfaces.
• Specifying Object Implementations.
How to use a design pattern
(1 of 2)
• Read the pattern.
• Study the structure, participants and
collaborations sections.
• Sample code of pattern
• Choose names for pattern participants that are
meaningful in the application context.
How to use a design pattern
(2 of 2)
• Define the classes.
• Define application-specific names for operations
in the pattern.
• Implement the operations to carry out the
responsibillities and collaborations in the
pattern.
“Famous” Patterns
• Creational
• Abstract Factory
• Factory Method
• Structural
• Adapter
• Composite
• Decorator
• Behavioral
• Observer
• Strategy
• Template Method
“Famous” Patterns
• Creational
• Abstract Factory
• Factory Method
• Structural
• Adapter
• Composite
• Decorator
• Behavioral
• Observer
• Strategy
• Template Method
Abstract Factory
“Provide an interface for creating families of
related or dependent objects without specifying
their concrete classes.”
“Famous” Patterns
• Creational
• Abstract Factory
• Factory Method
• Structural
• Adapter
• Composite
• Decorator
• Behavioral
• Observer
• Strategy
• Template Method
Factory Method
“Define an interface for creating an object, but let
subclasses decide which class to instantance.
Factory Method lets a class defer instantiation to
subclasses.”
Demo
Abstract Factory
• It isolates concrete classes.
• It makes exchanging product famillies easy.
• It promotes consistency among products.
• Supporting new kinds of products is difficult.
Factory Method
• Provides hooks for subclasses.
• Connects parallel class hierarchies.
“Famous” Patterns
• Creational
• Abstract Factory
• Factory Method
• Structural
• Adapter
• Composite
• Decorator
• Behavioral
• Observer
• Strategy
• Template Method
Adapter
“Convert the interface of a class into another
interface clients expect. Adapter lets classes work
together that couldn’t otherwise because of
incompatible interfaces.”
Demo
Adapter
• How much adapting does Adapter do ?
• Pluggable adapters.
• Using two-way adapters to provide transparent.
“Famous” Patterns
• Creational
• Abstract Factory
• Factory Method
• Structural
• Adapter
• Composite
• Decorator
• Behavioral
• Observer
• Strategy
• Template Method
Composite
“Compose objects into tree structures to represent
part-whole hierarchies. Composite lets clients treat
individual objects and compositions of objects
uniformly.”
Demo
Composite
• Defines class hierarchies consisting of primitive
objects and composite objects.
• Make the client simple.
• Make it easier to add new kinds of components.
• Can make your design overly general.
“Famous” Patterns
• Creational
• Abstract Factory
• Factory Method
• Structural
• Adapter
• Composite
• Decorator
• Behavioral Pattern
• Observer
• Strategy
• Template Method
Decorator
“Attach additional responsibilities to an object
dynamically. Decorators provide a flexible
alternative to subclassing for extending
functionality.”
Demo
Decorator
• More flexibility than static inheritance.
• Avoids feature-laden classes high up in the
hierarchy.
• A decorator and it’s component aren’t critical.
• Lost of little objects.
“Famous” Patterns
• Creational
• Abstract Factory
• Factory Method
• Structural
• Adapter
• Composite
• Decorator
• Behavioral
• Observer
• Strategy
• Template Method
Observer
“Define a one-to-many dependency between
objects so that when one object changes state, all
its dependents are notified and updated
automatically.”
Demo
Observer
• Abstract coupling between Subject and
Observer.
• Support for broadcast communication.
• Unexpected updates.
• Lost of little objects.
“Famous” Patterns
• Creational
• Abstract Factory
• Factory Method
• Structural
• Adapter
• Composite
• Decorator
• Behavioral
• Observer
• Strategy
• Template Method
Strategy
“Define a family of algorithms, encapsulate each
one, and make them interchangeable. Strategy
lets the algorithm vary independently from clients
that use it.”
Demo
Strategy
• Families of related algorithms.
• An alternative to subclassing.
• Strategies eliminates conditional statements.
• Clients must be aware of different Strategies.
• Communication overhead between Strategy and
Context.
• Increased number of objects.
“Famous” Patterns
• Creational
• Abstract Factory
• Factory Method
• Structural
• Adapter
• Composite
• Decorator
• Behavioral
• Observer
• Strategy
• Template Method
Template Method
“Define the skeleton of an algorithm in an
operation, deferring some steps to subclasses.
Template Method lets subclasses redefine certain
steps of an algorithm without changing the
algorithm’s structure.”
Demo
Question and Answer
Conclusion
The gang of Four(GoF)

Raph Johnson, Erich Gamma,
Richard Helm, John Vlissides
tuan.do@axonactive.com
https://vn.linkedin.com/in/dominhtuan
Thank you !

More Related Content

Viewers also liked

[DevDay 2016] How to build a working group? Speaker: Loc Le – Lecturer at DUT...
[DevDay 2016] How to build a working group? Speaker: Loc Le – Lecturer at DUT...[DevDay 2016] How to build a working group? Speaker: Loc Le – Lecturer at DUT...
[DevDay 2016] How to build a working group? Speaker: Loc Le – Lecturer at DUT...DevDay.org
 
[DevDay 2016] Prepare for Success - Speaker: Toan Ngo – Vice President at Glo...
[DevDay 2016] Prepare for Success - Speaker: Toan Ngo – Vice President at Glo...[DevDay 2016] Prepare for Success - Speaker: Toan Ngo – Vice President at Glo...
[DevDay 2016] Prepare for Success - Speaker: Toan Ngo – Vice President at Glo...DevDay.org
 
[DevDay 2016] Chase your passion or Develop your skills? Speaker: Vinh Hoang ...
[DevDay 2016] Chase your passion or Develop your skills? Speaker: Vinh Hoang ...[DevDay 2016] Chase your passion or Develop your skills? Speaker: Vinh Hoang ...
[DevDay 2016] Chase your passion or Develop your skills? Speaker: Vinh Hoang ...DevDay.org
 
[DevDay 2016] IoT – A development story - Speaker: Lien Vo – Department head ...
[DevDay 2016] IoT – A development story - Speaker: Lien Vo – Department head ...[DevDay 2016] IoT – A development story - Speaker: Lien Vo – Department head ...
[DevDay 2016] IoT – A development story - Speaker: Lien Vo – Department head ...DevDay.org
 
Electric Microservices Land - Tsuyoshi Ushio
Electric Microservices Land - Tsuyoshi UshioElectric Microservices Land - Tsuyoshi Ushio
Electric Microservices Land - Tsuyoshi UshioDevDay.org
 
Scrum role introduction – the scrum master
Scrum role introduction – the scrum masterScrum role introduction – the scrum master
Scrum role introduction – the scrum masterLê Trọng-Hiệp
 
Scrum master maturity_model - for agile 2014
Scrum master maturity_model - for agile 2014Scrum master maturity_model - for agile 2014
Scrum master maturity_model - for agile 2014Jerry Rajamoney
 
Uplifting Scrum Master Services
Uplifting Scrum Master ServicesUplifting Scrum Master Services
Uplifting Scrum Master ServicesAmogh Joshi
 
Black Belt Scrum Master
Black Belt Scrum MasterBlack Belt Scrum Master
Black Belt Scrum MasterElad Amit
 
Secrets of a Scrum Master! Agile Practices for the Service Desk
Secrets of a Scrum Master! Agile Practices for the Service DeskSecrets of a Scrum Master! Agile Practices for the Service Desk
Secrets of a Scrum Master! Agile Practices for the Service DeskITSM Academy, Inc.
 
[DevDay 2016] Secret tools for a Scrum Team - Speaker: Sebastian Sussman – CI...
[DevDay 2016] Secret tools for a Scrum Team - Speaker: Sebastian Sussman – CI...[DevDay 2016] Secret tools for a Scrum Team - Speaker: Sebastian Sussman – CI...
[DevDay 2016] Secret tools for a Scrum Team - Speaker: Sebastian Sussman – CI...DevDay.org
 
[DevDay 2016] OpenStack and approaches for new users - Speaker: Chi Le – Head...
[DevDay 2016] OpenStack and approaches for new users - Speaker: Chi Le – Head...[DevDay 2016] OpenStack and approaches for new users - Speaker: Chi Le – Head...
[DevDay 2016] OpenStack and approaches for new users - Speaker: Chi Le – Head...DevDay.org
 
[DevDay 2016] Da Nang Software Industry & Job Opportunities for Students - Sp...
[DevDay 2016] Da Nang Software Industry & Job Opportunities for Students - Sp...[DevDay 2016] Da Nang Software Industry & Job Opportunities for Students - Sp...
[DevDay 2016] Da Nang Software Industry & Job Opportunities for Students - Sp...DevDay.org
 
[DevDay 2016] Build your next awesome game with Unity - Speaker: Trung Ngo –...
 [DevDay 2016] Build your next awesome game with Unity - Speaker: Trung Ngo –... [DevDay 2016] Build your next awesome game with Unity - Speaker: Trung Ngo –...
[DevDay 2016] Build your next awesome game with Unity - Speaker: Trung Ngo –...DevDay.org
 
Agile project management in IT - Sebastian Sussmann
Agile project management in IT - Sebastian SussmannAgile project management in IT - Sebastian Sussmann
Agile project management in IT - Sebastian SussmannDevDay.org
 

Viewers also liked (18)

[DevDay 2016] How to build a working group? Speaker: Loc Le – Lecturer at DUT...
[DevDay 2016] How to build a working group? Speaker: Loc Le – Lecturer at DUT...[DevDay 2016] How to build a working group? Speaker: Loc Le – Lecturer at DUT...
[DevDay 2016] How to build a working group? Speaker: Loc Le – Lecturer at DUT...
 
[DevDay 2016] Prepare for Success - Speaker: Toan Ngo – Vice President at Glo...
[DevDay 2016] Prepare for Success - Speaker: Toan Ngo – Vice President at Glo...[DevDay 2016] Prepare for Success - Speaker: Toan Ngo – Vice President at Glo...
[DevDay 2016] Prepare for Success - Speaker: Toan Ngo – Vice President at Glo...
 
[DevDay 2016] Chase your passion or Develop your skills? Speaker: Vinh Hoang ...
[DevDay 2016] Chase your passion or Develop your skills? Speaker: Vinh Hoang ...[DevDay 2016] Chase your passion or Develop your skills? Speaker: Vinh Hoang ...
[DevDay 2016] Chase your passion or Develop your skills? Speaker: Vinh Hoang ...
 
[DevDay 2016] IoT – A development story - Speaker: Lien Vo – Department head ...
[DevDay 2016] IoT – A development story - Speaker: Lien Vo – Department head ...[DevDay 2016] IoT – A development story - Speaker: Lien Vo – Department head ...
[DevDay 2016] IoT – A development story - Speaker: Lien Vo – Department head ...
 
Electric Microservices Land - Tsuyoshi Ushio
Electric Microservices Land - Tsuyoshi UshioElectric Microservices Land - Tsuyoshi Ushio
Electric Microservices Land - Tsuyoshi Ushio
 
Scrum Master
Scrum MasterScrum Master
Scrum Master
 
Scrum role introduction – the scrum master
Scrum role introduction – the scrum masterScrum role introduction – the scrum master
Scrum role introduction – the scrum master
 
Scrum master maturity_model - for agile 2014
Scrum master maturity_model - for agile 2014Scrum master maturity_model - for agile 2014
Scrum master maturity_model - for agile 2014
 
Uplifting Scrum Master Services
Uplifting Scrum Master ServicesUplifting Scrum Master Services
Uplifting Scrum Master Services
 
Black Belt Scrum Master
Black Belt Scrum MasterBlack Belt Scrum Master
Black Belt Scrum Master
 
Scrum checklists
Scrum checklistsScrum checklists
Scrum checklists
 
Secrets of a Scrum Master! Agile Practices for the Service Desk
Secrets of a Scrum Master! Agile Practices for the Service DeskSecrets of a Scrum Master! Agile Practices for the Service Desk
Secrets of a Scrum Master! Agile Practices for the Service Desk
 
[DevDay 2016] Secret tools for a Scrum Team - Speaker: Sebastian Sussman – CI...
[DevDay 2016] Secret tools for a Scrum Team - Speaker: Sebastian Sussman – CI...[DevDay 2016] Secret tools for a Scrum Team - Speaker: Sebastian Sussman – CI...
[DevDay 2016] Secret tools for a Scrum Team - Speaker: Sebastian Sussman – CI...
 
[DevDay 2016] OpenStack and approaches for new users - Speaker: Chi Le – Head...
[DevDay 2016] OpenStack and approaches for new users - Speaker: Chi Le – Head...[DevDay 2016] OpenStack and approaches for new users - Speaker: Chi Le – Head...
[DevDay 2016] OpenStack and approaches for new users - Speaker: Chi Le – Head...
 
[DevDay 2016] Da Nang Software Industry & Job Opportunities for Students - Sp...
[DevDay 2016] Da Nang Software Industry & Job Opportunities for Students - Sp...[DevDay 2016] Da Nang Software Industry & Job Opportunities for Students - Sp...
[DevDay 2016] Da Nang Software Industry & Job Opportunities for Students - Sp...
 
[DevDay 2016] Build your next awesome game with Unity - Speaker: Trung Ngo –...
 [DevDay 2016] Build your next awesome game with Unity - Speaker: Trung Ngo –... [DevDay 2016] Build your next awesome game with Unity - Speaker: Trung Ngo –...
[DevDay 2016] Build your next awesome game with Unity - Speaker: Trung Ngo –...
 
Scrum checklist
Scrum checklistScrum checklist
Scrum checklist
 
Agile project management in IT - Sebastian Sussmann
Agile project management in IT - Sebastian SussmannAgile project management in IT - Sebastian Sussmann
Agile project management in IT - Sebastian Sussmann
 

Similar to [DevDay 2016] Design Pattern at a glance - Speaker: Tuan Do – Scrum Master at Axon Active Vietnam

Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptRushikeshChikane1
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptRushikeshChikane2
 
SE2016 Java Alex Theedom "Java EE revisits design patterns"
SE2016 Java Alex Theedom "Java EE revisits design patterns"SE2016 Java Alex Theedom "Java EE revisits design patterns"
SE2016 Java Alex Theedom "Java EE revisits design patterns"Inhacking
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2Julie Iskander
 
SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016Alex Theedom
 
Java EE Revisits Design Patterns
Java EE Revisits Design PatternsJava EE Revisits Design Patterns
Java EE Revisits Design PatternsAlex Theedom
 
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternTalentica Software
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patternsAlex Theedom
 
Design Pattern Zoology
Design Pattern ZoologyDesign Pattern Zoology
Design Pattern ZoologyJosh Adell
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns Alex Theedom
 
Design patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and designDesign patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and designKamran Haider
 
Segue to design patterns
Segue to design patternsSegue to design patterns
Segue to design patternsRahul Singh
 
JavaScripters Event Sep 17, 2016 · 2:00 PM: Scalable Javascript Design Patterns
JavaScripters Event Sep 17, 2016 · 2:00 PM: Scalable Javascript Design PatternsJavaScripters Event Sep 17, 2016 · 2:00 PM: Scalable Javascript Design Patterns
JavaScripters Event Sep 17, 2016 · 2:00 PM: Scalable Javascript Design PatternsJavaScripters Community
 
Clean code presentation
Clean code presentationClean code presentation
Clean code presentationBhavin Gandhi
 
ZendCon 2011 UnCon Domain-Driven Design
ZendCon 2011 UnCon Domain-Driven DesignZendCon 2011 UnCon Domain-Driven Design
ZendCon 2011 UnCon Domain-Driven DesignBradley Holt
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design Allan Mangune
 
Attain Clean Code in Sitecore Solutions using Design Patterns
Attain Clean Code in Sitecore Solutions using Design PatternsAttain Clean Code in Sitecore Solutions using Design Patterns
Attain Clean Code in Sitecore Solutions using Design PatternsMichael Reynolds
 

Similar to [DevDay 2016] Design Pattern at a glance - Speaker: Tuan Do – Scrum Master at Axon Active Vietnam (20)

Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.ppt
 
Chapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.pptChapter 4_Introduction to Patterns.ppt
Chapter 4_Introduction to Patterns.ppt
 
Decorator Pattern
Decorator PatternDecorator Pattern
Decorator Pattern
 
SE2016 Java Alex Theedom "Java EE revisits design patterns"
SE2016 Java Alex Theedom "Java EE revisits design patterns"SE2016 Java Alex Theedom "Java EE revisits design patterns"
SE2016 Java Alex Theedom "Java EE revisits design patterns"
 
Alex Theedom Java ee revisits design patterns
Alex Theedom	Java ee revisits design patternsAlex Theedom	Java ee revisits design patterns
Alex Theedom Java ee revisits design patterns
 
Design p atterns
Design p atternsDesign p atterns
Design p atterns
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
 
SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016
 
Java EE Revisits Design Patterns
Java EE Revisits Design PatternsJava EE Revisits Design Patterns
Java EE Revisits Design Patterns
 
Nodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design PatternNodejs Chapter 3 - Design Pattern
Nodejs Chapter 3 - Design Pattern
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patterns
 
Design Pattern Zoology
Design Pattern ZoologyDesign Pattern Zoology
Design Pattern Zoology
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns
 
Design patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and designDesign patterns in Object oriented analysis and design
Design patterns in Object oriented analysis and design
 
Segue to design patterns
Segue to design patternsSegue to design patterns
Segue to design patterns
 
JavaScripters Event Sep 17, 2016 · 2:00 PM: Scalable Javascript Design Patterns
JavaScripters Event Sep 17, 2016 · 2:00 PM: Scalable Javascript Design PatternsJavaScripters Event Sep 17, 2016 · 2:00 PM: Scalable Javascript Design Patterns
JavaScripters Event Sep 17, 2016 · 2:00 PM: Scalable Javascript Design Patterns
 
Clean code presentation
Clean code presentationClean code presentation
Clean code presentation
 
ZendCon 2011 UnCon Domain-Driven Design
ZendCon 2011 UnCon Domain-Driven DesignZendCon 2011 UnCon Domain-Driven Design
ZendCon 2011 UnCon Domain-Driven Design
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
 
Attain Clean Code in Sitecore Solutions using Design Patterns
Attain Clean Code in Sitecore Solutions using Design PatternsAttain Clean Code in Sitecore Solutions using Design Patterns
Attain Clean Code in Sitecore Solutions using Design Patterns
 

More from DevDay.org

[DevDay2019] Lean UX - By Bryant Castro, Bryant Castro at Wizeline
[DevDay2019] Lean UX - By  Bryant Castro,  Bryant Castro at Wizeline[DevDay2019] Lean UX - By  Bryant Castro,  Bryant Castro at Wizeline
[DevDay2019] Lean UX - By Bryant Castro, Bryant Castro at WizelineDevDay.org
 
[DevDay2019] Why you'll lose without UX Design - By Szilard Toth, CTO at e·pi...
[DevDay2019] Why you'll lose without UX Design - By Szilard Toth, CTO at e·pi...[DevDay2019] Why you'll lose without UX Design - By Szilard Toth, CTO at e·pi...
[DevDay2019] Why you'll lose without UX Design - By Szilard Toth, CTO at e·pi...DevDay.org
 
[DevDay2019] Things i wish I knew when I was a 23-year-old Developer - By Chr...
[DevDay2019] Things i wish I knew when I was a 23-year-old Developer - By Chr...[DevDay2019] Things i wish I knew when I was a 23-year-old Developer - By Chr...
[DevDay2019] Things i wish I knew when I was a 23-year-old Developer - By Chr...DevDay.org
 
[DevDay2019] Designing design teams - Christopher Nguyen, UX Manager at Wizeline
[DevDay2019] Designing design teams - Christopher Nguyen, UX Manager at Wizeline[DevDay2019] Designing design teams - Christopher Nguyen, UX Manager at Wizeline
[DevDay2019] Designing design teams - Christopher Nguyen, UX Manager at WizelineDevDay.org
 
[DevDay2019] Growth Hacking - How to double the benefits of your startup with...
[DevDay2019] Growth Hacking - How to double the benefits of your startup with...[DevDay2019] Growth Hacking - How to double the benefits of your startup with...
[DevDay2019] Growth Hacking - How to double the benefits of your startup with...DevDay.org
 
[DevDay2019] Collaborate or die: The designers’ guide to working with develop...
[DevDay2019] Collaborate or die: The designers’ guide to working with develop...[DevDay2019] Collaborate or die: The designers’ guide to working with develop...
[DevDay2019] Collaborate or die: The designers’ guide to working with develop...DevDay.org
 
[DevDay2019] How AI is changing the future of Software Testing? - By Vui Nguy...
[DevDay2019] How AI is changing the future of Software Testing? - By Vui Nguy...[DevDay2019] How AI is changing the future of Software Testing? - By Vui Nguy...
[DevDay2019] How AI is changing the future of Software Testing? - By Vui Nguy...DevDay.org
 
[DevDay2019] Hands-on Machine Learning on Google Cloud Platform - By Thanh Le...
[DevDay2019] Hands-on Machine Learning on Google Cloud Platform - By Thanh Le...[DevDay2019] Hands-on Machine Learning on Google Cloud Platform - By Thanh Le...
[DevDay2019] Hands-on Machine Learning on Google Cloud Platform - By Thanh Le...DevDay.org
 
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...DevDay.org
 
[DevDay2019] Power of Test Automation and DevOps combination - One click savi...
[DevDay2019] Power of Test Automation and DevOps combination - One click savi...[DevDay2019] Power of Test Automation and DevOps combination - One click savi...
[DevDay2019] Power of Test Automation and DevOps combination - One click savi...DevDay.org
 
[DevDay2019] How do I test AI models? - By Minh Hoang, Senior QA Engineer at KMS
[DevDay2019] How do I test AI models? - By Minh Hoang, Senior QA Engineer at KMS[DevDay2019] How do I test AI models? - By Minh Hoang, Senior QA Engineer at KMS
[DevDay2019] How do I test AI models? - By Minh Hoang, Senior QA Engineer at KMSDevDay.org
 
[DevDay2019] How to quickly become a Senior Engineer - By Tran Anh Minh, CEO ...
[DevDay2019] How to quickly become a Senior Engineer - By Tran Anh Minh, CEO ...[DevDay2019] How to quickly become a Senior Engineer - By Tran Anh Minh, CEO ...
[DevDay2019] How to quickly become a Senior Engineer - By Tran Anh Minh, CEO ...DevDay.org
 
[Devday2019] Dev start-up - By Le Trung, Founder & CEO at Hifiveplus and Edu...
[Devday2019]  Dev start-up - By Le Trung, Founder & CEO at Hifiveplus and Edu...[Devday2019]  Dev start-up - By Le Trung, Founder & CEO at Hifiveplus and Edu...
[Devday2019] Dev start-up - By Le Trung, Founder & CEO at Hifiveplus and Edu...DevDay.org
 
[DevDay2019] Web Development In 2019 - A Practical Guide - By Hoang Nhu Vinh,...
[DevDay2019] Web Development In 2019 - A Practical Guide - By Hoang Nhu Vinh,...[DevDay2019] Web Development In 2019 - A Practical Guide - By Hoang Nhu Vinh,...
[DevDay2019] Web Development In 2019 - A Practical Guide - By Hoang Nhu Vinh,...DevDay.org
 
[DevDay2019] Opportunities and challenges for human resources during the digi...
[DevDay2019] Opportunities and challenges for human resources during the digi...[DevDay2019] Opportunities and challenges for human resources during the digi...
[DevDay2019] Opportunities and challenges for human resources during the digi...DevDay.org
 
[DevDay2019] Python Machine Learning with Jupyter Notebook - By Nguyen Huu Th...
[DevDay2019] Python Machine Learning with Jupyter Notebook - By Nguyen Huu Th...[DevDay2019] Python Machine Learning with Jupyter Notebook - By Nguyen Huu Th...
[DevDay2019] Python Machine Learning with Jupyter Notebook - By Nguyen Huu Th...DevDay.org
 
[DevDay2019] Do you dockerize? Are your containers safe? - By Pham Hong Khanh...
[DevDay2019] Do you dockerize? Are your containers safe? - By Pham Hong Khanh...[DevDay2019] Do you dockerize? Are your containers safe? - By Pham Hong Khanh...
[DevDay2019] Do you dockerize? Are your containers safe? - By Pham Hong Khanh...DevDay.org
 
[DevDay2019] Develop a web application with Kubernetes - By Nguyen Xuan Phong...
[DevDay2019] Develop a web application with Kubernetes - By Nguyen Xuan Phong...[DevDay2019] Develop a web application with Kubernetes - By Nguyen Xuan Phong...
[DevDay2019] Develop a web application with Kubernetes - By Nguyen Xuan Phong...DevDay.org
 
[DevDay2019] Paradigm shift towards effective Scrum - By Tam Doan, Agile Coac...
[DevDay2019] Paradigm shift towards effective Scrum - By Tam Doan, Agile Coac...[DevDay2019] Paradigm shift towards effective Scrum - By Tam Doan, Agile Coac...
[DevDay2019] Paradigm shift towards effective Scrum - By Tam Doan, Agile Coac...DevDay.org
 
[DevDay2019] JAM Stack - By Ngo Thi Ni, Web Developer at Agility IO
[DevDay2019] JAM Stack - By Ngo Thi Ni, Web Developer at Agility IO[DevDay2019] JAM Stack - By Ngo Thi Ni, Web Developer at Agility IO
[DevDay2019] JAM Stack - By Ngo Thi Ni, Web Developer at Agility IODevDay.org
 

More from DevDay.org (20)

[DevDay2019] Lean UX - By Bryant Castro, Bryant Castro at Wizeline
[DevDay2019] Lean UX - By  Bryant Castro,  Bryant Castro at Wizeline[DevDay2019] Lean UX - By  Bryant Castro,  Bryant Castro at Wizeline
[DevDay2019] Lean UX - By Bryant Castro, Bryant Castro at Wizeline
 
[DevDay2019] Why you'll lose without UX Design - By Szilard Toth, CTO at e·pi...
[DevDay2019] Why you'll lose without UX Design - By Szilard Toth, CTO at e·pi...[DevDay2019] Why you'll lose without UX Design - By Szilard Toth, CTO at e·pi...
[DevDay2019] Why you'll lose without UX Design - By Szilard Toth, CTO at e·pi...
 
[DevDay2019] Things i wish I knew when I was a 23-year-old Developer - By Chr...
[DevDay2019] Things i wish I knew when I was a 23-year-old Developer - By Chr...[DevDay2019] Things i wish I knew when I was a 23-year-old Developer - By Chr...
[DevDay2019] Things i wish I knew when I was a 23-year-old Developer - By Chr...
 
[DevDay2019] Designing design teams - Christopher Nguyen, UX Manager at Wizeline
[DevDay2019] Designing design teams - Christopher Nguyen, UX Manager at Wizeline[DevDay2019] Designing design teams - Christopher Nguyen, UX Manager at Wizeline
[DevDay2019] Designing design teams - Christopher Nguyen, UX Manager at Wizeline
 
[DevDay2019] Growth Hacking - How to double the benefits of your startup with...
[DevDay2019] Growth Hacking - How to double the benefits of your startup with...[DevDay2019] Growth Hacking - How to double the benefits of your startup with...
[DevDay2019] Growth Hacking - How to double the benefits of your startup with...
 
[DevDay2019] Collaborate or die: The designers’ guide to working with develop...
[DevDay2019] Collaborate or die: The designers’ guide to working with develop...[DevDay2019] Collaborate or die: The designers’ guide to working with develop...
[DevDay2019] Collaborate or die: The designers’ guide to working with develop...
 
[DevDay2019] How AI is changing the future of Software Testing? - By Vui Nguy...
[DevDay2019] How AI is changing the future of Software Testing? - By Vui Nguy...[DevDay2019] How AI is changing the future of Software Testing? - By Vui Nguy...
[DevDay2019] How AI is changing the future of Software Testing? - By Vui Nguy...
 
[DevDay2019] Hands-on Machine Learning on Google Cloud Platform - By Thanh Le...
[DevDay2019] Hands-on Machine Learning on Google Cloud Platform - By Thanh Le...[DevDay2019] Hands-on Machine Learning on Google Cloud Platform - By Thanh Le...
[DevDay2019] Hands-on Machine Learning on Google Cloud Platform - By Thanh Le...
 
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
 
[DevDay2019] Power of Test Automation and DevOps combination - One click savi...
[DevDay2019] Power of Test Automation and DevOps combination - One click savi...[DevDay2019] Power of Test Automation and DevOps combination - One click savi...
[DevDay2019] Power of Test Automation and DevOps combination - One click savi...
 
[DevDay2019] How do I test AI models? - By Minh Hoang, Senior QA Engineer at KMS
[DevDay2019] How do I test AI models? - By Minh Hoang, Senior QA Engineer at KMS[DevDay2019] How do I test AI models? - By Minh Hoang, Senior QA Engineer at KMS
[DevDay2019] How do I test AI models? - By Minh Hoang, Senior QA Engineer at KMS
 
[DevDay2019] How to quickly become a Senior Engineer - By Tran Anh Minh, CEO ...
[DevDay2019] How to quickly become a Senior Engineer - By Tran Anh Minh, CEO ...[DevDay2019] How to quickly become a Senior Engineer - By Tran Anh Minh, CEO ...
[DevDay2019] How to quickly become a Senior Engineer - By Tran Anh Minh, CEO ...
 
[Devday2019] Dev start-up - By Le Trung, Founder & CEO at Hifiveplus and Edu...
[Devday2019]  Dev start-up - By Le Trung, Founder & CEO at Hifiveplus and Edu...[Devday2019]  Dev start-up - By Le Trung, Founder & CEO at Hifiveplus and Edu...
[Devday2019] Dev start-up - By Le Trung, Founder & CEO at Hifiveplus and Edu...
 
[DevDay2019] Web Development In 2019 - A Practical Guide - By Hoang Nhu Vinh,...
[DevDay2019] Web Development In 2019 - A Practical Guide - By Hoang Nhu Vinh,...[DevDay2019] Web Development In 2019 - A Practical Guide - By Hoang Nhu Vinh,...
[DevDay2019] Web Development In 2019 - A Practical Guide - By Hoang Nhu Vinh,...
 
[DevDay2019] Opportunities and challenges for human resources during the digi...
[DevDay2019] Opportunities and challenges for human resources during the digi...[DevDay2019] Opportunities and challenges for human resources during the digi...
[DevDay2019] Opportunities and challenges for human resources during the digi...
 
[DevDay2019] Python Machine Learning with Jupyter Notebook - By Nguyen Huu Th...
[DevDay2019] Python Machine Learning with Jupyter Notebook - By Nguyen Huu Th...[DevDay2019] Python Machine Learning with Jupyter Notebook - By Nguyen Huu Th...
[DevDay2019] Python Machine Learning with Jupyter Notebook - By Nguyen Huu Th...
 
[DevDay2019] Do you dockerize? Are your containers safe? - By Pham Hong Khanh...
[DevDay2019] Do you dockerize? Are your containers safe? - By Pham Hong Khanh...[DevDay2019] Do you dockerize? Are your containers safe? - By Pham Hong Khanh...
[DevDay2019] Do you dockerize? Are your containers safe? - By Pham Hong Khanh...
 
[DevDay2019] Develop a web application with Kubernetes - By Nguyen Xuan Phong...
[DevDay2019] Develop a web application with Kubernetes - By Nguyen Xuan Phong...[DevDay2019] Develop a web application with Kubernetes - By Nguyen Xuan Phong...
[DevDay2019] Develop a web application with Kubernetes - By Nguyen Xuan Phong...
 
[DevDay2019] Paradigm shift towards effective Scrum - By Tam Doan, Agile Coac...
[DevDay2019] Paradigm shift towards effective Scrum - By Tam Doan, Agile Coac...[DevDay2019] Paradigm shift towards effective Scrum - By Tam Doan, Agile Coac...
[DevDay2019] Paradigm shift towards effective Scrum - By Tam Doan, Agile Coac...
 
[DevDay2019] JAM Stack - By Ngo Thi Ni, Web Developer at Agility IO
[DevDay2019] JAM Stack - By Ngo Thi Ni, Web Developer at Agility IO[DevDay2019] JAM Stack - By Ngo Thi Ni, Web Developer at Agility IO
[DevDay2019] JAM Stack - By Ngo Thi Ni, Web Developer at Agility IO
 

Recently uploaded

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

[DevDay 2016] Design Pattern at a glance - Speaker: Tuan Do – Scrum Master at Axon Active Vietnam

  • 1.
  • 3. I’m Tuan • Live in Da Nang. • Working in Axon Active Vietnam. • 6 years in development • Scrum Master, Team Leader, Software Engineer. • Java, Javascript, Code Generator. tuan.do@axonactive.com
  • 4. Questions • Who joined Devday Da Nang 2015 ? • Who knows about refactoring ? • Who knows about clean code ?
  • 5. Design Pattern 
 at a glance –Do Minh Tuan
  • 6. What is a design pattern ? “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice” - Christopher Wolfgang Alexander (1936)
  • 7. Elements of Pattern The pattern name The problem The consequences The solution PATTERN
  • 8. Advantages of Pattern • Enhances code readability. • Robust, Scalable. • Enhances software development. • Well-structured system. • Well-tested system.
  • 13. How to select a design pattern
  • 14. How design patterns solve design problems • Finding appropriate objects. • Determining Object Granularity. • Specifying Object Interfaces. • Specifying Object Implementations.
  • 15. How to use a design pattern (1 of 2) • Read the pattern. • Study the structure, participants and collaborations sections. • Sample code of pattern • Choose names for pattern participants that are meaningful in the application context.
  • 16. How to use a design pattern (2 of 2) • Define the classes. • Define application-specific names for operations in the pattern. • Implement the operations to carry out the responsibillities and collaborations in the pattern.
  • 17.
  • 18. “Famous” Patterns • Creational • Abstract Factory • Factory Method • Structural • Adapter • Composite • Decorator • Behavioral • Observer • Strategy • Template Method
  • 19. “Famous” Patterns • Creational • Abstract Factory • Factory Method • Structural • Adapter • Composite • Decorator • Behavioral • Observer • Strategy • Template Method
  • 20. Abstract Factory “Provide an interface for creating families of related or dependent objects without specifying their concrete classes.”
  • 21.
  • 22. “Famous” Patterns • Creational • Abstract Factory • Factory Method • Structural • Adapter • Composite • Decorator • Behavioral • Observer • Strategy • Template Method
  • 23. Factory Method “Define an interface for creating an object, but let subclasses decide which class to instantance. Factory Method lets a class defer instantiation to subclasses.”
  • 24.
  • 25. Demo
  • 26. Abstract Factory • It isolates concrete classes. • It makes exchanging product famillies easy. • It promotes consistency among products. • Supporting new kinds of products is difficult.
  • 27. Factory Method • Provides hooks for subclasses. • Connects parallel class hierarchies.
  • 28. “Famous” Patterns • Creational • Abstract Factory • Factory Method • Structural • Adapter • Composite • Decorator • Behavioral • Observer • Strategy • Template Method
  • 29. Adapter “Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.”
  • 30.
  • 31. Demo
  • 32. Adapter • How much adapting does Adapter do ? • Pluggable adapters. • Using two-way adapters to provide transparent.
  • 33. “Famous” Patterns • Creational • Abstract Factory • Factory Method • Structural • Adapter • Composite • Decorator • Behavioral • Observer • Strategy • Template Method
  • 34. Composite “Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.”
  • 35.
  • 36. Demo
  • 37. Composite • Defines class hierarchies consisting of primitive objects and composite objects. • Make the client simple. • Make it easier to add new kinds of components. • Can make your design overly general.
  • 38. “Famous” Patterns • Creational • Abstract Factory • Factory Method • Structural • Adapter • Composite • Decorator • Behavioral Pattern • Observer • Strategy • Template Method
  • 39. Decorator “Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.”
  • 40.
  • 41. Demo
  • 42. Decorator • More flexibility than static inheritance. • Avoids feature-laden classes high up in the hierarchy. • A decorator and it’s component aren’t critical. • Lost of little objects.
  • 43. “Famous” Patterns • Creational • Abstract Factory • Factory Method • Structural • Adapter • Composite • Decorator • Behavioral • Observer • Strategy • Template Method
  • 44. Observer “Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.”
  • 45.
  • 46. Demo
  • 47. Observer • Abstract coupling between Subject and Observer. • Support for broadcast communication. • Unexpected updates. • Lost of little objects.
  • 48. “Famous” Patterns • Creational • Abstract Factory • Factory Method • Structural • Adapter • Composite • Decorator • Behavioral • Observer • Strategy • Template Method
  • 49. Strategy “Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.”
  • 50.
  • 51. Demo
  • 52. Strategy • Families of related algorithms. • An alternative to subclassing. • Strategies eliminates conditional statements. • Clients must be aware of different Strategies. • Communication overhead between Strategy and Context. • Increased number of objects.
  • 53. “Famous” Patterns • Creational • Abstract Factory • Factory Method • Structural • Adapter • Composite • Decorator • Behavioral • Observer • Strategy • Template Method
  • 54. Template Method “Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s structure.”
  • 55.
  • 56. Demo
  • 59. The gang of Four(GoF)
 Raph Johnson, Erich Gamma, Richard Helm, John Vlissides
  • 60.