Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context:
Understanding what constitutes the “state” of an object is foundational to object-oriented analysis and design. State is not limited to primitive fields; it includes any information necessary to describe the current condition of an object, which often extends to the relationships it maintains with other objects.
Given Data / Assumptions:
Concept / Approach:
An object’s state is the collection of information that can affect its behavior and identity at a point in time. This includes attribute values (for example, balance = 2000) and the set of links to other objects (for example, an Account linked to a Customer). Links represent navigable associations and composition relationships that may constrain or inform behavior and invariants, so they are part of the observable state of the system.
Step-by-Step Solution:
Verification / Alternative check:
Consider invariants: a “Shipped” Order must have at least one LineItem and a non-null Customer link. Such constraints depend on both attribute values and the presence/absence of links—clear evidence that links are part of state.
Why Other Options Are Wrong:
Common Pitfalls:
Treating associations as purely navigational without recognizing their contribution to invariants and business rules; forgetting that mutable links change state even if attribute values do not.
Final Answer:
Correct
Discussion & Comments