File notes/Makefile changed (mode: 100644) (index 0ed1e7b..8a27204) |
... |
... |
pdf: lectures_notes.md |
78 |
78 |
### |
### |
79 |
79 |
|
|
80 |
80 |
example: example.md |
example: example.md |
81 |
|
latexmk -silent -cd -pdf fig/er/abstract.tex fig/fd/course.tex fig/misc/schema_design.tex fig/rel_mod/actor.tex fig/uml/hand.tex |
|
|
81 |
|
latexmk -silent -cd -pdf fig/er/abstract.tex fig/fd/course.tex fig/misc/schema_design.tex fig/rel_mod/actor.tex fig/uml_class/hand.tex |
82 |
82 |
pdf2svg fig/er/abstract.pdf fig/er/abstract.svg |
pdf2svg fig/er/abstract.pdf fig/er/abstract.svg |
83 |
83 |
pdf2svg fig/fd/course.pdf fig/fd/course.svg |
pdf2svg fig/fd/course.pdf fig/fd/course.svg |
84 |
84 |
pdf2svg fig/misc/schema_design.pdf fig/misc/schema_design.svg |
pdf2svg fig/misc/schema_design.pdf fig/misc/schema_design.svg |
85 |
85 |
pdf2svg fig/rel_mod/actor.pdf fig/rel_mod/actor.svg |
pdf2svg fig/rel_mod/actor.pdf fig/rel_mod/actor.svg |
86 |
|
pdf2svg fig/uml/hand.pdf fig/uml/hand.svg |
|
|
86 |
|
pdf2svg fig/uml_class/hand.pdf fig/uml_class/hand.svg |
87 |
87 |
pandoc $(OPTIONSPANDOCHTML) -o example.html $< |
pandoc $(OPTIONSPANDOCHTML) -o example.html $< |
88 |
88 |
pandoc $(OPTIONSPANDOCODT) -o example.odt $< |
pandoc $(OPTIONSPANDOCODT) -o example.odt $< |
89 |
89 |
pandoc $(OPTIONSPANDOCPDF) -o example.pdf $< |
pandoc $(OPTIONSPANDOCPDF) -o example.pdf $< |
File notes/fig/uml_activity/teaching.tex added (mode: 100644) (index 0000000..fa4f2c2) |
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
\begin{tikzpicture}[node distance=1.5cm] |
|
4 |
|
% Frame |
|
5 |
|
\draw [rounded corners] (-4,-1.5) rectangle (7, -8.5); |
|
6 |
|
\node (title) at (5.2, -2) {\textbf{Teaching a class}}; |
|
7 |
|
|
|
8 |
|
% Nodes |
|
9 |
|
\node[initial] (initial) at (0,-1) {}; |
|
10 |
|
\node[action, below of = initial] (ask) {Ask for questions}; |
|
11 |
|
\node[decision, below of= ask] (decision1) {}; |
|
12 |
|
\node[action, below left = 1cm and 1cm of decision1] (answer) {Answer question}; |
|
13 |
|
\node[action, right = 2.3cm of decision1] (intro) {Introduce class}; |
|
14 |
|
\node[decision, below of=intro] (decision2) {}; |
|
15 |
|
\node[action, below left = 1cm and 1cm of decision2] (quiz) {Distribute quiz}; |
|
16 |
|
\node[action, below right = 1cm and 1cm of decision2] (class) {Start class}; |
|
17 |
|
|
|
18 |
|
% Arrow |
|
19 |
|
\draw [arrow] (initial) -- (ask); |
|
20 |
|
\draw [arrow] (ask) -- (decision1); |
|
21 |
|
\draw [arrow] (decision1) -- node[above, pos=1pt]{[Question]} ++(-2cm, 0) -| (answer); |
|
22 |
|
\draw [arrow] (answer) -- ++(2cm, 0) -| (decision1); |
|
23 |
|
\draw [arrow] (decision1) -- node[above, pos=.4pt]{[No question]} (intro); |
|
24 |
|
\draw [arrow] (intro) -- (decision2); |
|
25 |
|
\draw [arrow] (decision2) -- node[above, pos=1pt]{[Quiz]} ++(-2cm, 0) -| (quiz); |
|
26 |
|
\draw [arrow] (decision2) -- node[above, pos=.7pt]{[No quiz]} ++(2cm, 0) -| (class); |
|
27 |
|
|
|
28 |
|
% Etc. |
|
29 |
|
\draw[thick] (quiz) -- ++(0, -1); |
|
30 |
|
\draw[dotted, thick] ($ (quiz)+(0,-1)$) -- ++(0, -.33); |
|
31 |
|
\draw[thick] (class) -- ++(0, -1); |
|
32 |
|
\draw[dotted, thick] ($ (class)+(0,-1)$) -- ++(0, -.33); |
|
33 |
|
\end{tikzpicture} |
|
34 |
|
\end{document} |
|
35 |
|
|
File notes/lectures_notes.md changed (mode: 100644) (index 2974fcf..d3715ff) |
... |
... |
Wide, powerful, but also intimidating. |
5807 |
5807 |
|
|
5808 |
5808 |
You know UML from object-oriented programming language: |
You know UML from object-oriented programming language: |
5809 |
5809 |
|
|
5810 |
|
 |
