Droplets Platform Naming Conventions
 

 

A quick word about the naming conventions that Droplet, Inc. uses will clarify any questions you have about the naming of various classes, objects and functions in the code that is described throughout the Droplets SDK. We include these so you’ll understand the naming scheme used in the Droplets API and throughout the tutorials – you’re obviously free to use whatever naming convention you like when writing to the Droplets API.

Internal Droplet Inc. file names consist of a two-letter prefix followed by a descriptive name. The two-letter prefix should refer to the application; hence for Hello World we have used the prefix Hw, and for Headline Feeder we use the prefix Hf.

Class names include the two-letter file prefix, plus an additional “T” prefixed to it. So our Application Server file is named “HfServer”, while the Server class is named “THfServer”.

The chart below lists other name-prefix conventions that we’ve applied to our tutorial demos:

Name of ...

Starts with

Example

Classes, Typedefs

T

TGrPoint, TDdConsumer

Enumerated type

N

NColor

Enumerated value

n followed by abbreviated type

nColorOrange, nColorPink

Unions

U

UValue

Structs

R

RAddress

Template Classes

T

TStack<>

Template Arguments

any uppercase letter

T, Size

Template Functions

any uppercase letter

Max

Member variables

F

FName, FValue

Member functions

any uppercase letter

SetValue, GoBack

Static member variables

S

SInstance

Static member functions

any uppercase letter

InitializeInstance

Free functions

any uppercase letter

PrintLog

Global variables

g

glog

Module variables (static to .CPP file)

m

MCache

Constants

k

kPi, kMaxThreads

Function arguments, Local variables

any lowercase letter

anArgument, local

A few simple rules are adhered to in the naming of methods as well:

       Get and Set functions begin with Get and Set, respectively;

•        Functions with boolean return values begin with Is, Has Requires or Wants, as appropriate;

        Initialize and Finalize are used as names for all methods that are called to set up a subsystem and then clean it up, respectively.


Return to Droplets SDK Documentation Home