GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JavaScript-Design-Patterns/GoF/idiomatic/Structural/Facade at master · irynaO/JavaScript-Design-Patterns

Expand file tree

/

Facade

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

Facade

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
CoffeeScript
CoffeeScript
 
 
ECMAScript
ECMAScript
 
 
TypeScript
TypeScript
 
 
Facade.dia
Facade.dia
 
 
Facade.png
Facade.png
 
 
README.md
README.md
 
 

README.md

Outline

Synopsis

I love my pets but, due to Alzheimer's disease, I often forget how to feed them. Any help would be appreciated.

Problem

The more pets you have, the more difficult it will be to remember the menu for each animal. Complexity can grow quite fast, which is not ideal in terms of code (re)usability. We should keep it simple, stupid (KISS).

Solution

Facade is often used to hide the underlying complexity of a system. To implement this design pattern, we can:

  • Create an object (literal) to represent each animal
  • Create a facade that has a reference to each animal

Here the client will use the facade only, especially the main method that returns the favorite meal of each animal. No additional effort is required.

Facade (idiomatic)

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.