SlideShare a Scribd company logo
02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Contenido 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Design Patterns Describing recurring solutions to common problems in software design.  the capabilities and pitfalls of object-oriented programming,  and describing 23 classic  software design patterns .  02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
23 classic  software design patterns . Creational patterns Abstract Builder Factory Method Prototype Singleton Structural patterns Adapter Bridge Composite Decorator Facade Flyweight Proxy Behavioral patterns Chain of responsibility Command Interpreter Iterator Mediator Memento Observer State Strategy Template method Visitor 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Creational patterns These patterns have to do with class instantiation.  class-creation patterns and (use inheritance effectively) object-creational patterns (use delegation) 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Creational patterns Abstract Factory  groups object factories that have a common theme. Builder  constructs complex objects by separating construction and representation. Factory Method  creates objects without specifying the exact class to create. Prototype  creates objects by cloning an existing object. Singleton  restricts object creation for a class to only one instance. 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Factory Method 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
The  factory method pattern is an  object-oriented   design pattern .  it deals with the problem of creating  objects  (products) without specifying the exact  class  of object that will be created.  defining a separate  method  for creating the objects which  subclasses  can then override to specify the  derived type  of product that will be created.  02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
ActionScript applications that have multiple classes public class Client { public function doSomething( ) { var object:Object = new Product( ); object.manipulate( ); } } 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
dependency between the Client and Product classes There’s nothing wrong with this code, but it does create a  coupling o r  dependency between the Client and Product classes. Any changes to the Product class in terms of class name changes or change in the number of  parameters passed to it  will require changes in the Client class as well. 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Model of the Factory Method Pattern 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia Client Creator Product 1 * * 1 uses create
public class Creator { public static function simpleFactory(product:String) { if (product == "p1") { return new product1( ); } else if (product == "p2") { return new product2( ); } } } 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Classic factory method pattern 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Classic factory method pattern Interfaces and not concrete classes A pure interface does not provide any implementation for declared methods.  Abstract interfaces can provide default implementations  for methods.  They’re also called  abstract classes, and cannot be instantiated,  but can be extended by other classes. 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Singleton pattern is a  design pattern  that is used to restrict  instantiation  of a class to one  object .  This is useful when exactly one object is needed to coordinate actions across the system. Sometimes it is generalized to systems that operate more efficiently when only one or a few objects exist.  It is also considered an  anti-pattern  since it is often used as a  euphemism  for  global variable . 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia
Singleton pattern 02/06/09 Juan Carlos Giraldo Cardozo  Programación Multimedia

More Related Content

What's hot (20)

PPTX
Design Patterns - Abstract Factory Pattern
Mudasir Qazi
 
PPTX
The Singleton Pattern Presentation
JAINIK PATEL
 
PPTX
Decorator Pattern
Dimuthu Anuraj
 
PPTX
Proxy Design Pattern
Anjan Kumar Bollam
 
PPT
Builder pattern
Shakil Ahmed
 
PDF
Design Patterns Presentation - Chetan Gole
Chetan Gole
 
PPT
Introduction to Design Patterns and Singleton
Jonathan Simon
 
PPTX
Singleton Design Pattern - Creation Pattern
Seerat Malik
 
PPT
Factory and Abstract Factory
Jonathan Simon
 
PPT
Padrão de Projetos singleton
Wendel Moreira
 
PPT
Proxy pattern
Shakil Ahmed
 
PPTX
Factory Design Pattern
Jaswant Singh
 
PPT
Introduction to ADO.NET
rchakra
 
PDF
Design patterns
abhisheksagi
 
PPT
Design Pattern For C# Part 1
Shahzad
 
PPTX
Singleton Pattern (Sole Object with Global Access)
Sameer Rathoud
 
PDF
Builder Design Pattern (Generic Construction -Different Representation)
Sameer Rathoud
 
PPTX
Multithreading in java
Arafat Hossan
 
PPT
Composite pattern
Shakil Ahmed
 
PPTX
Design Pattern - Singleton Pattern
Mudasir Qazi
 
Design Patterns - Abstract Factory Pattern
Mudasir Qazi
 
The Singleton Pattern Presentation
JAINIK PATEL
 
Decorator Pattern
Dimuthu Anuraj
 
Proxy Design Pattern
Anjan Kumar Bollam
 
Builder pattern
Shakil Ahmed
 
Design Patterns Presentation - Chetan Gole
Chetan Gole
 
Introduction to Design Patterns and Singleton
Jonathan Simon
 
Singleton Design Pattern - Creation Pattern
Seerat Malik
 
Factory and Abstract Factory
Jonathan Simon
 
Padrão de Projetos singleton
Wendel Moreira
 
Proxy pattern
Shakil Ahmed
 
Factory Design Pattern
Jaswant Singh
 
Introduction to ADO.NET
rchakra
 
Design patterns
abhisheksagi
 
Design Pattern For C# Part 1
Shahzad
 
Singleton Pattern (Sole Object with Global Access)
Sameer Rathoud
 
Builder Design Pattern (Generic Construction -Different Representation)
Sameer Rathoud
 
