Some Nomenclature
class cylinder : public body {
virtual char* identify() const;
virtual float GetVolume() const;
virtual float GetSurface() const;
// a cylinder is described by
The data members of a class to be written out, and the corresponding generated I/O routines are called the
You can change and add/remove member functions to your class as you like, as long as you don’t change the schema (that is, change data members) you don’t need to do anything to your existing DB.
If you do, that’s called schema evolution.
Then you need to change the DB, pick a policy.
- Go through the DB, change all existing objects NOW.
- When you come across an object that doesn’t have the new data member, add a default one.
class cylinder : public body {
virtual char* identify() const;
virtual float GetVolume() const;
virtual float GetSurface() const;
// a cylinder is described by
Try to avoid that altogether. Think first. Subclass, as we did with Body. Occasionally, you’ll have to change the schema still.
That’s a tough one with a PB of data