Let clients create objects by naming an abstract superclass and by providing a specification. A Product Trader decouples the client from the product and thereby eases the adaptation, configuration and evolution of class hierarchies, frameworks and applications.
Dirk Bäumer and Dirk Riehle. "Product Trader." In Pattern Languages of Program Design 3. Edited by Robert Martin, Dirk Riehle, and Frank Buschmann. Reading, Massachusetts: Addison-Wesley, 1998. Chapter 3, page 29-46.
An earlier version appeared as: Dirk Bäumer and Dirk Riehle. "Late Creation--A Creational Pattern." PLoP '96, conference proceedings. Washington University Department of Computer Science, Technical Report WUCS-97-07, 1997. Paper 5.1, 11 pages.
The paper is available as a PDF file. Please note that the final published article is a copy-edited version of this pdf file and therefore may differ in minor details from the version provided here.
No sample code available, but you might want to take a look at the following Smalltalk (VisualAge) framework.
|