OOAD Module - 2
OOAD Module - 2
1. **Object Model**:
- The object model in OOMT represents the static structure
of a software system by modeling the objects, classes,
attributes, relationships, and interfaces.
- It provides a visual representation of the entities within the
system and their interactions.
- Object diagrams, class diagrams, and entity-relationship
diagrams are commonly used to depict the object model.
Example:
Consider a simple online shopping system. The object
model may include classes such as `Customer`, `Product`,
and `Order`. Each class would have attributes and methods
representing their properties and behaviors. Relationships
such as associations and aggregations between objects may
also be represented.
```plaintext
Class: Customer
Attributes: - name : string
- email : string
- address : string
Methods: - placeOrder()
- cancelOrder()
Class: Product
Attributes: - id : int
- name : string
- price : double
- quantity : int
Methods: - updatePrice()
- updateQuantity()
Class: Order
Attributes: - orderId : int
- customer : Customer
- products : list<Product>
- status : string
Methods: - calculateTotal()
- updateStatus()
```
2. **Functional Model**:
- The functional model in OOMT describes the dynamic
behavior of a software system by modeling the functionalities,
operations, and processes that occur within the system.
- It focuses on how the system behaves and what tasks it
performs in response to external stimuli.
- Use case diagrams, activity diagrams, and sequence
diagrams are commonly used to depict the functional model.
Example:
Continuing with the online shopping system example, the
functional model may include use cases representing various
functionalities of the system, such as browsing products,
adding items to the cart, and placing an order.
```plaintext
Use Case: Browse Products
Description: Allows the customer to browse through the
available products.
Actors: Customer
Preconditions: Customer is logged in.
Main Flow:
1. Customer selects the "Browse Products" option.
2. System retrieves and displays the list of available
products.
Postconditions: Customer views the list of products.
1. **Requirements Gathering**:
- **Objective**: This phase aims to understand and
document the requirements of the software system from
stakeholders, users, and domain experts.
- **Activities**:
- Conduct interviews, surveys, and workshops with
stakeholders to gather requirements.
- Analyze existing documentation, user manuals, and
business processes.
- Identify stakeholders' needs, goals, constraints, and
expectations.
- Define use cases, user stories, and functional
specifications.
- **Artifacts**:
- Requirements document
- Use case diagrams
- User stories
- Functional specifications
2. **Analysis**:
- **Objective**: This phase involves analyzing the
requirements gathered in the previous phase to identify
objects, classes, relationships, and behaviors within the
system.
- **Activities**:
- Identify and model entities, attributes, and relationships
using techniques like entity-relationship diagrams (ERDs) or
class diagrams.
- Define the system's functionalities and use cases.
- Specify the system's behavior through sequence
diagrams or activity diagrams.
- Validate the analysis model with stakeholders to ensure
completeness and accuracy.
- **Artifacts**:
- Analysis model (class diagrams, ERDs, use case
diagrams, sequence diagrams, activity diagrams)
- Use case descriptions
- Behavior specifications
3. **Design**:
- **Objective**: This phase involves transforming the
analysis model into a detailed design that specifies how the
system will be implemented.
- **Activities**:
- Design class diagrams to represent the static structure of
the system, including classes, attributes, methods, and
relationships.
- Define interfaces, collaborations, and packages to
organize and structure the system.
- Specify the architecture, including components, layers,
and subsystems.
- Detail the behavior of the system using interaction
diagrams, state diagrams, or communication diagrams.
- **Artifacts**:
- Design model (class diagrams, package diagrams,
collaboration diagrams, state diagrams, component diagrams)
- Interface specifications
- Architectural design document
4. **Implementation**:
- **Objective**: This phase involves translating the design
into executable code using an object-oriented programming
language.
- **Activities**:
- Write code to implement classes, methods, and
relationships defined in the design.
- Follow coding standards, best practices, and design
patterns to ensure maintainability and readability.
- Perform unit testing to validate the correctness of
individual components.
- Integrate components to build the complete system.
- **Artifacts**:
- Source code files
- Unit test cases
- Integrated system
5. **Testing**:
- **Objective**: This phase involves verifying and validating
the software to ensure that it meets the specified
requirements and functions correctly.
- **Activities**:
- Develop test cases based on requirements, use cases,
and functional specifications.
- Execute test cases to identify defects, bugs, and
discrepancies in the software.
- Perform various types of testing, including unit testing,
integration testing, system testing, and acceptance testing.
- Document and track defects using a defect tracking
system.
- **Artifacts**:
- Test plan
- Test cases
- Test reports
- Defect logs
6. **Deployment**:
- **Objective**: This phase involves deploying the software
to the production environment for end-users to access and
use.
- **Activities**:
- Prepare deployment packages and installation
instructions.
- Configure the production environment to support the
software.
- Deploy the software to servers, databases, or cloud
platforms.
- Perform smoke testing to verify that the deployed system
is functioning correctly.
- **Artifacts**:
- Deployment packages
- Installation guides
- Configuration documents
7. **Maintenance**:
- **Objective**: This phase involves maintaining and
supporting the software after it has been deployed to address
issues, add new features, and accommodate changes in
requirements.
- **Activities**:
- Monitor and manage the software to ensure availability,
performance, and security.
- Address bug fixes and software updates based on user
feedback and changing requirements.
- Enhance the software by adding new features,
functionalities, or improvements.
- Provide user support and training as needed.
- **Artifacts**:
- Maintenance requests
- Bug reports
- Change requests
- Software updates
1. **Actors**:
- **Customer**: The primary actor who interacts with the
system to browse movies, book tickets, and make payments.
- **Admin**: An administrative actor who manages movie
listings, showtimes, and seating arrangements.
2. **Use Cases**:
- **Browse Movies**:
- **Actor**: Customer
- **Scenario**: The customer opens the movie ticket
booking website and browses the list of available movies.
- **Use Case**: This use case allows customers to view
the list of movies currently playing or upcoming.
- **View Showtimes**:
- **Actor**: Customer
- **Scenario**: After selecting a movie, the customer views
the available showtimes for that movie.
- **Use Case**: This use case enables customers to see
the timings and locations of screenings for a selected movie.
- **Book Tickets**:
- **Actor**: Customer
- **Scenario**: The customer selects a movie, showtime,
and number of tickets, then proceeds to book the tickets.
- **Use Case**: This use case allows customers to reserve
seats for a specific movie screening.
- **Make Payment**:
- **Actor**: Customer
- **Scenario**: After booking tickets, the customer
proceeds to make a payment using a credit card or other
payment methods.
- **Use Case**: This use case facilitates the payment
process for the booked tickets.
- **Manage Movie Listings**:
- **Actor**: Admin
- **Scenario**: The admin logs into the system and adds,
updates, or removes movie listings.
- **Use Case**: This use case allows administrators to
manage the catalog of movies available for booking.
- **Manage Showtimes**:
- **Actor**: Admin
- **Scenario**: The admin updates showtimes, theater
locations, and seating arrangements for movie screenings.
- **Use Case**: This use case enables administrators to
schedule and manage movie showtimes.
3. **Example Scenario**:
- **Scenario**: Customer Alice wants to book tickets for the
latest superhero movie "Avengers: Endgame" at her favorite
cinema. She visits the movie ticket booking website, browses
the list of movies, selects "Avengers: Endgame", views the
available showtimes, chooses the desired time, selects the
number of tickets, and proceeds to book the tickets. After
confirming the booking, she makes a payment using her credit
card. The system then sends her a confirmation email with the
details of her booking.
```plaintext
Object: User
Attributes:
- username : string
- messagesReceived : queue<Message>
- messagesToSend : queue<Message>
Methods:
- sendMessage(Message message) : void
- receiveMessage(Message message) : void
```
```cpp
class User {
private:
string username;
queue<Message> messagesReceived;
queue<Message> messagesToSend;
public:
void sendMessage(Message message) {
// Add message to messagesToSend queue
messagesToSend.push(message);
}
void sendThreadFunction() {
// Continuously monitor messagesToSend queue and
send messages
while (true) {
if (!messagesToSend.empty()) {
Message message = messagesToSend.front();
// Send message to recipient
messagesToSend.pop();
}
}
}
void receiveThreadFunction() {
// Continuously monitor messagesReceived queue and
process messages
while (true) {
if (!messagesReceived.empty()) {
Message message = messagesReceived.front();
// Process received message
messagesReceived.pop();
}
}
}
};
```