UML representation of a class has 3 compartments as shown in Figure 1
1. The name compartment (required) contains the class name and other documentation-related information: E.g.:
Some_class «abstract»
{ author: George Jetson
modified: 10/6/2999
checked_out: y
}
- Guillemets identify stereotypes. E.g.: «utility», «abstract» «interface».
- Can use a graphic instead of word.(«interface» often represented as small circle)
- Access privileges or visibility (see below) can precede name
- Use italics for abstract-class and interface names.
2. The attributes compartment (optional):
Everything except constant values must be private, Always.3. The operations compartment (optional) contains method definitions:
message_name(arguments): return_type
Resist the temptation to use implementation-language syntax.
Visibility (access privileges) indicated as follows:
+public
#protected~package
-private
--implementation visibility (inacessible to other objects)
(+)forced public.Override of an interface method
that should be treated as private, even if it's declared as public
-private
--implementation visibility (inacessible to other objects)
(+)forced public.Override of an interface method
that should be treated as private, even if it's declared as public
How to create class diagrams in Netbeans 6.1
1. «utility», «abstract» «interface» can be created as shown in Figure 2
2. Attribute of a class can be created by right-clicking on the Attributes label in class diagram as shown in Figure 3.
No comments:
Post a Comment