Let say we want to model a car travelling along a road. This is a very simple model. Our road is a list of vectors- each a distance plus a speed limit. Our car has a location - which is the road segment plus the position along that segment. It also has a speed.
Now if we were modelling this procedurally we'd store the list perhaps in an array of structs (in C/C++), perhaps have a car struct with data and a bunch of procedures to move the car along.- with names like
- EnterRoadSegment( int RoadSegment);
- MoveCarAlongRoadSegment(struct * car,int RoadSegment);
- SetCarSpeed(Struct * car,int NewSpeed);
- IsCarAtRoadSegmentEnd(struct * car,int RodSegment);
With OOP though we create classes
- For the car
- For a road segment
- For the Simulation that holds the other classes.
- Travel();
- IncreaseSpeed(int NewSpeed);
On the Next Page : Creating the Classes

