The initial design
Kitty knows she wants to model a bicycle for her software, and she wants to design her models in a way that maximizes each class’s flexibility. The plan for the start-up is to develop four bicycles with a future expansion to include exotic bicycles and custom builds.
Kitty opens her IDE and creates a class library project to hold her classes since she knows she’s probably going to use these in several different programs. She calls the class library BumbleBikesLibrary
which you’ll find in the sample code for this chapter.
She decides to start with an abstract class and to use inheritance to define her bicycle models for each of the four types of bicycles she intends to initially design and manufacture. Figure 3.6 shows the result of her effort. This set of properties can be used to define nearly any type of bicycle:
Figure 3.6 – The abstract bicycle model.
Let’s take a look at these properties in more...