differentially loading a class at runtime

M

Maurice LING

Hi,

In normal circumstances, we know exactly which class to load and use
using compile time. But I am now faced with a situation whereby I need
to load a class differentially at runtime (the user can define which
class to load).

For example:

class a:
......

class b:
......

allowed = ['a', 'b']

'allowed' list will store the names of the alternative classes to use.
The alternative classes have the same set of methods but different
implementations.

How can I differentially use the classes at runtime?

Thanks
Maurice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,209
Messages
2,571,088
Members
47,686
Latest member
scamivo

Latest Threads

Top