Ramifications

[Previous] [Next]

  • All the benefits realized by the Object Factory design pattern (Chapter 8) also hold true for the Prototypical Object Factory design pattern. The resounding theme is that you can easily create plug-and-play utopia in an application by allowing the addition and removal of objects in the factory at run time. From the end user's perspective, objects translate to system features, and the ability to change features dynamically is very useful and impressive to an end user.
  • Rather than defining separate classes for each distinct behavioral response to a particular interface operation, you can define a single class with behavior that varies depending on its state. The prototypical object factory can then facilitate a client's request by cloning a single object and setting its state accordingly.
  • If you use a framework library, you typically add new behavior to the framework by inheriting an interface the framework expects. You usually will not have access to the framework source code, so the framework needs some way to become aware of the fact that a new class exists that supports an interface it expects. If the framework is implemented using the Prototypical Object Factory design pattern, a client can register a new object that supports the interface expected by the framework with a prototypical object factory.
  • Cloning is not a built-in language feature of Visual Basic. Cloning requires an interface definition and implementation for all classes that inherit the interface.


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