[ fromfile: morepatterns-questions.xml id: morepatterns-questions ]
How can a creational pattern help manage object destruction?
By adding the pointer to a list of objects to be destroyed, before returning it from the Factory method. This can be achieved in a number of ways, such as adding it as a child to another object, or a managed pointer collection.
How can properties help you write a more general-purpose Writer
?
Properties can be inspected at runtime to find out what names/values need to be loaded/saved. This way, you can write one serializer for all QObject
s.
How can an Abstract Factory help us write a more general-purpose Reader
?
With an Abstract Factory, we can "plug in" different kinds of ObjectFactory objects into the same Reader, to support different libraries of types. This helps separate the Reader code from the library-specific code.
What Qt classes are implementations of the Facade pattern? Explain why they are facades or wrappers.
QString, QWidget, QThread, QProcess, QSqlDatabase, QFile, and many others.
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |