M
Mark
I wish to develop an extendable object factory for a library I am
writing. The library is to provide a simplified interface to a
messaging application. Most of the work is done within the library
but the user has to override a class and provide the implementation to
a single virtual function (to read data).
It's easy to provide factory methods for the built in classes but I am
struggling to think how to provide a factory method for classes that
are added later.
I know I could allow them to create the objects directly but I would
rather avoid this because it would expose some unneccessary details of
the implementation of the library itself.
writing. The library is to provide a simplified interface to a
messaging application. Most of the work is done within the library
but the user has to override a class and provide the implementation to
a single virtual function (to read data).
It's easy to provide factory methods for the built in classes but I am
struggling to think how to provide a factory method for classes that
are added later.
I know I could allow them to create the objects directly but I would
rather avoid this because it would expose some unneccessary details of
the implementation of the library itself.