API problems (Was: future versions)

Simon Hausmann hausmann at kde.org
Mon Feb 9 21:43:40 GMT 2004


On Monday 09 February 2004 22:05, Marc Mutz wrote:
> On Sunday 08 February 2004 11:35, Simon Hausmann wrote:
> > On Saturday 07 February 2004 02:54, Marc Mutz wrote:
> > > The accumulated mess in kdelibs/interfaces. Yes, I'm all for
> > > interfaces but requiring a text editor to implement - say - a dozen
> > > "interfaces" is quite heavy, esp. since they each require virtual
> > > inheritance, which is surprisingly memory intensive.
> >
> > Out of curiousity, why do they require virtual inheritance? Kate for
> > once manages to implement them without.
>
> <snip>
>
> The virtual inheritance needs to be on the level of the interface class,
> of course. E.g.:
>
> kdelibs/interfaces/ktexteditor/*dcopinterface.h
>
> FooDCOPInterface : virtual public DCOPObject { ... }

Those FooDCOPInterface classes are not interfaces one implements in a 
potential editor but they are essentially dcop interface description and 
export stub at the same time.

For implementing one of the actual text editor interfaces you use simple 
inheritance from FooInterface. If you want to publish the methods of the 
interface via dcop you instantiate a FooDCOPInterface stub (contained as 
class in libktexteditor) .

A text editor is not forced to implement all the interfaces. Some of them are 
optional.

I actually don't understand why virtual inheritance was chosen for the dcop 
interfaces.

Simon




More information about the kde-core-devel mailing list