SlideShare ist ein Scribd-Unternehmen logo
1 von 84
Someone has already solved
     your problems.
•   Abstract those that vary.
•   Program to an interface not an
    implementation.
•   Favor composition over inheritance.
•   Strive for loosely coupled designs
    between objects that interact.
•   Classes should be open for extension
    but closed for modification.
•   Depend on abstraction. Do not
    depend on concrete classes.
Restricts the instanciation of a class to one object.
Avoids polluting globals.
Allow to use ‘function’ to obtain new objects.
Used to clone objects.

In Javascript is used to create inheritance.
Decouple parts of the code in modules.

Avoid failing your full application for some little
error in one module.
Allows to execute more than one method at the
same line.

Only one instance of object is needed.
Overwritte the behaviour of one method/function
to reduce time on further executions.

Ideal for updates.
Memoize the executions that have been done.

Reduce time on expensive jobs.
Nullify
Removes all references to local variables to avoid
                 memory leaks.
Removes all references to local variables to avoid
   memory leaks when the method/function
               returns something.
Adapter
Converts the interface of a class into another
the clients expect.

Lets classes work together that couldn't otherwise
because of incompatible interfaces.
Decorator
Attach additional responsibilities to an object
dynamically.

Decorators provide a flexible alternative to
subclassing for extending functionality
Factory
Defines an interface for creating an object, but
lets subclasses decide which class to instanciate.

Factory Method lets a class defer instanciation
to subclasses.
Observer
Defines a one-to-many dependency between
objects so that when one object changes state,
all its dependents are notified and updated
automatically.
Command
Encapsulates a request as an object, thereby letting
  you parameterize other objects with different
   requests, queue or log requests, and support
               undoable operations.
Facade
Provides a unified interface to a set of interfaces
in a subsystem.

Defines a higher-level interface that makes the
subsystem easier to use
Mediator
Defines an object that encapsulates how a set of
                objects interact.
State
Allows an object to alter its behavior when its
internal state changes.

The object will appear to change its class.
Strategy
Defines a family of algorithms, encapsulates each
one, and makes them interchangeable.
Compose objects into tree structures to represent
part-whole hierarchies.

Lets clients treat individual objects and
compositions of objects uniformly.
Separates elements of the application in layers.

Logic, data and views are separated.
M.V.C
M.V.C
M.V.V.M
http://bit.ly/softhire

Weitere ähnliche Inhalte

Was ist angesagt?

React js use contexts and useContext hook
React js use contexts and useContext hookReact js use contexts and useContext hook
React js use contexts and useContext hookPiyush Jamwal
 
Data Abstraction for Large Web Applications
Data Abstraction for Large Web ApplicationsData Abstraction for Large Web Applications
Data Abstraction for Large Web Applicationsbrandonsavage
 
an Introduction to Redux
an Introduction to Reduxan Introduction to Redux
an Introduction to ReduxAmin Ashtiani
 
Mysql creating stored function
Mysql  creating stored function Mysql  creating stored function
Mysql creating stored function Prof.Nilesh Magar
 
Reactive web applications
Reactive web applicationsReactive web applications
Reactive web applicationsJuan Sandoval
 

Was ist angesagt? (8)

PowerPoint Format
PowerPoint FormatPowerPoint Format
PowerPoint Format
 
React js use contexts and useContext hook
React js use contexts and useContext hookReact js use contexts and useContext hook
React js use contexts and useContext hook
 
Controller
ControllerController
Controller
 
Data Abstraction for Large Web Applications
Data Abstraction for Large Web ApplicationsData Abstraction for Large Web Applications
Data Abstraction for Large Web Applications
 
an Introduction to Redux
an Introduction to Reduxan Introduction to Redux
an Introduction to Redux
 
Mysql creating stored function
Mysql  creating stored function Mysql  creating stored function
Mysql creating stored function
 
Reactive web applications
Reactive web applicationsReactive web applications
Reactive web applications
 
An Introduction to Redux
An Introduction to ReduxAn Introduction to Redux
An Introduction to Redux
 

Andere mochten auch

Uhtna Raamatukogu
Uhtna RaamatukoguUhtna Raamatukogu
Uhtna Raamatukoguarxxx
 
Yst Rsw300 Final
Yst Rsw300 FinalYst Rsw300 Final
Yst Rsw300 Finalarxxx
 
Videvik
VidevikVidevik
Videvikarxxx
 
