Is it reasonable to use private static variables to establish invariants in your class?
Ex:
class MovingObject
{
public:
//...Stuff
private:
// Invariants
static const double VELOCITY; // Moving objects always move at this velocity
// etc. for any other invariants
//...
}
---------------------------------------------------------------------------------
#include "MovingObject.h"
// Invariants
const double MovingObject::VELOCITY = 256.5;
//etc.
Sure. This is a common idiom across several OO languages including Java.