virtual and KisPainter

Patrick Julien freak at codepimps.org
Mon Jan 19 14:04:37 CET 2004


Yes, I wanted the user to think before inherithing from KisPainter.  You see, 
KisPainter is the state controller participant in the state design pattern.  
The color strategies are the states, hence it's quite possible to extend 
KisPainter without using inheritance, we already do it to support for both 
RGB and CMYK.

In this case, it's considerably more powerful and flexible than static 
inheritance.  Not only, but do you really want to have more than one painter 
class?  I remember using MFC and having to use different DC classes depending 
on what the job was, no thank you!


On January 19, 2004 06:36 am, Boudewijn Rempt wrote:
> Was it a concious decision to make KisPainter non-subclassable? I.e., no
> virtual desctructor? Not that it's necessary to subclass it at this moment,
> but I was wondering...



More information about the kimageshop mailing list