week04c
week04c
Example 0
A token-ring based local-area-network (LAN) is a network
consisting of nodes, in which network packets are sent
around. Every node has a unique name within the network,
and refers to its next node. Different kinds of nodes exist:
workstations are originators of messages; servers and
printers are network nodes that can receive messages.
Packets contain an originator, a destination and content,
and are sent around on a network. A LAN is a circular
configuration of nodes.
Task:
Draw a class diagram which consists of all the classes in
your system their attributes and operations, relationships
between the classes, multiplicity specifications, and other
model elements that you find appropriate.
Figure 2 – A token-ring based local-area-network
Class Diagram
Example 1
Create a class diagram for a web based public library. A public
library typically stores a collection of books, movies, or other
library items available to be borrowed by people living in a
community. Each library member typically has a library
account and a library card with the account’s ID number,
which she can use to identify herself to the library. A
member’s library account records which items the member
has borrowed and the due date for each borrowed item. Each
type of item has a default rental period, which determines
the item’s due date when the item is borrowed. If a
member returns an item after the item’s due date, the
member owes a late fee specific for that item, an amount of
money recorded in the member’s library account
Example 2
Create a class diagram based on the following description. You
have been asked to build a management system for a group of
archeologists. The group is comprised of multiple teams of
researchers. Each team has a letter ID (e.g., team A, team B).
Each researcher belongs to one of the teams, and has an ID
number, a first name, and a last name. There are two types of
researchers: field and lab staff. Each field staff member has a
favorite region (string). Each lab researcher supports up to 2 field
researchers. Some researchers may not be supported by a lab
researcher. The company also manages an inventory of
equipment. Researchers of any type may check out up to 3
pieces of equipment. Each piece of equipment has a serial
number and replacement cost.
Example 3
Imagine that you are tasked with developing a system for a pizza shop. Given
the following description, create a class diagram (in the form of a UML class
diagram). Include all conceptual classes, attributes, associations, and
generalization relationships mentioned in the descriptions. Label all
associations and include all multiplicities. A customer places orders. A
customer has a name and phone number. There are two types of orders: pick-
up and delivery. A pick-up order has a pick-up time. A delivery order has an
address and deliver-by time. All orders consist of a set of items. There are two
types of items: pizzas and drinks. All items
have a price. A pizza has a size and a crust type. A pizza also has a number of
toppings. A topping has a topping type and a price. Some pizzas are special
pizzas that have a name (e.g., “Hawaiian” or “Meat Lovers”). A drink has a
brand and a flavor