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

List:       koffice-devel
Subject:    Re: [API] Flake class names
From:       Johannes Simon <johannes.simon () gmail ! com>
Date:       2009-12-05 12:10:00
Message-ID: 4B1A4D98.8050600 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


To me, the postfix "Base" stands for the exact same as the prefix 
"Abstract". That is, for an abstract class that cannot be instantiated. 
Our naming policy is a bit unclear, though, as it seems:

KoShape - abstract base class for shapes
KoShapeController*Base* - abstract base class for shape controllers
Ko*Abstract*Gradient - base class for gradients that, however, can be 
instantiated

As most classes use the postfix "Base" atm, I'd say that:
1) Abstract base classes should use the postfix "Base"
2) the prefix "Abstract" shall not be used
3) Any class that can be instantiated shall not be considered a base 
class as in 1)

Because, what's the point of an "abstract" class that can be instantiated?

- Johannes

Jaroslaw S schrieb:
> 2009/12/5 Thomas Zander <zander@kde.org>:
>   
>> On Saturday 5. December 2009 10.54.29 Jaroslaw S wrote:
>>     
>>> 2009/12/5 Thorsten Zachmann <t.zachmann@zagge.de>:
>>>       
>>>> On Friday 04 December 2009 11:11:03 Thomas Zander wrote:
>>>>         
>>>>> I found some class names in Flake that I think warrant some
>>>>> investigation. Please provide some ideas or feedback on each of those.
>>>>>
>>>>> KoChildrenData rename to KoShapeContainerDefaultModel ?
>>>>>           
>>>> Yes that should be renamed. However I would prefer
>>>> KoDefaultShapeContainterModel as it is more in line with
>>>> QAbstractListModel.
>>>>         
>>> How about slashing Default and use Standard as in QStandardItemModel:
>>>
>>> KoStandardShapeContainerModel ?
>>>       
>> zander@mac:libs$find . -name *.h | grep Standard
>> ./main/KoStandardAction.h
>> ./pigment/KoColorModelStandardIds.h
>>
>> zander@mac:libs$find . -name *.h | grep Default
>> [no results]
>>
>> find . -name *.h | grep Abstract
>> ./resources/KoAbstractGradient.h
>> ./pigment/KoColorSpaceAbstract.h
>> ./pigment/tests/TestKoColorSpaceAbstract.h
>> ./pigment/KoColorConversionTransformationAbstractFactory.h
>>
>> zander@mac:libs$find . -name *.h | grep Base
>> ./odf/kopicture/KoPictureBase.h
>> ./flake/KoShapeControllerBase.h
>> ./flake/commands/KoPathBaseCommand.h
>> ./flake/KoShapeConfigWidgetBase.h
>> ./flake/KoFilterEffectConfigWidgetBase.h
>> ./flake/KoCanvasBase.h
>> ./store/KoStoreBase.h
>> ./kotext/KoFindStrategyBase.h
>> ./kotext/InsertVariableActionBase_p.h
>> ./pigment/compositeops/KoCompositeOpAlphaBase.h
>> ./kopageapp/KoPAPageBase.h
>>     
>
> Good grep.
>
> Maybe "Abstract" could be used for not instantiable classes?
> For others, something other...
>
>   


[Attachment #5 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
To me, the postfix "Base" stands for the exact same as the prefix
"Abstract". That is, for an abstract class that cannot be instantiated.
Our naming policy is a bit unclear, though, as it seems:<br>
<br>
KoShape - abstract base class for shapes<br>
KoShapeController<b>Base</b> - abstract base class for shape controllers<br>
Ko<b>Abstract</b>Gradient - base class for gradients that, however, can
be instantiated<br>
<br>
As most classes use the postfix "Base" atm, I'd say that:<br>
1) Abstract base classes should use the postfix "Base"<br>
2) the prefix "Abstract" shall not be used<br>
3) Any class that can be instantiated shall not be considered a base
class as in 1)<br>
<br>
Because, what's the point of an "abstract" class that can be
instantiated?<br>
<br>
- Johannes<br>
<br>
Jaroslaw S schrieb:
<blockquote
 cite="mid:56a746380912050344g75e591d0mf8bad0badd8715fb@mail.gmail.com"
 type="cite">
  <pre wrap="">2009/12/5 Thomas Zander <a class="moz-txt-link-rfc2396E" \
href="mailto:zander@kde.org">&lt;zander@kde.org&gt;</a>:  </pre>
  <blockquote type="cite">
    <pre wrap="">On Saturday 5. December 2009 10.54.29 Jaroslaw S wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">2009/12/5 Thorsten Zachmann <a class="moz-txt-link-rfc2396E" \
href="mailto:t.zachmann@zagge.de">&lt;t.zachmann@zagge.de&gt;</a>:  </pre>
      <blockquote type="cite">
        <pre wrap="">On Friday 04 December 2009 11:11:03 Thomas Zander wrote:
        </pre>
        <blockquote type="cite">
          <pre wrap="">I found some class names in Flake that I think warrant some
investigation. Please provide some ideas or feedback on each of those.

KoChildrenData rename to KoShapeContainerDefaultModel ?
          </pre>
        </blockquote>
        <pre wrap="">Yes that should be renamed. However I would prefer
KoDefaultShapeContainterModel as it is more in line with
QAbstractListModel.
        </pre>
      </blockquote>
      <pre wrap="">How about slashing Default and use Standard as in \
QStandardItemModel:

KoStandardShapeContainerModel ?
      </pre>
    </blockquote>
    <pre wrap="">zander@mac:libs$find . -name *.h | grep Standard
./main/KoStandardAction.h
./pigment/KoColorModelStandardIds.h

zander@mac:libs$find . -name *.h | grep Default
[no results]

find . -name *.h | grep Abstract
./resources/KoAbstractGradient.h
./pigment/KoColorSpaceAbstract.h
./pigment/tests/TestKoColorSpaceAbstract.h
./pigment/KoColorConversionTransformationAbstractFactory.h

zander@mac:libs$find . -name *.h | grep Base
./odf/kopicture/KoPictureBase.h
./flake/KoShapeControllerBase.h
./flake/commands/KoPathBaseCommand.h
./flake/KoShapeConfigWidgetBase.h
./flake/KoFilterEffectConfigWidgetBase.h
./flake/KoCanvasBase.h
./store/KoStoreBase.h
./kotext/KoFindStrategyBase.h
./kotext/InsertVariableActionBase_p.h
./pigment/compositeops/KoCompositeOpAlphaBase.h
./kopageapp/KoPAPageBase.h
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Good grep.

Maybe "Abstract" could be used for not instantiable classes?
For others, something other...

  </pre>
</blockquote>
<br>
</body>
</html>



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


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

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