Strokes framework naming problem

Boudewijn Rempt boud at valdyas.org
Mon Jul 11 10:57:24 CEST 2011


On Sunday 10 July 2011 Jul, Dmitry Kazakov wrote:

> KisPainterBasedStrokeStrategy -- probably, not good
> KisStrokeStrategyPainterBased -- better?

The first one is better, because it keeps to the common pattern

> FreehandStrokeStrategy -- not good
> KisStrokeStrategyFreehand -- better?

KisFreehandStrokeStrategy would be my choice.

> What do you think? What is the common practice here?

Patrick Julien started with putting the name of the design pattern (like strategy) at the end of the classname. If we want to keep a modicum of consistency, we should continue doing that.

> 
> 3) I don't know where I should add Kis- prefix and where not. These classes
> are too small, too specific and too private to use such global prefix. What
> is the general rule there?

All classes in a library should have the "kis" prefix, no matter how small, unless they are completely internal, hidden inside an implementation file.

> 4) Well, and, finally, the word 'strategy' is too long for names =( But I
> can't simply remove it because there are classes like KisStroke and
> KisStrokeJob.


The general pattern is Kis + naming from specific to most generic -- i.e, the generic part is the design pattern "strategy", so that gets at the end.


-- 
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl


More information about the kimageshop mailing list