. . . (, ) / . ( ) . ,
H. , / (, , ; ). . .
4.2. . (Class Diagram)
UML , .
, () , , , .
(class) , , , .
. - , . .
, . , , ( ).
, , .
(operation) () , . .
|
|
(method) , ; .
: , . , (statechart diagram), .
, , , . , , , ( ).
, . , :
(class attributes) (, properties) , .
. , (, , , , , , , ), , .
, , . , , . , , . .
(name) , , . , , .
(type) , . . , , _: String ( ).
(changeability) , ( ), :
changeable (, ) - , , .
addOnly , , . .
frozen () . () .
, [1..2]: String 2 :
1. ().
2. / ( )
addOnly, (), , . , .
|
|
( ) .
(initial value) () , , . . . , .
() ( ).
UML , .
:
: Color = (255, 0, 0) { RGB-}
[1,2]: String =
: =
(multiplicity), . - , . ( ) .
[1] , ( )
[0..1] ( )
[__1..__1, __2..__2, , __k..__k]
, , - ( ).
* - .
. (Customer) (name), (phone) 1 3 (references) .
(visibility) ( ), :
+ public (, ) , ;
# protected () , ;
- private () , . () .
, . .
(+, #, -), (public, protected, private).
UML , , .
, : < >:: < >. : :: .
(scope) . .
1) (owner scope) , ( instance, ) ( class, ). ( ) , . , .
2) (target scope) ( instance, ) ( class). , . , - ( ).
|
|
, , .
.
% : Integer {owner scope = class} . : % : Integer
{} , (, ). . :
=
. , , ( ) ..
:
<> <><>: = < > { }.
, . 0 (), null.
, . , . . , , . .
(operation) , . .
(method) (call event). . . (case) .
, ( ), .
.
(name) , . ( ) , . . . . () .
(concurrency) () ( ).
:
sequential () , ; , , ().
guarded () , , , . .
|
|
concurrent () , , , , .
, , .
(polymorphism) , - ( ). , -: (.. , ).
. isPolymorphic = true ( ) isPolymorphic = false.
(query) , . . . : query isQuery = true; isQuery = false ( ) .
(return type) , ( ). null. , . , . (, ).
(scope)- , .
(instance) .
(class) , , .
(visibility) :
+public, ;
#protected, ;
-private, .
.
(specification) , , (, ). UML ( ) , . . ( OCL).
( method) , , :
(behavior) , .
(body) , () . . , .
(collaboration) , .
, . , abstract , .