2.3 UML Class Models Flashcards
What is UML used for?
To represent our software analysis
What is a UML Class Digram?
aka static structure diagram
contains representations of:
- classes
- interfaces
- objects
- relationships
What is a Class?
A description of a similar set of instances.
What type of word makes a good class candidate?
Nouns
What are candidates for a Class?
- domain objects
- roles
- events
-interactions
How is a class represented visually in UML?
Denoted by a rectangle with three horizontally partitioned units.
- Name (required)
- Attributes
- Operations
What does it mean when a class name is in italics?
It’s an abstract class.
Abstract classes describe the properties of subclasses but NEVER have their own instances.
Why might you want to use an abstract class?
If you have related subclasses that have common features you can factor those features up into the abstract class.
What are the symbols for visibility?
+ public
- private
# protected
~ package
What attributes can you specify?
- name
- type
- (optional) multiplicity and ordering
- (optional) initial value
- (optional) derivation
- properties e.g., {frozen}
What operation parameters can you specify?
- name
- type
- default value
- kind (in, out, inout)
What operation properties can you specify?
- {query}
- {concurrency}
- {abstract}
- class scope (shown by an underline)
What does an Interface require in UML?
Describe what the interface provides and requires.
parameterized classes
Parameterized classes correspond to Java generics
nested classes
- suitable for inner classes