Design Patterns in the VCL -- Palette as Prototype


Revealing the Magician's Secrets

  1. Component Palette ==> Prototype

Problem

How do I decouple the clients of a family of related classes from direct knowlege of each class?

Solution

Prototype decouples the clients from the concrete classes by "pre-creating" instances of each concrete subclass, and allowing the client to "clone" these instances without knowing their exact class.

Consequences

The client is independent of the concrete classes. For instance, it becomes feasible to add new concrete classes, without even needing to recompile the client! (e.g., installing a component) .

[ Next | Previous | Top | Outline | Glossary | Links ]


These pages maintained by Tres Seaver of Palladion Software . Copyright 1998, all rights reserved.