Hw 12: Inheritance Design
Hw 12: Inheritance Design

 

Due Date: Monday, Dec. 4, 2017 23:59:59

See the General Guidelines for homework assignments.

For this homework assignment you will produce a high-level simple inheritance class design for a set of possible classes for a railroad car system.   A railroad must manage a number of railroad cars, of various types, including:

 

Type

Description

Engine

Motorized car capable of propelling itself and a number of attached cars.

Box car

A platform, with sides and top, for carrying cargo like boxes, crates, animals, etc.

Gondola car

A bin on wheels for carrying loose granular cargo like coal or wheat.

Tanker car

A large bottle on wheels for carrying liquid cargo like gasoline.

Flatbed car

A platform on wheels for carrying large structures.

Refrigerator car

A refrigerator on wheels for carrying boxes or crates of perishable cargo.

Dump car

A bin on wheels for carrying loose granular cargo and dumping it (like a dump truck)

Baggage car

A closet on wheels, used to carry passenger baggage.

From these brief class descriptions, determine if any of the set of potential classes should be related by inheritance, aggregation, or association. Draw the class relationship diagram for the classes above.  Any base class should be shown above any classes derived from it.  Indicate if a class is abstract. You should include all relevant classes that are directly implied by the description above. (Hint: think more about the information here and less about the program being developed.)  

You should apply the design techniques presented in the course notes and lectures, and apply design evaluation criteria to your resulting solution. The process of design is not linear; you may need to revisit some of the design decisions after evaluating your work, and then re-evaluate the revised design.  

There are probably many reasonably good designs for the specification, and certainly a number of poor ones. A design is not good simply because it is possible to produce a working implementation from it.  

You may decide to make use of additional classes, not identified in the problem specification. The class relationship diagram must include all the classes your design will use, and indicate the relationships among them (or of the corresponding objects, if it's easier to think of it that way). Use the notations given in the course notes to indicate association, aggregation and inheritance relationships. For each such relationship, you should indicate the multiplicities involved. For association relationships, be sure to provide a descriptive name.    

Class relationship diagrams are simply connected tables containing design documentation that will provide a quick overview of the final design. They do not provide a formal record of the deliberations that occurred during the design process. Class relationship diagrams should not include implementation-level decisions, such as variable and parameter types.  

Note that any class instantiations from templates or generics are to be represented in the class diagram.

Use the same approach for the class relationship diagrams that was given in the lecture notes.

Class and operation/method forms are not required.

Computer Science 2104 Introduction to Problem Solving
D. Barnette