Design Patterns: Elements of Reusable Object-Oriented Software (Joanne Romanovich's Library) by Erich Gamma & Richard Helm & Ralph Johnson & John Vlissides

Design Patterns: Elements of Reusable Object-Oriented Software (Joanne Romanovich's Library) by Erich Gamma & Richard Helm & Ralph Johnson & John Vlissides

Author:Erich Gamma & Richard Helm & Ralph Johnson & John Vlissides
Language: eng
Format: epub
Publisher: Addison-Wesley
Published: 1995-03-02T16:00:00+00:00


Sample Code

The following code shows how to implement user interface decorators in C++. We’ll assume there’s a Component class called VisualComponent.

We define a subclass of VisualComponent called Decorator, which we’ll subclass to obtain different decorations.

Decorator decorates the VisualComponent referenced by the _component instance variable, which is initialized in the constructor. For each operation in VisualComponent’s interface, Decorator defines a default implementation that passes the request on to _component:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.