0% found this document useful (0 votes)
40 views21 pages

OOAD Module - 2

Uploaded by

59Nishith Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views21 pages

OOAD Module - 2

Uploaded by

59Nishith Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

OOAD Module:-2

Q) What do you mean by object oriented system development


life cycle ? Also explain the main advantages of
object-oriented development ?
The Object-Oriented System Development Life Cycle
(OOSDLC) is a software development process that applies
the principles of object-oriented programming (OOP) to
system analysis, design, implementation, testing, deployment,
and maintenance. It is a structured approach to building
software systems based on objects, classes, inheritance,
encapsulation, and polymorphism. The OOSDLC typically
consists of the following phases:

1. **Requirements Gathering**: This phase involves gathering


and analyzing the requirements of the system from
stakeholders. Requirements are captured in the form of use
cases, user stories, or functional specifications.

2. **Analysis**: In this phase, the system requirements are


analyzed to identify objects, classes, relationships, and
behaviors. Use case diagrams, class diagrams, and sequence
diagrams may be used to represent the analysis model.

3. **Design**: During the design phase, the analysis model is


refined and transformed into a detailed design. This includes
designing class diagrams, object diagrams, interaction
diagrams, and other design artifacts.
4. **Implementation**: In this phase, the design is translated
into code using an object-oriented programming language
such as C++, Java, or Python. Classes, objects, methods,
and relationships defined in the design are implemented.

5. **Testing**: The implementation is thoroughly tested to


ensure that it meets the specified requirements and functions
correctly. Unit testing, integration testing, system testing, and
acceptance testing are performed to validate the software.

6. **Deployment**: Once the software has been tested and


validated, it is deployed to the production environment for
end-users to use.

7. **Maintenance**: The system is maintained and updated as


necessary to address issues, add new features, and
accommodate changes in requirements over time.

Now, let's discuss the main advantages of object-oriented


development:

1. **Modularity**: Object-oriented development promotes


modularity by encapsulating data and methods into objects
and classes. This allows for easier maintenance, debugging,
and modification of the software system.
2. **Reusability**: Objects and classes can be reused in
different parts of the software system or in other projects,
leading to increased productivity and reduced development
time.

3. **Abstraction**: Object-oriented development allows


developers to abstract complex systems into simpler, more
manageable components. This simplifies the design and
implementation process and improves system
comprehensibility.

4. **Encapsulation**: Encapsulation hides the internal details


of objects and exposes only the necessary interfaces, which
improves data security and integrity and prevents
unauthorized access to data.

5. **Inheritance**: Inheritance allows for the creation of new


classes (subclasses) that inherit properties and behaviors
from existing classes (superclasses). This promotes code
reuse and facilitates the creation of hierarchical class
structures.

6. **Polymorphism**: Polymorphism allows objects of different


classes to be treated uniformly through a common interface.
This promotes flexibility, extensibility, and adaptability in
software design.
7. **Ease of Testing**: Object-oriented development facilitates
unit testing and modular testing, as individual objects and
classes can be tested independently. This improves the
overall quality of the software and simplifies the debugging
process.

8. **Scalability**: Object-oriented development supports the


creation of scalable software systems by allowing for the
modular addition of new features and functionalities without
affecting existing code.

Overall, object-oriented development offers numerous


advantages, including modularity, reusability, abstraction,
encapsulation, inheritance, polymorphism, ease of testing,
and scalability, which contribute to the creation of robust,
maintainable, and adaptable software systems.

Q) What is OOMT (Object-oriented Modeling Technique ) ?


Explain the object model and functional model and functional
model with suitable examples ?
OOMT (Object-Oriented Modeling Technique) is a
methodology used in software engineering to model systems
using object-oriented concepts and principles. It provides a
structured approach to analyze, design, and document
software systems using graphical notations and textual
descriptions. OOMT encompasses various modeling
techniques, including object models, functional models,
dynamic models, and architectural models.
Let's focus on explaining the object model and functional
model in OOMT:

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()
```

The above class definitions represent the object model of


the online shopping system. Each class encapsulates its data
and behaviors, and relationships between classes are defined
to capture the interactions between objects.

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.

Use Case: Add to Cart


Description: Allows the customer to add a product to the
shopping cart.
Actors: Customer
Preconditions: Customer is logged in and has browsed
products.
Main Flow:
1. Customer selects a product to add to the cart.
2. System adds the selected product to the shopping cart.
Postconditions: Product is added to the shopping cart.

Use Case: Place Order


Description: Allows the customer to place an order for the
selected products.
Actors: Customer
Preconditions: Customer has added products to the
shopping cart.
Main Flow:
1. Customer selects the "Place Order" option.
2. System prompts the customer to confirm the order.
3. Customer confirms the order.
4. System generates an order confirmation and updates
the inventory.
Postconditions: Order is placed successfully.
```

