BouncingObjects
Example program BouncingObjects, shown in Figure 1, implements a simple object database using Access. The database stores serializations for Bouncer objects that represent the moving shapes shown in Figure 1.
Figure 1 Example program BouncingObjects displays a collection of bouncing shape objects.
The Bouncer class stores information about the bouncing shapes in the public properties BouncerType (an enumerated type indicating circle, square, or diamond), Radius, X, Y, dX, dY (dX and dY indicate the object's speed and direction), and ColorName.
When you select the Data menu's Randomize command, the program deletes any Bouncer objects in the database, and creates 10 new ones. After you have created some objects, use the option buttons to tell the program which objects it should load and display.
The program's database contains a Bouncers table with a single field: Serialization. The program doesn't need to do much with the objects, so that's all it needs. For example, it doesn't search for objects moving more than a certain speed, so it doesn't need a Speed field.