Edci Tuesday Presentation
Edci Tuesday PresentationEdci Tuesday Presentation
Edci Tuesday Presentationready2tch
 
Extreme Environment
Extreme EnvironmentExtreme Environment
Extreme Environmentkked1701
 
Murdvargus Koolis
Murdvargus KoolisMurdvargus Koolis
Murdvargus Koolisarxxx
 
The Heart
The HeartThe Heart
The Heartkrismd
 
The Respiratory System
The Respiratory System The Respiratory System
The Respiratory System krismd
 
Kooli Esitlus
Kooli EsitlusKooli Esitlus
Kooli Esitlusarxxx
 
The Lymphatic System And Immunity1
The Lymphatic System And Immunity1The Lymphatic System And Immunity1
The Lymphatic System And Immunity1krismd
 
Nutrition Powerpoint
Nutrition PowerpointNutrition Powerpoint
Nutrition Powerpointkrismd
 
Indefinite Pronouns
Indefinite PronounsIndefinite Pronouns
Indefinite Pronounsready2tch
 

Andere mochten auch (17)

Uhtna Raamatukogu
Uhtna RaamatukoguUhtna Raamatukogu
Uhtna Raamatukogu
 
Album tof
Album tofAlbum tof
Album tof
 
Yst Rsw300 Final
Yst Rsw300 FinalYst Rsw300 Final
Yst Rsw300 Final
 
Videvik
VidevikVidevik
Videvik
 
Edci Tuesday Presentation
Edci Tuesday PresentationEdci Tuesday Presentation
Edci Tuesday Presentation
 
Extreme Environment
Extreme EnvironmentExtreme Environment
Extreme Environment
 
Murdvargus Koolis
Murdvargus KoolisMurdvargus Koolis
Murdvargus Koolis
 
The Heart
The HeartThe Heart
The Heart
 
The Respiratory System
The Respiratory System The Respiratory System
The Respiratory System
 
Mikado method
Mikado methodMikado method
Mikado method
 
Testea y aumenta tu karma
Testea y aumenta tu karmaTestea y aumenta tu karma
Testea y aumenta tu karma
 
Album Photo
Album PhotoAlbum Photo
Album Photo
 
Kooli Esitlus
Kooli EsitlusKooli Esitlus
Kooli Esitlus
 
xd
xdxd
xd
 
The Lymphatic System And Immunity1
The Lymphatic System And Immunity1The Lymphatic System And Immunity1
The Lymphatic System And Immunity1
 
Nutrition Powerpoint
Nutrition PowerpointNutrition Powerpoint
Nutrition Powerpoint
 
Indefinite Pronouns
Indefinite PronounsIndefinite Pronouns
Indefinite Pronouns
 

Ähnlich wie Design patterns in Javascript

All 23 Design patterns in one page front and back
All 23 Design patterns in one page front and backAll 23 Design patterns in one page front and back
All 23 Design patterns in one page front and backTrey Brister
 
Applied patterns in the project
Applied patterns in the projectApplied patterns in the project
Applied patterns in the projectJan de Vries
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignIrwansyah Irwansyah
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternNishith Shukla
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsLalit Kale
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityShubham Narkhede
 
The 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryThe 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryguestebd714
 
The 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryThe 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryachraf_ing
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsJason Townsend, MBA
 
Cs 1023 lec 8 design pattern (week 2)
Cs 1023 lec 8 design pattern (week 2)Cs 1023 lec 8 design pattern (week 2)
Cs 1023 lec 8 design pattern (week 2)stanbridge
 
C# Advanced L07-Design Patterns
C# Advanced L07-Design PatternsC# Advanced L07-Design Patterns
C# Advanced L07-Design PatternsMohammad Shaker
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxdanhaley45372
 

Ähnlich wie Design patterns in Javascript (20)

All 23 Design patterns in one page front and back
All 23 Design patterns in one page front and backAll 23 Design patterns in one page front and back
All 23 Design patterns in one page front and back
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Applied patterns in the project
Applied patterns in the projectApplied patterns in the project
Applied patterns in the project
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven Design
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design Pattern
 
Jump Start To Ooad And Design Patterns
Jump Start To Ooad And Design PatternsJump Start To Ooad And Design Patterns
Jump Start To Ooad And Design Patterns
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur University
 
The 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryThe 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summary
 
The 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summaryThe 23 gof design patterns in java ,the summary
The 23 gof design patterns in java ,the summary
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design Patterns
 
