Object Orientation and Generic Programming Flashcards
Why do we use a class diagram?
Represents a static view of an application
What are the types being modelled within a system with a class diagram?
Classes
Interfaces
Data types
Components
What is the order of components on class diagram box (top to bottom)
Class Name
Class Attributes
Class Operations
How do you write an attribute in a class diagram box?
name : attribute type
How do you write an operation in a class diagram box?
name(parameter : type) return type
How to you write Zero or One?
0..1
What is 0..* or *
Zero or more
How to identify a multiplicity of “exactly three”
3
How to identify a multiplicity of “two to four”
2..4
What is the short hand for an aggregation relationship?
has-a
What is a reflexive association?
A class that is associated with itself (employee)
What do you use to organize a model’s classes?
Package
Why use an interface class?
Because you want to implement it.
What is the visibility symbol for public?
+
What is the visibility symbol for private?
-