Software
Describe the difference between a use case and a class diagram. What is the purpose of each? What role do they play in object-oriented-programming design specifically?
Create a class diagram that describes an automobile dealership. Your class diagram should include at least 6 classes and show the relationships between the classes.
Refer to this site for additional examples of class diagrams:
http://www.agilemodeling.com/artifacts/classDiagram.htm
Use Cases
A use case is a description of a sequence of actions that a user can take to achieve a goal. Use cases are used to capture the functional requirements of a system. They are typically written in a natural language that is easy for stakeholders to understand.
The purpose of a use case is to:
This class diagram shows six classes: Car, Customer, Salesperson, Order, Make, and Model. The relationships between the classes are shown with arrows. For example, the arrow from Car to Order shows that a Car can be ordered by a Customer.
This class diagram is a simplified representation of an automobile dealership. It does not show all of the classes and relationships that would be needed in a real-world dealership. However, it is enough to illustrate the basic concepts of class diagrams and their use in object-oriented-programming design.
- Identify the different ways that users will interact with the system.
- Document the functional requirements of the system.
- Communicate the functional requirements of the system to stakeholders.
- Identify the different classes in the system.
- Document the relationships between classes.
- Communicate the structural requirements of the system to stakeholders.
class Car {
String make;
String model;
int year;
int mileage;
double price;
}
class Customer {
String name;
String address;
String phone;
String email;
}
class Salesperson {
String name;
String licenseNumber;
int yearsOfExperience;
}
class Order {
Car car;
Customer customer;
Salesperson salesperson;
Date purchaseDate;
double price;
}
Car <-- Order
Customer <-- Order
Salesperson <-- Order