TODO:
Incorporate this with the design patterns chapter, as a creational pattern
During
a constructor call, the virtual mechanism does not operate (early binding
occurs). Sometimes this is awkward.
In
addition, you may want to organize your code so you don’t have to select
an exact type of constructor when creating an object. That is, you’d like
to say, “I don’t know precisely what type of object you are, but
here’s the information: Create yourself.” This appendix
demonstrates two approaches to “virtual construction.” The first is
a full-blown technique that works on both the stack and the heap, but is also
fairly complex to implement. The second is much simpler to implement and
maintain, but restricts you to creating objects on the heap.