Multithreading in java
Arafat Hossan
 
Composite pattern
Shakil Ahmed
 
Design Pattern - Singleton Pattern
Mudasir Qazi
 

Similar to Factory Method Pattern (20)

PPT
P Training Presentation
Gaurav Tyagi
 
PPT
Unit 2-Design Patterns.ppt
MsRAMYACSE
 
PDF
27418524 design-patterns-dot-net-with-examples
Quang Suma
 
PDF
Design patterns in javascript
Ayush Sharma
 
PDF
Creational Design Patterns
Jamie (Taka) Wang
 
PPTX
Factory Method Pattern
Anjan Kumar Bollam
 
PDF
03-Factory Method for design patterns.pdf
ssusera587d2
 
PDF
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Nicolas HAAN
 
PPTX
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Luis Valencia
 
PPTX
Software Architecture and Design Patterns Notes.pptx
VivekanandaGN2
 
PPT
Software Design Patterns
Pankhuree Srivastava
 
PPT
Design Patterns
Rafael Coutinho
 
PPTX
Sda 8
AmberMughal5
 
PPTX
Sofwear deasign and need of design pattern
chetankane
 
DOCX
Patterns (contd)Software Development ProcessDesign patte.docx
danhaley45372
 
PPT
Introduction To Design Patterns
sukumarraju6
 
PPT
Introduction to design_patterns
amitarcade
 
PDF
cf.Objective() 2017 - Design patterns - Brad Wood
Ortus Solutions, Corp
 
PPTX
10 ways to make your code rock
martincronje
 
PPT
Design pattern
Shreyance Jain
 
P Training Presentation
Gaurav Tyagi
 
Unit 2-Design Patterns.ppt
MsRAMYACSE
 
27418524 design-patterns-dot-net-with-examples
Quang Suma
 
Design patterns in javascript
Ayush Sharma
 
Creational Design Patterns
Jamie (Taka) Wang
 
Factory Method Pattern
Anjan Kumar Bollam
 
03-Factory Method for design patterns.pdf
ssusera587d2
 
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
Nicolas HAAN
 
Typescript design patterns applied to sharepoint framework - Sharepoint Satur...
Luis Valencia
 
Software Architecture and Design Patterns Notes.pptx
VivekanandaGN2
 
Software Design Patterns
Pankhuree Srivastava
 
Design Patterns
Rafael Coutinho
 
Sofwear deasign and need of design pattern
chetankane
 
Patterns (contd)Software Development ProcessDesign patte.docx
danhaley45372
 
Introduction To Design Patterns
sukumarraju6
 
Introduction to design_patterns
amitarcade
 
cf.Objective() 2017 - Design patterns - Brad Wood
Ortus Solutions, Corp
 
10 ways to make your code rock
martincronje
 
Design pattern
Shreyance Jain
 
Ad

More from Juan Carlos Giraldo Cardozo (20)

PPSX
2022 03 03 plan de curso i+d de ade sue caribe - jucagi
Juan Carlos Giraldo Cardozo
 
PPTX
Informe de permanencia y graduación de la Licenciatura en Informática de la U...
Juan Carlos Giraldo Cardozo
 
PPTX
Presentación área de informática LIEMAV
Juan Carlos Giraldo Cardozo
 
PDF
Presentación Área Práctica Pedagógica Investigativa
Juan Carlos Giraldo Cardozo
 
PDF
Lineamientos practica pedagógica Universidad de Córdoba
Juan Carlos Giraldo Cardozo
 
PDF
Cambios en el contexto educativo con miras al 2030
Juan Carlos Giraldo Cardozo
 
PPTX
Cambios en el Contexto Educativo hacia 2030
Juan Carlos Giraldo Cardozo
 
PDF
2017 08 07 presentación xiii congreso ribie unicor agosto 2017 conferencistas
Juan Carlos Giraldo Cardozo
 
PDF
2017 08 07 Libreta para XIII Congreso RIBIE Unicordoba
Juan Carlos Giraldo Cardozo
 
PPTX
2017 08 03 presentación xiii congreso ribie unicor agosto 2017 conferencistas
Juan Carlos Giraldo Cardozo
 
PPTX
Estrategias de enseñanza – aprendizaje mediados por tic
Juan Carlos Giraldo Cardozo
 
PPTX
Limav Fest 2015 programación
Juan Carlos Giraldo Cardozo
 
PDF
Limav fest 2015 Programación
Juan Carlos Giraldo Cardozo
 
PPTX
Orientaciones a evaluadores de Semilleros de Investigación RedCOLSI, Nodo Cór...
Juan Carlos Giraldo Cardozo
 
PPTX
Presentación redCOLSI Nodo Córdoba 2014
Juan Carlos Giraldo Cardozo
 
PPTX
JuEGAS ProVEAS MultiFuncional _ Grupo AVI
Juan Carlos Giraldo Cardozo
 
PPTX
Técnicas de inteligencia computacional
Juan Carlos Giraldo Cardozo
 
PPTX
Investigación acción guia
Juan Carlos Giraldo Cardozo
 
PPTX
SEMLI RibieCol 2010 Grupo AVI
Juan Carlos Giraldo Cardozo
 
PDF
Portafolio de servicios avi 2012 última versión (1)
Juan Carlos Giraldo Cardozo
 
2022 03 03 plan de curso i+d de ade sue caribe - jucagi
Juan Carlos Giraldo Cardozo
 
Informe de permanencia y graduación de la Licenciatura en Informática de la U...
Juan Carlos Giraldo Cardozo
 
Presentación área de informática LIEMAV
Juan Carlos Giraldo Cardozo
 
Presentación Área Práctica Pedagógica Investigativa
Juan Carlos Giraldo Cardozo
 
Lineamientos practica pedagógica Universidad de Córdoba
Juan Carlos Giraldo Cardozo
 
Cambios en el contexto educativo con miras al 2030
Juan Carlos Giraldo Cardozo
 
Cambios en el Contexto Educativo hacia 2030
Juan Carlos Giraldo Cardozo
 
2017 08 07 presentación xiii congreso ribie unicor agosto 2017 conferencistas
Juan Carlos Giraldo Cardozo
 
2017 08 07 Libreta para XIII Congreso RIBIE Unicordoba
Juan Carlos Giraldo Cardozo
 
2017 08 03 presentación xiii congreso ribie unicor agosto 2017 conferencistas
Juan Carlos Giraldo Cardozo
 
Estrategias de enseñanza – aprendizaje mediados por tic
Juan Carlos Giraldo Cardozo
 
Limav Fest 2015 programación
Juan Carlos Giraldo Cardozo
 
Limav fest 2015 Programación
Juan Carlos Giraldo Cardozo
 
Orientaciones a evaluadores de Semilleros de Investigación RedCOLSI, Nodo Cór...
Juan Carlos Giraldo Cardozo
 
Presentación redCOLSI Nodo Córdoba 2014
Juan Carlos Giraldo Cardozo
 
JuEGAS ProVEAS MultiFuncional _ Grupo AVI
Juan Carlos Giraldo Cardozo
 
Técnicas de inteligencia computacional
Juan Carlos Giraldo Cardozo
 
Investigación acción guia
Juan Carlos Giraldo Cardozo
 
SEMLI RibieCol 2010 Grupo AVI
Juan Carlos Giraldo Cardozo
 
Portafolio de servicios avi 2012 última versión (1)
Juan Carlos Giraldo Cardozo
 
Ad

Recently uploaded (20)

PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 

Factory Method Pattern

  • 1. 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 2. Contenido 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 3. Design Patterns Describing recurring solutions to common problems in software design. the capabilities and pitfalls of object-oriented programming, and describing 23 classic software design patterns . 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 4. 23 classic software design patterns . Creational patterns Abstract Builder Factory Method Prototype Singleton Structural patterns Adapter Bridge Composite Decorator Facade Flyweight Proxy Behavioral patterns Chain of responsibility Command Interpreter Iterator Mediator Memento Observer State Strategy Template method Visitor 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 5. Creational patterns These patterns have to do with class instantiation. class-creation patterns and (use inheritance effectively) object-creational patterns (use delegation) 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 6. Creational patterns Abstract Factory groups object factories that have a common theme. Builder constructs complex objects by separating construction and representation. Factory Method creates objects without specifying the exact class to create. Prototype creates objects by cloning an existing object. Singleton restricts object creation for a class to only one instance. 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 7. Factory Method 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 8. The factory method pattern is an object-oriented design pattern . it deals with the problem of creating objects (products) without specifying the exact class of object that will be created. defining a separate method for creating the objects which subclasses can then override to specify the derived type of product that will be created. 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 9. ActionScript applications that have multiple classes public class Client { public function doSomething( ) { var object:Object = new Product( ); object.manipulate( ); } } 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 10. dependency between the Client and Product classes There’s nothing wrong with this code, but it does create a coupling o r dependency between the Client and Product classes. Any changes to the Product class in terms of class name changes or change in the number of parameters passed to it will require changes in the Client class as well. 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 11. Model of the Factory Method Pattern 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia Client Creator Product 1 * * 1 uses create
  • 12. public class Creator { public static function simpleFactory(product:String) { if (product == "p1") { return new product1( ); } else if (product == "p2") { return new product2( ); } } } 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 13. Classic factory method pattern 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 14. Classic factory method pattern Interfaces and not concrete classes A pure interface does not provide any implementation for declared methods. Abstract interfaces can provide default implementations for methods. They’re also called abstract classes, and cannot be instantiated, but can be extended by other classes. 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 15. Singleton pattern is a design pattern that is used to restrict instantiation of a class to one object . This is useful when exactly one object is needed to coordinate actions across the system. Sometimes it is generalized to systems that operate more efficiently when only one or a few objects exist. It is also considered an anti-pattern since it is often used as a euphemism for global variable . 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia
  • 16. Singleton pattern 02/06/09 Juan Carlos Giraldo Cardozo Programación Multimedia