Layered Initialization (3.1)
Design, code and test a hypothetical class, Image, that constructs an
image from a file. Images come in many types or formats, e.g.,
gif, jpeg, png, etc. While Image is the only concrete class to
represent images, the portion of code that reads an image's pixels
depends on the image type or format. Define an abstract class or
interface, ImageReader, for this purpose and a factory-like class
that instantiates the appropriate image reader for a specific image file.
Use a LayeredInitialization pattern and code a simple driver to
test your design and implementation.