Object-Oriented Development (OOD) uses three main types of models to represent different aspects of a system: Functional Models, Structural Models, and Behavioral Models. Each model provides a unique perspective, ensuring a comprehensive system design.
1.) Functional Models
Functional models describe what the system does and the functionalities it provides to users. They focus on system operations rather than internal structure or object interactions.
- It helps define system requirements.
- It ensures that the system meets user needs.
- It provides a high-level view of system functionalities.
Key Elements:
- Use Case Diagrams: A primary tool used for functional modeling.
- Actors: Represent users or external systems interacting with the system.
- Use Cases: Represent specific functionalities or tasks the system performs.
- Relationships: Show interactions between actors and use cases.
Example:
In a Library Management System, some common use cases include:
- Borrow Book – A user borrows a book.
- Return Book – A user returns a book.
- Search Catalog – A user searches for books in the library.
2.) Structural Models
Structural models define the static structure of a system, including its classes, objects, attributes, methods, and relationships. They focus on how data is organized and stored.
- It defines the blueprint for system components.
- It supports modular and reusable code.
- It ensures clear relationships between system elements.
Key Elements:
- Class Diagrams: The most commonly used tool for structural modeling.
- Classes: Represented as rectangles with three compartments:
- Class Name
- Attributes (Data Fields)
- Methods (Functions or Behaviors)
- Relationships:
- Association (e.g., A Student enrolls in a Course).
- Inheritance (e.g., A Car is a Vehicle).
- Aggregation (e.g., A Library has multiple Books).
Example:
A Banking System might include the following classes:
- Account – Attributes: accountNumber, balance | Methods: deposit(), withdraw()
- Customer – Attributes: name, email | Methods: updateDetails()
- Transaction – Attributes: transactionID, amount | Methods: processPayment()
3.) Behavioral Models
Behavioral models describe how the system behaves over time, focusing on object interactions, message flows, and state changes.
- It helps in defining workflows and business processes.
- It ensures efficient system interactions.
- It helps in debugging and optimizing system behavior.
Key Elements:
- Sequence Diagrams: Show the sequence of messages exchanged between objects to achieve a specific functionality.
- State Diagrams: Represent the states of an object and how it transitions between states based on events.
Example:
In an Online Shopping System, a sequence diagram may show:
- User → Adds items to cart → ShoppingCart
- ShoppingCart → Proceeds to checkout → PaymentGateway
- PaymentGateway → Confirms payment → OrderSystem
