I have the following class:
class PluginLoader
{
public:
PluginLoader(Logger&, PluginFactory&, ConflictResolver&);
//Functions.
private:
//Members and functions
};
Logger
, PluginFactory
and ConflictResolver
classes are all interface classes which will be implemented in the application. I create the single PluginLoader
object at top level in the main program. The Logger
can be known at that level. But, PluginFactory
and ConflictResolver
are only used internally in the PluginLoader
class. So creating their objects at top level seems ugly. What should I do? I can change the constructor if it is needed though I'd like to keep it the way it is. Any comments are welcome. Thanks.