Class Diagram (I) Flashcards
(20 cards)
What is a class diagram?
A picture that shows classes, their attributes, operations, and relationships in a system.
What is an object?
An individual instance of a class (e.g., a specific ‘Student’ named ‘Alice’).
What is a class?
A blueprint for objects (e.g., ‘Student’ class defines all students).
What are attributes?
Properties of a class (e.g., ‘Student’ has ‘name’ and ‘age’).
What are operations?
Actions a class can do (e.g., ‘Student’ can ‘enroll()’).
What is visibility in attributes/operations?
Who can access them: ‘+’ (public), ‘-‘ (private), ‘#’ (protected), ‘~’ (package).
What is a derived attribute?
An attribute calculated from others (e.g., ‘age’ from ‘birthDate’).
What is multiplicity?
How many values an attribute can have (e.g., ‘[1..*]’ means at least one).
What is a class variable (static attribute)?
Shared by all objects of a class (e.g., ‘totalStudents’ counter).
What is a class operation (static method)?
A method called on the class, not an object (e.g., ‘getTotalStudents()’).
What is an association?
A relationship between classes (e.g., ‘Student’ attends ‘Course’).
What is navigability?
Whether one class can ‘see’ another (arrow points to the accessible class).
What is multiplicity in associations?
How many objects are linked (e.g., ‘1 Teacher’ to ‘* Students’).
What is a role in associations?
The part a class plays in a relationship (e.g., ‘Teacher’ as ‘instructor’).
What is an XOR constraint?
An object can link to only one of two classes (e.g., ‘Payment’ is either ‘Cash’ OR ‘Card’).
What is a unary association?
A class linked to itself (e.g., ‘Employee’ manages ‘Employee’).
What is an n-ary association?
A relationship involving 3+ classes (e.g., ‘Student’, ‘Course’, ‘Teacher’).
What’s the difference between ‘ordered’ and ‘unordered’?
‘Ordered’ = fixed sequence (e.g., rankings); ‘unordered’ = no sequence (e.g., tags).
What does {readOnly} mean?
The value can’t be changed after creation (e.g., ‘studentID’).
What’s an object diagram?
A snapshot of objects and their links at a specific time.