Chapter 2 Building an Object-Oriented Model
21
Visibility
The visibility of a class refers to the way in which it can be seen by other
objects. A class that is visible to another object may influence the structure or
behavior of the object, or similarly, its own properties may be affected by the
other object.
Property Visible
Private Only to the class itself
Protected Only to the class and its inherited objects
Package To all objects contained within the same package
Public To all objects in the model
Cardinality
The cardinality of a class specifies the number of instances that the class can
have.
Cardinality Number of instances
0..0 None
0..1 None or one
0..* None to an unlimited number
1..1 One to one
1..* One to an unlimited number
* Unlimited number
Creating a class
There are three ways to create a class:
♦ Create a class symbol in the Browser
♦ Add a new class to the list of classes
♦ Create a class symbol directly in a diagram