[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KParts API: thinking about the future (patch)
From:       Martijn Klingens <mklingens () yahoo ! com>
Date:       2002-03-07 22:53:51
[Download RAW message or body]

On Thursday 07 March 2002 03:17, Carsten Pfeiffer wrote:
> but having the method private is actually the point of that pattern. That a
> baseclass doesn't need to rely on subclasses calling it properly. But with
> that technique, it only works for the very superclass, but none in the
> middle. So there's not much, you gain.

Hmm... that sucks :-)

The advantage is still that you can guarantuee that code can be executed 
around the function call from external code (and also from the class as long 
as they prefer the 'public' API). But you are right that making them 
protected does make it possible for someone to bypass e.g. openStream() and 
call doOpenStream() directly. Can we assume that a warning in the API docs is 
sufficient to prevent that, next to the fact that code outside the class is 
also safe for this caveat?

Martijn
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic