• Keine Ergebnisse gefunden

Design Patterns and Frameworks – Facade

N/A
N/A
Protected

Academic year: 2022

Aktie "Design Patterns and Frameworks – Facade"

Copied!
10
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Design Patterns and Frameworks – Facade

Oliver Haase

Oliver Haase Emfra — Facade 1/10

(2)

Description

I Classification: Object-based structural pattern

I Purpose: Provides a homogeneous interface to a set of interfaces of a subsystem. Simplifies usability of the subsystem.

Oliver Haase Emfra — Facade 2/10

(3)

Motivation

Oliver Haase Emfra — Facade 3/10

(4)

Motivation

Oliver Haase Emfra — Facade 4/10

(5)

Motivation

Problem: Client has to know a lot of classes /interfaces to simply watch a movie

→many dependencies, tight coupling, hard to change home theater configuration without the need to change all clients

Oliver Haase Emfra — Facade 5/10

(6)

Motivation

Oliver Haase Emfra — Facade 6/10

(7)

Description

I Applicability: Use the facade pattern to

I hide a subsystem’s internal complexity and provide a simplified interface to clients. Systems tend to grow over time, design patterns tend to increase the number of classes. A facade shields clients from that complexity.

I loosen coupling between the subsystem and clients. A facade removes dependencies from the actual subsystem classes.

I build multi-layered architecures, separated through one facade per layer as the entry point for the next higher layer.

Oliver Haase Emfra — Facade 7/10

(8)

Structure

Oliver Haase Emfra — Facade 8/10

(9)

Participants

I Facade:

I knows which subsystem classes are responsible for which requests

I delegates client requests to respective subsytem objects

I Subsystem:

I implements the subsystem functionality

I executes requests from the facade

I do not know the facade, i.e. do not have reference to facade objectstrict layering

Oliver Haase Emfra — Facade 9/10

(10)

Interactions

I Clients use the subsystem by sending requests to the facade.

The facade forwards the request to the responsible subsystem objects(s). One client request might well lead to several subsystem requests. Even though the subsystem functionality is implemented in the subsystem, the facade might “fill in”

some logic to orchestrate the lower level requests.

I Clients that use the facade do not have to use the subsystem directly.

Oliver Haase Emfra — Facade 10/10

Referenzen

ÄHNLICHE DOKUMENTE

When a system of settlements and relative services is defined one obtains a full set of data for pollution problem analysis: data on population, regional economic growth, the

disk array (RAID level) controller cache... Disk Allocation –

Illustrations always precede their parts lists and when possible, appear on the facing page; multipage illustrations and parts.. lists are

The Status Byte is transmitted to the channel during the initial selection sequence, to present Channel End at the termination of data transfer, to present

Control (Function) lines carry the commands which enable the subsystem's circuitry to interpret computer instructions, transfer data characters from the Paper Tape

The data frames thus "straightened" (when necessary) are checked for parity-correct- ness in the input register, then routed to the Channel Synchronizer.

Control Unit Sequence Error: The Computer delays in issuing an Input Acknowledge signal in time to remove a word from the subsystem register before the

The request for State, Foreign Operations, and Related Programs totals $51.97 billion (2.7% below the FY2012 actual funding level of $53.43 billion, including the Foreign Service