Lesson 2 | OOA - Reading Concepts |
Objective | Understand how object-oriented analysis (OOA) models systems as collections of interacting objects, independent of implementation details. |
In object-oriented analysis, a system is modeled as a collection of collaborating objects. Each object maintains its own state, and the overall systemâs state is the combination of all participating objects. Collaboration occurs through message passing between objects.
Consider two roles in an organization: Programmer and Manager. Both share properties such as name
,
address
, phoneNumber
, and experience
. Yet, they also differ:
Instead of duplicating shared fields, it is best to extract these into a common superclass, Employee
. This illustrates the OOA
principle of identifying generalizations and factoring out common attributes and behaviors.
In nature, offspring inherit traits from their parents while still expressing unique characteristics. Similarly, in Java a subclass inherits variables and methods from its superclass but may also define additional members. This relationship captures both reuse and specialization.
Furthermore, one action can have different meanings depending on context. For example, âeatâ means something different to a deer than to a bear. In Java, this corresponds to polymorphismâthe ability of a single method name to invoke behavior specific to the objectâs runtime type.
Effective OOA requires identifying where inheritance structures clarify relationships and where polymorphism simplifies collaboration. These principles guide the later design and implementation stages.