The Facade Pattern - Lecture Slides | CS 350, Study notes of Computer Science

Material Type: Notes; Professor: Salvage; Class: Software Design; Subject: Computer Science; University: Drexel University; Term: Fall 2008;

Typology: Study notes

Pre 2010

Uploaded on 08/19/2009

koofers-user-8ai
koofers-user-8ai 🇺🇸

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 350
CS 350
Software Design
Software Design
The Facade Pattern
The Facade Pattern
Chapter 6
Chapter 6
Many design patterns are catalogued in the
Many design patterns are catalogued in the
Gang of Four
Gang of Four
text. I find their definitions not to
text. I find their definitions not to
help much unless you already understand what it says. Thus they
help much unless you already understand what it says. Thus they are not very helpful once
are not very helpful once
the patterns get more complex. However, our first pattern, the
the patterns get more complex. However, our first pattern, the Fa
Faç
çade is quite simple. So
ade is quite simple. So
their definition isn
their definition isn
t too bad:
t too bad:
Provide a unified interface to a set of interfaces in a subsyste
Provide a unified interface to a set of interfaces in a subsystem. Fa
m. Faç
çade defines a higher level
ade defines a higher level
interface that makes a subsystem easier to use.
interface that makes a subsystem easier to use.
It
It
s really the second sentence that captures the meaning of the Fa
s really the second sentence that captures the meaning of the Faç
çade to me.
ade to me.
It
It
s basically saying that we need a simpler way to access a comple
s basically saying that we need a simpler way to access a complex system.
x system.
pf3
pf4
pf5

Partial preview of the text

Download The Facade Pattern - Lecture Slides | CS 350 and more Study notes Computer Science in PDF only on Docsity!

CS 350

CS 350 –

  • Software Design

Software Design

The Facade Pattern

The Facade Pattern –

  • Chapter 6

Chapter 6

Many design patterns are catalogued in the Many design patterns are catalogued in the “

“Gang of Four

Gang of Four”

” text. I find their definitions not to

text. I find their definitions not to

help much unless you already understand what it says.

Thus they

help much unless you already understand what it says.

Thus they are not very helpful once

are not very helpful once

the patterns get more complex.

However, our first pattern, the

the patterns get more complex.

However, our first pattern, the Fa

Faç

çade is quite simple.

So

ade is quite simple.

So

their definition isn their definition isn’

’t too bad:

t too bad:

Provide a unified interface to a set of interfaces in a subsystem. FaProvide a unified interface to a set of interfaces in a subsyste

m. Faç

çade defines a higher level

ade defines a higher level

interface that makes a subsystem easier to use.interface that makes a subsystem easier to use.

It It’

’s really the second sentence that captures the meaning of the Fa

s really the second sentence that captures the meaning of the Faç

çade to me.

ade to me.

It It’

’s basically saying that we need a simpler way to access a comple

s basically saying that we need a simpler way to access a complex system.

x system.

CS 350

CS 350 –

– Software Design

Software Design

The Facade Pattern

The Facade Pattern –

– Chapter 6

Chapter 6

It is quite often in a large company that programmers develop a It is quite often in a large company that programmers develop a specific skill that everyone

specific skill that everyone

does not know. Imagine you had to learn a CAD system. They are q does not know. Imagine you had to learn a CAD system. They are quite complex. Everyone

uite complex. Everyone

on the team shouldn on the team shouldn’

’t have to learn the details of programming in CAD. If everyone h

t have to learn the details of programming in CAD. If everyone had to

ad to

learn every detail, think of the time wasted reading all those m learn every detail, think of the time wasted reading all those manuals!

anuals!

CS 350

CS 350 –

– Software Design

Software Design

The Facade Pattern

The Facade Pattern –

– Chapter 6

Chapter 6

Key Features for the Fa Key Features for the Faç

çade Pattern:

ade Pattern:

Intent: You want to simplify how to use an existing system. You Intent: You want to simplify how to use an existing system. You need to define your own

need to define your own

interface. interface.

Problem: You need to use only a subset of a complex system. Problem: You need to use only a subset of a complex system.

Solution: Create a new interface for the client to use. Solution: Create a new interface for the client to use.

Participants and Collaborators: Simplified interface for client Participants and Collaborators: Simplified interface for client

Consequences: Simplifies the us of a required subsystem, but red Consequences: Simplifies the us of a required subsystem, but reduces options.

uces options.

Implementation: Define a new class (or classes) that has the req Implementation: Define a new class (or classes) that has the required interface and uses the

uired interface and uses the

existing system. existing system.

CS 350

CS 350 –

– Software Design

Software Design

The Facade Pattern

The Facade Pattern –

– Chapter 6

Chapter 6

Complexity can be greatly reduced for the application that acces Complexity can be greatly reduced for the application that accesses a fa

ses a faç

çade instead of a or

ade instead of a or

many subsystems: many subsystems: