Assignment
1. What is the purpose of a class diagram?
2. What is a primary key?
3. What is multiplicity and how is it shown in a class diagram?
4. What are the advantages of relational databases.
5. Adapted from the examples we did in class, identify the relationship between the following five entities. Follow the example as shown below. Write down assumptions or business rules that affect your decision. Draw UML class diagram with sample properties for each class. Be sure to include minimum and maximum values.
A sample answer is as follows:
Order, Customer
An order must have one and only one customer associated with it. A Customer can have many orders, but does not need to have any. This is an one-to-many [1:*] relationship.
1) order, items
2) employee, order
3) customer, credit card number
4) airplane, flight
5) employee, CEO
6. A small company makes winter gloves for men and women. Originally, the gloves were woven wool, but recently the company has also added leather gloves and might consider synthetic materials in the future. The woolen gloves come in a variety of colors. Sizes are typically small, medium, and large which are slightly different for men and women (largely in terms of finger length). The factory also produces different styles which tend to be variations in length of the glove, cuffs, or designs in the stitching or emblems. The company needs a database to track the orders.
Create the class diagram and the tables in table notation for this glove manufacturing company based on their business rules. Pay attention to many-to-many relationships. As we discussed in class especially in this level there is not just one answer. You have to justify the decisions you made for the classes and the relationships.
Order ID Customer/Store Contact Person Address City, State, ZIP
|
Order Date Ship Date
|
|
|
ItemID
|
Description
|
Size
|
Color
|
Style
|
Gender
|
Quantity
|
Sale Price
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7. A friend of yours wants to start a financial-planning business. The basic goal is to help people determine how much money they need to save for various events such as retirement and college tuition for their children. He has financial models that he uses to advise clients. However, he needs a way to track the clients and the individual suggestions he has provided to them, as well as their major goals and comments. Essentially, he wants to track the sessions that he holds, including the fees that he charges.
Client Meeting Client last name, first name, spouse Phone, Email Address City, State, ZIP
|
Meeting Date Location Start Time End Time Fee
|
Investment Goals
|
Date Made
|
Target Date
|
Amount Needed
|
Comment
|
|
|
|
|
|
|
|
|
Savings Plan
|
Investment
|
Date Needed
|
Amount
|
Maturity
|
Risk
|
Comment
|
|
|
|
|
|
|
|
|
|
|
|
|
Client Comments and Concerns
|
Date
|
Comment
|
|
|
|
|