File notes/fig/uml/flight_02.tex renamed from notes/fig/uml/Flight_2.tex (similarity 96%) (mode: 100644) (index e2aaf71..c4d7815) |
1 |
|
\documentclass[border=20pt]{standalone}
|
|
2 |
|
\input{template.def}
|
|
3 |
|
|
|
4 |
|
\begin{tikzpicture}
|
|
5 |
|
\begin{class}[text width=7cm]{Pilot}{0,0}
|
|
6 |
|
\attribute{Id : Integer}
|
|
7 |
|
\attribute{Name : String}
|
|
8 |
|
\attribute{Experience : Level}
|
|
9 |
|
\end{class}
|
|
10 |
|
\begin{class}{Plane}{11, 0}
|
|
11 |
|
\attribute{tailId : Integer}
|
|
12 |
|
\attribute{MaxSpeed : MPH}
|
|
13 |
|
\attribute{AirPlaneType: Model}
|
|
14 |
|
\end{class}
|
|
15 |
|
\association{Plane}{}{1..*}{Pilot}{0..1}{}
|
|
16 |
|
\end{tikzpicture}
|
|
17 |
|
|
|
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
|
|
4 |
|
\begin{tikzpicture} |
|
5 |
|
\begin{class}[text width=7cm]{Pilot}{0,0} |
|
6 |
|
\attribute{Id : Integer} |
|
7 |
|
\attribute{Name : String} |
|
8 |
|
\attribute{Experience : Level} |
|
9 |
|
\end{class} |
|
10 |
|
\begin{class}{Plane}{11, 0} |
|
11 |
|
\attribute{tailId : Integer} |
|
12 |
|
\attribute{MaxSpeed : MPH} |
|
13 |
|
\attribute{AirPlaneType: Model} |
|
14 |
|
\end{class} |
|
15 |
|
\association{Plane}{}{1..*}{Pilot}{0..1}{} |
|
16 |
|
\end{tikzpicture} |
|
17 |
|
|
18 |
18 |
\end{document} |
\end{document} |
File notes/lectures_notes.md changed (mode: 100644) (index 275b6d0..0c32f72) |
... |
... |
Exercise +.# |
5877 |
5877 |
~
|
~
|
5878 |
5878 |
Consider the following diagram:
|
Consider the following diagram:
|
5879 |
5879 |
|
|
5880 |
|

|
|
|
5880 |
|

|
5881 |
5881 |
|
|
5882 |
5882 |
Give the number of attributes for both classes, and suggest two operations for the class that does not have any. Discuss the multiplicities: why did the designer picked those values?
|
Give the number of attributes for both classes, and suggest two operations for the class that does not have any. Discuss the multiplicities: why did the designer picked those values?
|
5883 |
5883 |
|
|
|
... |
... |
Solution +.# |
6186 |
6186 |
As far as we know "hand" could refer to a card game, and "person" could refer to players.
|
As far as we know "hand" could refer to a card game, and "person" could refer to players.
|
6187 |
6187 |
A straightforward representation of the same diagram as a U.M.L. class diagram could be:
|
A straightforward representation of the same diagram as a U.M.L. class diagram could be:
|
6188 |
6188 |
|
|
6189 |
|

|
|
|
6189 |
|

|
6190 |
6190 |
|
|
6191 |
6191 |
Note that we could convey more information, for instance by using aggregation, or even composition, but, without more information about those entities and this relationship, it may be safer not to make any additional supposition.
|
Note that we could convey more information, for instance by using aggregation, or even composition, but, without more information about those entities and this relationship, it may be safer not to make any additional supposition.
|
6192 |
6192 |
|
|
|
... |
... |
Solution +.# |
6198 |
6198 |
Composition association: class does not exist without the association.
|
Composition association: class does not exist without the association.
|
6199 |
6199 |
|
|
6200 |
6200 |
Solution +.#
|
Solution +.#
|
6201 |
|
~ 
|
|
|
6201 |
|
~ 
|
6202 |
6202 |
Because it avoids redundancy.
|
Because it avoids redundancy.
|
6203 |
6203 |
|
|
6204 |
6204 |
|
|
6205 |
6205 |
Solution +.#
|
Solution +.#
|
6206 |
|
~ 
|
|
|
6206 |
|
~ 
|
6207 |
6207 |
|
|
6208 |
6208 |
|
|
6209 |
6209 |
## Problems {-}
|
## Problems {-}
|
|
... |
... |
Problem (From E.R. to relational schema and UML class diagram -- CAR\_INFO) +.#c |
6732 |
6732 |
|
|
6733 |
6733 |
Consider the following E.R. schema for the CAR\_INFO database:
|
Consider the following E.R. schema for the CAR\_INFO database:
|
6734 |
6734 |
|
|
6735 |
|

|
|
|
6735 |
|

|
6736 |
6736 |
|
|
6737 |
6737 |
Note that a car can have at most one driver, $N$ passengers, $N$ insurances, and that car insurances exist only if they are "tied up" to a car (i.e., they are weak entities, and their identifying relationship is called "Insured").
|
Note that a car can have at most one driver, $N$ passengers, $N$ insurances, and that car insurances exist only if they are "tied up" to a car (i.e., they are weak entities, and their identifying relationship is called "Insured").
|
6738 |
6738 |
|
|
|
... |
... |
Problem (From UML to relational model -- DRIVER) +.#UMLtoRELDriver |
6801 |
6801 |
Consider the UML diagram below, and convert it to the relational model.
|
Consider the UML diagram below, and convert it to the relational model.
|
6802 |
6802 |
Do not forget to indicate primary and foreign keys.
|
Do not forget to indicate primary and foreign keys.
|
6803 |
6803 |
|
|
6804 |
|

|
|
|
6804 |
|

|
6805 |
6805 |
|
|
6806 |
6806 |
|
|
6807 |
6807 |
## Solutions to Selected Problems {-}
|
## Solutions to Selected Problems {-}
|
|
... |
... |
Solution to [%D %n (%T)](#problem:carinfo) |
7128 |
7128 |
|
|
7129 |
7129 |
Note that, during the coversion, we had to make "Insured Car" part of the primary key of CAR INSURANCE.
|
Note that, during the coversion, we had to make "Insured Car" part of the primary key of CAR INSURANCE.
|
7130 |
7130 |
|
|
7131 |
|

|
|
|
7131 |
|

|
7132 |
7132 |
|
|
7133 |
7133 |
---
|
---
|
7134 |
7134 |
|
|