2.6. Exercises

  1. Sketch an abstraction hierarchy that relates all the following classes in a reasonable manner:

    Apple
    Banana
    Beef
    Beverage
    Cheese
    Consumable
    Dairy Product
    Food
    Fruit
    Green Bean
    Meat
    Milk
    Pork
    Spinach
    Vegetable

    Note any challenges you faced in doing so.

  2. What aspects of a television set would be important to abstract from the perspective of

    • A consumer wishing to buy one?

    • An engineer responsible for designing one?

    • A retailer who sells them?

    • The manufacturer?

  3. Select a problem area that you want to model from an object-oriented perspective. Ideally, this will be a problem that you're actually going to be working on at your place of employment or that you have a keen interest in. Assume that you're going to write a program to automate some aspect of this ...

Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.