• Keine Ergebnisse gefunden

Design Patterns and Frameworks – Structural Patterns: Summary

N/A
N/A
Protected

Academic year: 2022

Aktie "Design Patterns and Frameworks – Structural Patterns: Summary"

Copied!
9
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Design Patterns and Frameworks – Structural Patterns: Summary

Oliver Haase

Oliver Haase Emfra — Structural Patterns: Summary 1/9

(2)

Magic Circle of Structural Patterns — Ok, Just Kidding...

(3)

Magic Circle of Structural Patterns — Ok, Just Kidding...

Oliver Haase Emfra — Structural Patterns: Summary 3/9

(4)

Adapter vs. Bridge

Commonalities:

I Level of Indirection for the access to the actual object

I Delegation from an interface that the actual object doesn’t provide

(5)

Adapter vs. Bridge

Differences:

I Purpose:

I Adapterintends to match an implementation with a (different) interface

I Bridgeintends to separate implementation from abstract to enable both to evolve separately

I Time of application:

I Adapteris employed rather later, i.e. when two existing types need to be brought together

I Bridgeis employed early, to foresee separate evolution of abstraction and implementation

Oliver Haase Emfra — Structural Patterns: Summary 5/9

(6)

Composite vs. Decorator

Commonalities

I Structures of composite and decorator very similar (both use recursion to structure hierarchies of objects

I Decorator structure might be mistaken for degenerated composite structure

→ composite builds tree, decorator builds chain of objects

(7)

Composite vs. Decorator

Differences are in their purpose:

I Purpose:

I Decoratorintends to add functionality to a type without changing it

avoids expontential explosion of number of classes

I Compositeintends to treat leaves and inner nodes (container objects) of an object hierarchy homogeneously

Oliver Haase Emfra — Structural Patterns: Summary 7/9

(8)

Proxy vs. Decorator

Commonalities

I Similar structures, in both cases indirect access to actual object via upstream object

I in both cases, upstream object maintains reference to actual object (subject) and delegates requests to it

(9)

Proxy vs. Decorator

Differences are in their purpose:

I Proxy is not about adding functionality, but about avoiding direct access to the subject, for varying reasons (protection, efficiency, transparent remote access)

I With proxy pattern, proxy implements key functionality, with decorator pattern, functionality is split across levels of indirection.

Oliver Haase Emfra — Structural Patterns: Summary 9/9

Referenzen

ÄHNLICHE DOKUMENTE

Click or drag in the image to select a color. Some applications come with several images to use as palettes. You can also add your own images as described next.. Click the

Similar structures, in both cases indirect access to actual object via upstream object. in both cases, upstream object maintains reference to actual object (subject) and

The goal of the interface proposed in this paper is different as it was designed to facilitate standardised evaluation of object databases in terms of benchmarking or as a format

In this paper, we propose a model transformation from SysML block defin- ition diagrams and state machines to the input language of the NuSMV model- checker [8], implemented in

If this rule is learned with the stimuli involving only two of the three positive or negative fea- tures (top column), then transfer should occur to the novel stimuli having all

Since the model and view components contain elements which are defined by a semantic convention – the data, ser- vice and GUI objects as well as the event handling methods – the

public class Stubcode implements SeatImplementation { public int GetPosition() {!. // stub code for GetPosition }

•  Start with one interface object for each subsystem service. •  Try to limit the number of interface