- Logical Class Names
- Objects store references rather than copies
- References over pointers
- All member data is private
- Explicit constructors
- Encapsulation over inheritance
We don't use a procedural interface for the TPSAPI because TPS requires that we mix and match many different peices that are much more easily organized as classes with abstract interfaces than functions.
Class names are meant to be clear and represent their function. All classes begin with the letters "Tps." Derived classes retain their base class name as a root, for example:
We aim to create a Java-like API where no pointers are ever passed as part of the interface. Rather, all objects are passed by reference.
Now the class TpsTrajectory contains a reference to a specific instance of a TpsSimulationPlugin. Any changes made to the simulation will apply to the trajectory.
All classes should take everything that they need during construction. They should contain "set" functions so that these settings can be modified later.
Constructors should take default arguments so that they don't become long and unweildly.