Object-Oriented Modeling: Concepts, Models, and Benefits
Object-Oriented Concepts
1. Abstraction: Focusing on an object’s purpose and functionality before implementation. This means emphasizing what an object does rather than how it does it.
2. Encapsulation: Also known as information hiding, encapsulation separates an object’s external interface (accessible to other objects) from its internal implementation details (hidden from other objects).
3. Combining Data and Behaviour: This principle allows callers of an operation to disregard the number of implementations. Operator polymorphism shifts the decision of which implementation to use from the calling code to the class hierarchy.
4. Sharing: Object-oriented technologies promote sharing at various levels. Inheritance of data structures and behavior allows subclasses to share common code, a key advantage of object-oriented languages. This sharing extends beyond a single application, enabling design and code reuse in future projects.
5. Emphasis on Essence: Object-oriented technology prioritizes an object’s inherent nature over its specific uses. An object’s applications depend on the application’s details and often evolve during development.
6. Synergy: Identity, classification, polymorphism, and inheritance are fundamental to object-oriented languages. While usable independently, these concepts work synergistically to enhance each other’s strengths.
Benefits of Object-Oriented Development
- Facilitates testing of a physical entity before construction.
- Improves communication with customers.
- Enhances visualization.
- Reduces complexity.
Abstraction
- Involves selectively examining specific aspects of a problem.
- Aims to isolate important aspects for a particular purpose while suppressing irrelevant ones.
- An effective model captures the critical aspects of a problem while omitting the rest.
The Three Models of Object-Oriented Systems
These models provide related but distinct viewpoints of a system:
- Class Model: Represents the static, structural, and data aspects of a system.
- State Model: Represents the temporal, behavioral, and control aspects of a system.
- Interaction Model: Represents the collaboration and interaction patterns of individual objects within a system.
These three models offer separate views of a system. For example, the class model links operations to classes, while the state and interaction models elaborate on these operations.
Class Model
- Describes the structure of objects in a system, including their identity, relationships, attributes, and operations.
- Aims to capture essential real-world concepts relevant to the application.
- Expressed through class diagrams, which define attribute values and operations for each object.
- Provides context for the state and interaction models.
State Model
- Describes time-related and sequential aspects of objects, including events, states, and their organization.
- Expressed through state diagrams, illustrating permitted state and event sequences for a class of objects.
- Captures the system’s control flow, outlining the sequence of operations without specifying their details, operands, or implementation.
Interaction Model
- Describes how objects interact to achieve system behavior.
- Documented using use cases, sequence diagrams, and activity diagrams:
- Use Cases: Capture major interaction themes between the system and external actors.
- Sequence Diagrams: Illustrate interacting objects and their interaction sequence over time.
- Activity Diagrams: Depict the control flow among processing steps in a computation.
Relationship Among the Three Models
Class Model
- Provides the data structure foundation for the state and interaction models.
- Its operations correspond to events and actions in other models.
State Model
- Describes the control structure of objects.
- Shows decisions based on object values and actions that modify object values and states.
Interaction Model
- Focuses on communication between objects.
- Offers a comprehensive overview of system operation.
Class Modeling Concepts
- Class & Object Diagrams
- Association & Links
- Multiplicity
- Multiplicity & Visibility of Attributes
- Association End Names
- Association Classes
- Qualified Associations
- Generalization and Inheritance
- Overriding Features
- Ordering, Bags & Sequences
