7. 1.
1.5 UML
1.5.1 /Ý ( Use Case Diagram )
/Ý ×/ ü
/ ü /
Ý Ðü
1.5.2 (Class Diagram)
E Ñ
Graphics
4 4Þ Dra w()
4
Add(g : Gra phics)
(
)
Remo ve(g : Graphics )
GetChild(index : int)
' Line Rectangle Gr oupGr aphics
Ó Ñ 4 Dr aw () Dr aw () Dr aw () +children
Add(g : Gr aphics)
Rem ov e(g : Gr aphics)
GetChild(index : int)
UML -7-
8. 1.
1.5 UML
1.5.3 ( Object Diagram )
ÝöÜ/Ñ
Ù Ñ Ó
Ý Ñ D
1.5.4 (Sequence Diagram)
Ð//' /Ý
Ð/Ý
' Ð =#
Ó
UML -8-
20. 3.
3.2 Ó,
3.2.2
Ð
3.2.3
Ñ Ý Ð6 Ð
3.2.4 ,
Ð % 3 , % Ñ %# × /Ñ
T
Vehicle
Shape Stack
, %
- fMaxSpeed : float size : i nt
Shape + Draw () Push(elem : T) : int
+ Start() : int
)
Pop() : int
( ( )
GetTop() : c ons t T
+ Stop() : int
,
UML - 20 -
21. 3.
3.3
3.3.1 4
Ð6
4 4 Ñ
UML
ClassDiagram
êé
ôó òñð ï îíì ë
Ù
øÚ÷ÓÒÜöÏõí à
+di agram 1 ..*
use
Ø×Ö
ÝÜ Ù
à ßäã â ÛÚ
*
ÍÌ +thing 1.. * 1…* 1
âÞ
á
Îâäã â æå Îâ
ÓÕÔÓÒÑÐÏ Î Class 1 1
å Îâäã â è çÎâ
1 1
Ý
4
4 Ð4 UML
4 / ' UML
Thing Ó, Ñ 4
Ñ Class Association Ñ
Ó,
ClassDiagram
/Ó 4 Ñ
Relation
Ý Ý
UML - 21 -
22. 3.
3.3.2
E Ð6 Ó, Ñ , Ñ
UML
Relation Thing
4
Þ Ð Ó,
Ð Class Interface
Association Generalization Realization Dependency
3.3.3
Ó
S ha p e
+ D ra w ()
CircleRectangle
UML
Shape
C i rc le R e c ta n g le
3.3.4 Þ
+ D ra w () + D ra rw ()
Ð Þ Ó /
Ý (bind) (friend) UML
T
StackT
Sta ck
Memento
M em en to
s iz e : in t sta te : S ta te*
Originator
P u s h (e l e m : T ) : i n t
IntStack %TÑ D fr i e n d Þ à
Ü
P o p () : i n t
ù
int OriginatorÜ/Memento
G e t T o p () : c o n s t T
O r ig in a t o r
int state
%#
b in d b in d
In t S t a c k F lo a t S t a c k
UML - 22 -
23. 3.
3.4 Ñ
3.4.1
V e h ic le
{ a b st r a c t }
- f M a x S p e e d : f lo a t
+ S t a rt () : in t
+ S t o p () : in t
+ R u n (f l o a t f S p eed ) : i n t
C++ Java
class Vehicle public abstract class Vehicle
{ {
public: public abstract int Start();
virtual int Start() = 0; public abstract int Stop();
virtual int Stop() = 0; public abstract int Run(float
virtual int Run(float fSpeed);
fSpeed) = 0;
private: private float fMaxSpeed;
float fMaxSpeed; }
};
UML - 23 -
24. 3.
3.4.2 4
C++
D i a lo g class Dialog
- b tn O K : B u tto n
- b tn C a n c e l : B u tto n {
- t x t In fo : T e x t B o x
private:
Button btnOK;
T e x tB o x
Button btnCancel;
B u tto n
TextBox txtInfo;
Dialog };
Button TextBox class Button
{};
class TextBox
{};
3.4.3
A c co u n t
b a la n c e : d o u b le = 1
C++
D e p o s it (a m o u n t : d o u b le ) : in t class SavingsAccount : public Account
C o m p u t e I n t e re s t( ) : d o u b l e
{ };
S a v in g s A c c o u n t Java
C o m p u t e In t e r e s t () : d o u b le
public class SavingsAccount extends Account
{}
UML - 24 -
25. 3.
3.4.4
S ha p e
C++
ûú
Java
ûú
+ D ra w () class Shape
{ public interface Shape
public: {
C ir c le R e c t a n g le virtual void Draw() = 0; public abstract void Draw();
- p t U p p e r L e f t : P o in t }; }
- p t C e n t e r : P o in t
- n R a d iu s : in t - n W id t h : in t
+ D r a w () - n H e ig h t : in t
class Circle : public Shape public class Circle implements Shape
+ D r a r w ()
{ {
public: public void Draw();
C++ EÜ/ void Draw();
Ü/ private ü private Point ptCenter;
Java E C
Point ptCenter; private int nRadius;
int nRadius; }
interfaceimplements };
3.4.5 Þ ûú
C++ ¡ ÿþý ûú
T templatetypename T C++ ( )
class Stack class FloatStack
S ta c k
- s iz e : in t { {
private: private:
+ P u s h ( e le m : T ) : i n t
+ P o p () : i n t int size; int size;
+ G e tT o p ( ) : c o n s t T public: public:
int Push(T elem); int Push(float elem);
b in d b in d
int Pop(); int Pop();
const T GetTop(); const float GetTop();
In t S t a c k F lo a t S t a c k
}; };
Þ typedef Stackfloat FloatStack;
UML - 25 -
26. 3.
3.5 Ý
3.5.1 3
3 Ð6 ÐÔ ' / Ü/ ' /
' Ð '
' Ü ' % Ñ/ Ó Ð
/
Graph ics
' ,
Dra w()
Graphics:
Draw /Ó
Add (g : Gra ph ics)
R emo v e(g : Graph ics )
GetC h ild( ind ex : int) AddRemove
LineRectangle: '
Lin e R ect a n gle G r ou p G r a p h ics GroupGraphics: Ñ, ×
+children ( ' )
Dr a w () Dr a w () Dr a w ()
Add(g : G r a ph ics )
R em ov e(g : G r a ph ics )
G et Ch ild(in dex : in t )
UML - 26 -
28. 3.
3.6
(Menu) (MenuItem)
M e n u
(Command) + A d d (it e m : M e n u Ite m )
(OpenCommand PasteCommand) 1-4
(1)
F
M e n u Ite m
- c om m and : C om m a nd*
MenuMenuItem
G
+ C lic k ()
MenuItemCommand
H
0 ..*
+ e x e c u ti v e
CommandOpenCommand
I
1 ..*
CommandPasteCommand C o m m an d
(2)OpenCommand PasteCommandÖ
F
+ E x e c u te ()
G
H 4 O p enC o m m and P a s te C o m m a n d
I + E x e c u te () + E x e c u t e ()
(3)3 (EditMenu)Ð ÑE Ó
Menu M e nu M e nu M e nu
+ Add(item : MenuItem) + A d d (it e m : M e n u Ite m ) + A d d (it e m : M e n u Ite m ) + A d d (it e m : M e n u Ite m )
EditMenu E d it M e n u E d it M e n u E d it M e n u
F G H I
(4)ÑE Ú (C++) Ó MenuItem
class MenuItem class MenuItem class MenuItem class menuitem
{ { { {
private: public: private: public:
virtual void Click() =0; virtual void Click() = 0; virtual void Click() = 0; virtual void Click() = 0;
public: private: void undo(); private:
Command* command; Command* command; public: Command* command;
}; }; Command* command; };
F G H I
};
UML - 28 -
29. 3.
(Graphics) (Segment) (Rectangle)
G ra p hic s
(Point) (Point3D) 5-7 + D ra w ()
(5)ÑE
F 4 G H IÞ
S eg m en t R ecta n g le
- p tS ta rt : P oin t - p tU p p erL eft : P oin t
- p tE n d : P oin t - n W idth : in t
FGHI Ñ
+ D ra w () - n H eig h t : in t
F
(6)ÑE + D ra rw ()
F 0...* G1 H0...* I1 H
P oin t3 D
G
(7)ÑE Ú Ó Segment I
P oin t
- x : in t
- x : in t
(Java) - y : in t
- y : in t
- z : in t
+ D ra w ()
public class Segment implements Graphics public class Segment extends Graphics + D ra w ()
{ {
privatc void Draw(); public void Draw();
public Point ptStart; private Point ptStart;
public Point ptEnd; private Point ptEnd;
} }
8 9
public class Segment implements Graphics public class segment implements graphics
{ {
private Point ptStart; public void Draw();
private Point ptEnd; private Point ptStart;
public void Draw(); private Point ptEnd;
} }
@ A
UML - 29 -
30. - 30 - UML
rŠ—
ƒy €’H kvu‰ˆ‡†…r…„†…ddeYts‚ „ƒdeYdts‚ €cvu ~vu
r}deY|dt s{Ed
) ( deY
jzy xwdts” vudtsrqXp onmld’vkts…„djdi hxgf
rd™—‚˜—–
D•” DWVt s‚“’ ‘‰ˆ €‡†…„dt srtsdƒ‚vP€y xwdH vu ts
) (
r qpHichI gcfedcba`YXWVSRUTSRP QP I
H GF EDCB
Ó, 4.2
# Ñ ×
%
Ó / Ô /Ý Ó
=# Ó '
Ð ' Ð/Ý /Ý /'
4.1
4.
37. 5.
5.6 Ý
1.
actor Print Computer
Computer Print
PrintServer '
PrintServer Print printer
/
2./ Ó,
:Q ueue : E l e va t o r Ñ
/
2 : n e x t jo b : = G e t . jo b ( )
1 . 1 * [ a ll q u e u e s ] : le n : = L e n g t h ()
1 . 3 : In vo k e ( j o b )
: E l e va t o r :O rd e r D
/
C o n tro l 1 . 2 : C r e a te ( ) {n e w }
1 : G e t E l e va t o r ( fl o o r i d )
: bu t t o n
P ush( )
: A c tor
Ñ / × Ñ / / /
/ × Ð D + Ð %
/ D 1 D/ × D Ð / Ð
Ñ
UML - 37 -
39. 5.
' Ñ
: b u t to n : E l e va t o r :Q ueue : E l e va t o r : O rd e r { n e w }
: A c tor
C o n tr o l
P ush( )
1 : G e t E l e va t o r ( fl o o r i d )
1 . 1 * [ a ll q u e u e s ] : le n : = L e n g t h ()
1 . 2 : C re a t e ( )
1 . 3 : In vo k e ( j o b )
2 : n e x t j o b : = G e t .j o b ( )
F Ñ / D
$ % '
F G H I J
G ,QYRNHMRE Ó
F G
$ 4XHXH % (OHYDWRURQWURO (OHYDWRU ' %XWWRQ
UML - 39 -
40. 6.
6.1
6.1.1
/ ' Ó Ù ÔÓ
6.1.2 /Ó
Actor '
6.2
6.2.1
/ ' Ð' '
Ô' Ô ÔÓ
6.2.2=
= /Ð Ð = /
Ó
Ð ' = / Ð /
UML - 40 -
42. 6.
6.5 Ý
(1)
Ñ
assigned to
subscription
time out
Available
Locked Available lock Locked buy Sold
Sold
=
Available unlock
= #
(lock)Available Locked
exchange
(buy)Locked Sold
Ó
D(unlock)Locked Available
'(time out)Locked Available
(assigned to)Available Sold
# (exchang) %Sold Available
UML - 42 -
57. 9.
9.6
1. /Ó D
A. B.E
2. Ý
A. B.C
3. Ð Ý Server:HostMachine Server_____HostMachine_____
A. B.
4. 1: Þ 1 Þ
A. B.C
5.“ _____ Þ
A. B.
1.B 2.A 3.BA 4.B 5.A
UML - 57 -
58. D WAVE
1 What to do? (Not how to do.)
2 Actor’s point of view?
3 Value for the actor?
4 Entire flow of events?
1 /Ý Ö Ñ
2 /Ý Þ# Ñ ( × Ñ Ü/ /Ý, Ñ×
)
3 /Ý Ñ Þ
4 /Ý Ñ # Ü/ Ð Ó
UML - 58 -