The above use case definitions represent the functional


model of the online shopping system. Each use case
describes a specific functionality or task that the system
performs in response to user interactions. Activity diagrams or
sequence diagrams can further detail the flow of activities
within each use case.
Q) Explain in detail the object-oriented software development
process model .
The Object-Oriented Software Development Process Model
(OOSDPM) is a systematic approach to developing software
systems using object-oriented principles and methodologies.
It provides a structured framework for analyzing, designing,
implementing, testing, and maintaining software systems
based on objects, classes, inheritance, encapsulation, and
polymorphism. The OOSDPM encompasses various phases,
each with its set of activities, artifacts, and deliverables. Below
is a detailed explanation of each phase in the OOSDPM:

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

The Object-Oriented Software Development Process Model


(OOSDPM) provides a systematic and iterative approach to
developing software systems using object-oriented principles.
It emphasizes collaboration, communication, and feedback
among stakeholders, developers, and testers throughout the
software development lifecycle to ensure the successful
delivery of high-quality software that meets user needs and
expectations.

Q) Explain with an example , how use case modeling is used


for functional requirements. Identify actors , scenario ,and use
cases for example .
Sure, let's consider a simple example of a movie ticket
booking system. In this system, users can browse movies,
select showtimes, book tickets, and make payments. Let's
identify the actors, scenarios, and use cases:

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.

In this example, we've identified various actors interacting with


the system (Customer and Admin), scenarios representing
different actions performed by the actors, and use cases
describing the functionalities of the movie ticket booking
system. Use case modeling helps in understanding the
functional requirements of the system and ensures that it
meets the needs of its users.

Q) what do you mean by concurrency in dynamic modeling ? Explain and illustrate


concurrency with objects.

Concurrency in dynamic modeling refers to the simultaneous


execution of multiple activities or processes within a software
system. In dynamic modeling, concurrency often arises when
multiple objects or components within the system are capable
of executing independently and concurrently, potentially
interacting with each other concurrently as well.

To illustrate concurrency with objects, let's consider a


simplified example of a multi-threaded messaging application.
In this application, users can send and receive messages in
real-time, and multiple users can interact with the system
concurrently. We'll focus on modeling the concurrency aspect
of message sending and receiving using objects.

```plaintext
Object: User
Attributes:
- username : string
- messagesReceived : queue<Message>
- messagesToSend : queue<Message>
Methods:
- sendMessage(Message message) : void
- receiveMessage(Message message) : void
```

In this example, each user in the messaging application is


represented by an object of the `User` class. The `User`
object has attributes to store the username of the user, a
queue of messages received (`messagesReceived`), and a
queue of messages to send (`messagesToSend`).

Now, let's illustrate how concurrency can be modeled with


objects:

1. **Sending Messages Concurrently**:


- Each `User` object may have a separate thread of
execution responsible for sending messages.
- When a user wants to send a message, the
`sendMessage()` method is invoked, which adds the message
to the `messagesToSend` queue.
- Concurrently, another thread (or threads) continuously
monitors the `messagesToSend` queue for new messages.
When a new message is detected in the queue, it is sent to
the intended recipient.

2. **Receiving Messages Concurrently**:


- Similarly, each `User` object may have a separate thread
of execution responsible for receiving messages.
- As other users send messages, they are added to the
`messagesReceived` queue of the recipient user.
- Concurrently, another thread (or threads) continuously
monitors the `messagesReceived` queue for new messages.
When a new message is detected in the queue, it is
processed and displayed to the recipient user.

```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 receiveMessage(Message message) {


// Add received message to messagesReceived queue
messagesReceived.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();
}
}
}
};
```

In this illustration, each `User` object encapsulates its


messaging queues and contains separate thread functions for
sending and receiving messages concurrently. This allows
multiple users to interact with the messaging application
concurrently, sending and receiving messages in real-time
without blocking each other.

You might also like