Relationships

[Previous] [Next]

Unique ConcretePrototype classes inherit the Prototype interface and implement behavior for cloning themselves. The ObjectFactory object provides methods for adding and removing objects that support the Prototype interface (such as instances of the ConcretePrototype class) to and from the ObjectFactory's internal list. When a client invokes the ObjectFactory.CreateInstance method to create an instance of a specific object, the ObjectFactory object locates the requested object in its internal list and instructs that object to clone itself via its implementation of the Prototype.Clone interface method. The object creates a copy of itself and a reference to the copy is returned to the client.



Microsoft Visual Basic Design Patterns
Microsoft Visual Basic Design Patterns (Microsoft Professional Series)
ISBN: B00006L567
EAN: N/A
Year: 2000
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net