|
|
5810 |
|
 |
5811 |
5811 |
|
|
5812 |
|
That is an example of a class diagram (with class name, attributes and operators, as well as a particular way to represent that a class extends another), there are other types of diagrams, they are not unrelated! |
|
|
5812 |
|
That is an example of a class diagram (with class name, attributes and operators, as well as a particular way to represent that a class extends another) , there are other types of diagrams, they are not unrelated! |
5813 |
5813 |
For instance, using communication diagrams, deployment diagrams, and state chart diagrams, you can collect the requirements needed to draw a class diagram! |
For instance, using communication diagrams, deployment diagrams, and state chart diagrams, you can collect the requirements needed to draw a class diagram! |
5814 |
5814 |
They each offer a viewpoint on a software that will help you in making sure the various pieces will fit together: it is a tool commonly used in software engineering, and useful in database design. |
They each offer a viewpoint on a software that will help you in making sure the various pieces will fit together: it is a tool commonly used in software engineering, and useful in database design. |
5815 |
5815 |
|
|
|
... |
... |
They describe the behavioral, or dynamic, relationship, between components. |
5843 |
5843 |
- **State machine diagram**, a.k.a., state chart diagram, describes how a system react to external events. You can picture yourself a complex form of finite state automata diagram. |
- **State machine diagram**, a.k.a., state chart diagram, describes how a system react to external events. You can picture yourself a complex form of finite state automata diagram. |
5844 |
5844 |
- **Activity diagram** is a flow of control between activities. You may have seen them already, they are supposedly easy to follow: |
- **Activity diagram** is a flow of control between activities. You may have seen them already, they are supposedly easy to follow: |
5845 |
5845 |
|
|
5846 |
|
 |
|
|
5846 |
|
 |
5847 |
5847 |
|
|
5848 |
5848 |
Then there is the sub-category of "Interaction diagrams": |
Then there is the sub-category of "Interaction diagrams": |
5849 |
5849 |
|
|
|
... |
... |
Exercise +.# |
6224 |
6224 |
~ |
~ |
6225 |
6225 |
Consider the following diagram: |
Consider the following diagram: |
6226 |
6226 |
|
|
6227 |
|
 |
|
|
6227 |
|
 |
6228 |
6228 |
|
|
6229 |
6229 |
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? |
6230 |
6230 |
|
|
|
... |
... |
Solution +.# |
6566 |
6566 |
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. |
6567 |
6567 |
A straightforward representation of the same diagram as a UML class diagram could be: |
A straightforward representation of the same diagram as a UML class diagram could be: |
6568 |
6568 |
|
|
6569 |
|
 |
|
|
6569 |
|
 |
6570 |
6570 |
|
|
6571 |
6571 |
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. |
6572 |
6572 |
|
|
|
... |
... |
Solution +.# |
6578 |
6578 |
Composition association: class does not exist without the association. |
Composition association: class does not exist without the association. |
6579 |
6579 |
|
|
6580 |
6580 |
Solution +.# |
Solution +.# |
6581 |
|
~  |
|
|
6581 |
|
~  |
6582 |
6582 |
Because it avoids redundancy. |
Because it avoids redundancy. |
6583 |
6583 |
|
|
6584 |
6584 |
|
|
6585 |
6585 |
Solution +.# |
Solution +.# |
6586 |
|
~  |
|
|
6586 |
|
~  |
6587 |
6587 |
|
|
6588 |
6588 |
|
|
6589 |
6589 |
## Problems {-} |
## Problems {-} |
|
... |
... |
Problem (From UML to relational model -- DRIVER) +.#UMLtoRELDriver |
7223 |
7223 |
Consider the UML diagram below, and convert it to the relational model. |
Consider the UML diagram below, and convert it to the relational model. |
7224 |
7224 |
Do not forget to indicate primary and foreign keys. |
Do not forget to indicate primary and foreign keys. |
7225 |
7225 |
|
|
7226 |
|
 |
|
|
7226 |
|
 |
7227 |
7227 |
|
|
7228 |
7228 |
|
|
7229 |
7229 |
## Solutions to Selected Problems {-} |
## Solutions to Selected Problems {-} |
|
... |
... |
Solution to [%D %n (%T)](#problem:carinfo) |
7571 |
7571 |
|
|
7572 |
7572 |
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. |
7573 |
7573 |
|
|
7574 |
|
 |
|
|
7574 |
|
 |
7575 |
7575 |
|
|
7576 |
7576 |
--- |
--- |
7577 |
7577 |
|
|