Cs 1023 lec 8 design pattern (week 2)
Cs 1023 lec 8 design pattern (week 2)Cs 1023 lec 8 design pattern (week 2)
Cs 1023 lec 8 design pattern (week 2)
 
C# Advanced L07-Design Patterns
C# Advanced L07-Design PatternsC# Advanced L07-Design Patterns
C# Advanced L07-Design Patterns
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docx
 
OOP design patterns
OOP design patternsOOP design patterns
OOP design patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
designpatterns-.pdf
designpatterns-.pdfdesignpatterns-.pdf
designpatterns-.pdf
 

Mehr von Tomas Corral Casas

Mehr von Tomas Corral Casas (7)

Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScript
 
Welovejs AngularJS
Welovejs AngularJS Welovejs AngularJS
Welovejs AngularJS
 
Coderdojo bcn 12_10_2013
Coderdojo bcn 12_10_2013Coderdojo bcn 12_10_2013
Coderdojo bcn 12_10_2013
 
Lo que los desarrolladores web deberían saber
Lo que los desarrolladores web deberían saberLo que los desarrolladores web deberían saber
Lo que los desarrolladores web deberían saber
 
Hydra.js modula tu código
Hydra.js modula tu códigoHydra.js modula tu código
Hydra.js modula tu código
 
Less is more
Less is moreLess is more
Less is more
 
Automatización Unit Testing Javascript
Automatización Unit Testing JavascriptAutomatización Unit Testing Javascript
Automatización Unit Testing Javascript
 

Kürzlich hochgeladen

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Kürzlich hochgeladen (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Design patterns in Javascript

  • 1.
  • 2.
  • 3.
  • 4. Someone has already solved your problems.
  • 5. Abstract those that vary. • Program to an interface not an implementation. • Favor composition over inheritance. • Strive for loosely coupled designs between objects that interact. • Classes should be open for extension but closed for modification. • Depend on abstraction. Do not depend on concrete classes.
  • 6.
  • 7. Restricts the instanciation of a class to one object.
  • 8.
  • 9.
  • 10.
  • 12.
  • 13.
  • 14. Allow to use ‘function’ to obtain new objects.
  • 15.
  • 16.
  • 17. Used to clone objects. In Javascript is used to create inheritance.
  • 18.
  • 19.
  • 20. Decouple parts of the code in modules. Avoid failing your full application for some little error in one module.
  • 21.
  • 22.
  • 23. Allows to execute more than one method at the same line. Only one instance of object is needed.
  • 24.
  • 25.
  • 26. Overwritte the behaviour of one method/function to reduce time on further executions. Ideal for updates.
  • 27.
  • 28.
  • 29. Memoize the executions that have been done. Reduce time on expensive jobs.
  • 30.
  • 32. Removes all references to local variables to avoid memory leaks.
  • 33.
  • 34.
  • 35. Removes all references to local variables to avoid memory leaks when the method/function returns something.
  • 36.
  • 38. Converts the interface of a class into another the clients expect. Lets classes work together that couldn't otherwise because of incompatible interfaces.
  • 39.
  • 40.
  • 42. Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality
  • 43.
  • 44.
  • 46. Defines an interface for creating an object, but lets subclasses decide which class to instanciate. Factory Method lets a class defer instanciation to subclasses.
  • 47.
  • 48.
  • 50. Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
  • 51.
  • 52.
  • 54. Encapsulates a request as an object, thereby letting you parameterize other objects with different requests, queue or log requests, and support undoable operations.
  • 55.
  • 56.
  • 58. Provides a unified interface to a set of interfaces in a subsystem. Defines a higher-level interface that makes the subsystem easier to use
  • 59.
  • 60.
  • 62. Defines an object that encapsulates how a set of objects interact.
  • 63.
  • 64.
  • 65. State
  • 66. Allows an object to alter its behavior when its internal state changes. The object will appear to change its class.
  • 67.
  • 68.
  • 70. Defines a family of algorithms, encapsulates each one, and makes them interchangeable.
  • 71.
  • 72.
  • 73.
  • 74. Compose objects into tree structures to represent part-whole hierarchies. Lets clients treat individual objects and compositions of objects uniformly.
  • 75.
  • 76.
  • 77.
  • 78. Separates elements of the application in layers. Logic, data and views are separated.
  • 79. M.V.C
  • 80. M.V.C
  • 82.
  • 83.