[Grace-core] Naming (sigh!)

Kim Bruce kim at cs.pomona.edu
Sat Apr 19 01:03:12 PDT 2014


I'm going back heavy duty to rewriting my text, but first I want to make revisions to objectdraw to conform to our latest syntax for classes.  (By the way, the PSU Grace compiler seems to run both graphics and timers fine -- at least so far).

I only want to make changes to the API once more, so I'm looking for some advice on naming the classes.  I've listed below all of the classes, each followed immediately by its proposed new name.  However, I'm tempted to make a further change to the names for multi-part class names.  I'm tempted to have the second and any further parts start with capital letters.  Thus rather than writing 

class aDrawable2DAt(location':Location)size(width':Number,height':Number)on(canvas':Canvas)
                      -> Graphic2DObject

I'm instead tempted to write:

class aDrawable2DAt(location':Location)Size(width':Number,height':Number)On(canvas':Canvas)
                      -> Graphic2DObject

You will notice that I did that for the color constructor, but not for any of the others.  At the moment, none of the actual methods of any of these classes have multipart names, so there is no consistency issue there.  What do you think?  (... and let me know if you have other suggestions for renaming the classes.

(If you'd like more documentation on the entire objectdraw library, it can be found at:
 http://www.cs.pomona.edu/~kim/GraceStuff/UsingObjectdrawGrace.pdf

Kim


Grace class names

class aColor.r(r')g(g')b(b') -> GColor

class aColorR(r')G(g')B(b') -> GColor


class aLocation.at(x':Number,y':Number)->Location

class aLocationAt(x':Number,y':Number)->Location


class aCanvas.size(width':Number,height':Number) -> Canvas

class aCanvasSize(width':Number,height':Number) -> Canvas


class aGraphicApplication.size(width':Number,height':Number)
               ->GraphicApplication

class aGraphicApplicationSize(width':Number,height':Number)
               ->GraphicApplication


class aDrawable.at(location':Location) on (canvas':Canvas) -> GraphicObject

class aDrawableAt(location':Location) on (canvas':Canvas) -> GraphicObject


class aDrawable2D.at(location':Location)size(width':Number,height':Number)on(canvas':Canvas)
                      -> Graphic2DObject

class aDrawable2DAt(location':Location)size(width':Number,height':Number)on(canvas':Canvas)
                      -> Graphic2DObject


class aResizable2D.at(location':Location)size(width':Number,height':Number)
                   on(canvas':Canvas)  -> Resizable2DObject

class aResizable2DAt(location':Location)size(width':Number,height':Number)
                   on(canvas':Canvas)  -> Resizable2DObject


class aFramedRect.at(location':Location)size(width':Number,height':Number)
           on(canvas':Canvas) -> Resizable2DObject

class aFramedRectAt(location':Location)size(width':Number,height':Number)
           on(canvas':Canvas) -> Resizable2DObject


class aFilledRect.at(location':Location)size(width':Number,height':Number)
           on(canvas':Canvas) -> Resizable2DObject

class aFilledRectAt(location':Location)size(width':Number,height':Number)
           on(canvas':Canvas) -> Resizable2DObject


class aFramedOval.at(location':Location)size(width':Number,height':Number)
           on(canvas':Canvas) -> Resizable2DObject

class aFramedOvalAt(location':Location)size(width':Number,height':Number)
           on(canvas':Canvas) -> Resizable2DObject


class aFilledOval.at(location':Location)size(width':Number,height':Number)
           on(canvas':Canvas) -> Resizable2DObject

class aFilledOvalAt(location':Location)size(width':Number,height':Number)
           on(canvas':Canvas) -> Resizable2DObject


class aFramedArc.at(location':Location)size(width':Number,height':Number)
           from(startAngle:Number)to(endAngle:Number)on(canvas':Canvas) -> Resizable2DObject

class aFramedArcAt(location':Location)size(width':Number,height':Number)
           from(startAngle:Number)to(endAngle:Number)on(canvas':Canvas) -> Resizable2DObject


class aFilledArc.at(location':Location)size(width':Number,height':Number)
           from(startAngle:Number)to(endAngle:Number)on(canvas':Canvas) -> Resizable2DObject

class aFilledArcAt(location':Location)size(width':Number,height':Number)
           from(startAngle:Number)to(endAngle:Number)on(canvas':Canvas) -> Resizable2DObject


class aDrawableImage.at(location':Location)size(width':Number,height':Number)
           file(fileName:String)on(canvas':Canvas) -> Resizable2DObject

class aDrawableImageAt(location':Location)size(width':Number,height':Number)
           file(fileName:String)on(canvas':Canvas) -> Resizable2DObject


class aLine.from(start':Location)to(end':Location)on(canvas':Canvas)
          -> LinearObject

class aLineFrom(start':Location)to(end':Location)on(canvas':Canvas)
          -> LinearObject


class aText.at(location':Location)with(contents':String)on(canvas':Canvas) 
                         -> Textual

class aTextAt(location':Location)with(contents':String)on(canvas':Canvas) 
                         -> Textual





More information about the Grace-core mailing list