On Wednesday 24 October 2001 11:46, Simon Hausmann wrote: > > I think KLibFactory has a small problem. Or let me put it in other > words: We have two existing solutions for that problem: > KParts::Factory and (in kdevelop) KDevFactory. Both work around the > fact that the create function is not very flexible when it comes to > passing 'custom' arguments to the component that don't fit into a > 'QString' . The other limitation is that KLibFactory does not allow to return types other than QObject without casting. > Using dedicated factory classes to solve the inflexibility of the > create function is actually less of a problem for the implementor, > but it makes the caller code ugly IMHO. ('what type of factory do I > have to use to instantiated that component xzy? Do I have to D-cast > the KLibFactory to the real factory type?') I agree that currently the caller code is ugly, but I like the idea of dedicated factory classes. Wouldn't it be possible to replace KLibFactory by the template based generic factory you posted some days ago? Then you could hide the casts and get a completely type-safe interface. -- Cornelius Schumacher