0% found this document useful (0 votes)
9 views

OOAD assignment solution

OOAD Assignments For GGSIPU Btech IT
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

OOAD assignment solution

OOAD Assignments For GGSIPU Btech IT
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Here are detailed answers according to the marks assigned:

Q-1 What is an artifact? (2 Marks)

An artifact in Object-Oriented Analysis and Design (OOAD) is any tangible by-product


produced during the software development process. These artifacts include models, diagrams,
source code, documentation, and test scripts. Artifacts help in designing, understanding, and
maintaining a system.

Q-2 “Use case diagram builds the bridge between user and system”, Justify
the statement. (5 Marks)

This justification can be broken down into key points:

1. User-Centric Representation:
o A use case diagram visually represents the functionalities of a system from a
user's perspective.
2. Identifying System Boundaries:
o It defines the scope of the system by identifying external actors (users,
systems) and their interactions.
3. Requirement Validation and Communication:
o Use case diagrams help communicate requirements effectively between
stakeholders, developers, and testers.
o This minimizes misunderstandings and aligns the system with user needs.
4. Facilitates Development and Testing:
o Developers use use cases to design the system’s structure.
o Testers create test cases based on use cases to validate system behavior.
5. Enhances System Design:
o Since use case diagrams are high-level representations, they guide detailed
system design and user experience.

Q-3 “OOAD represents evolutionary development, not revolutionary one.”


Justify. (5 Marks)

Key Points to Justify the Statement:

1. Incremental and Iterative Development:


o OOAD follows an incremental and iterative approach, meaning the system is
built in small stages, improving over time.
2. Reusability and Enhancement:
o OOAD promotes reusability through object-oriented concepts like
inheritance and polymorphism.
3. Smooth Transition from Procedural to Object-Oriented Systems:
o Instead of abandoning traditional procedural programming, OOAD allows
developers to transition smoothly by integrating object-oriented concepts.
4. Continuous Refinement Through Unified Process:
o The Unified Process (UP) in OOAD follows a phased model (Inception,
Elaboration, Construction, Transition), which allows gradual improvements
rather than abrupt changes.
5. Sustains Long-Term Software Evolution:
o Large and complex software systems evolve over time, and OOAD supports
this evolution by providing mechanisms for modularity, scalability, and
maintenance.

Q-4 Draw a use case diagram depicting the relationship among use cases. (4
Marks)

Q-5 Develop the use cases within the unified process for NextGen POS. (4
Marks)

1. Identify Use Cases (Inception Phase)

Key use cases in a POS system:

 Process Sale
 Handle Payments
 Manage Inventory
 Generate Sales Reports
 Authorize Employee Login

2. Refine Use Cases (Elaboration Phase)

 Actors:
o Primary: Cashier, Customer, Manager
o Secondary: Bank System (for payment authorization)
 Use Case: Process Sale
o Actors: Cashier, Customer
o Preconditions: System is operational, cashier is logged in.
o Flow:
1. Cashier scans items.
2. System displays prices and total amount.
3. Customer chooses payment method.
4. Payment is processed.
5. Receipt is printed.

3. Implement Use Cases (Construction Phase)

 Developers write code for scanning items, storing transactions, and handling
payments.
 Database tables are designed for storing sales records.

Assignment 2

1. Why is Generalization very strong? Differentiate Aggregation and


Containment. Can link and association be applied interchangeably? (3 Marks)

Why is Generalization Strong?

Generalization is a powerful hierarchical relationship in Object-Oriented Design because:

1. Code Reusability
2. Extensibility
3. Polymorphism Support

Aggregation vs. Containment (Composition)

Feature Aggregation Containment (Composition)


A "Has-A" relationship where the A "Has-A" relationship where the
Definition contained object can exist contained object is fully owned by the
independently. container class.

A university has departments


A car has an engine (if the car is
Example (departments can exist
destroyed, the engine is also destroyed).
independently).

Can Link and Association Be Used Interchangeably?

 Link represents a single connection between objects.


 Association is a general relationship between two or more classes, showing multiple
links.
2. Class Diagram for the "Process Sale" Use Case (5 Marks)

Here are the answers based on the image:

Q3: Understanding Object-Oriented Concepts

(A) Four Wheeler is a subclass of SUV.

(B) Tri Cycle is a subclass of Three-wheeler.

(C) State whether the statement "The image above represents a Hybrid Inheritance" is
true or false.

 The given diagram appears to be Hierarchical Inheritance rather than Hybrid.


 Correct Answer: False

(D) State whether the statement "The Protected Interface is accessible only to the class
itself and its subclasses" is true or false.

 A protected member (protected in C++/Java) is accessible within the class and


its derived (subclass) objects.
 Correct Answer: True

Q4: Understanding Leave Management System (LMS)


(A) Identify the classes in LMS
From the given LMS description, the possible classes are:

1. Leave (Base class)


2. Casual Leave (Subclass of Leave)
3. Medical Leave (Subclass of Leave)
4. Earned Leave (Subclass of Leave)
5. Employee (Applies for leave)
6. Manager (Approves leave)

(B) Which of the following statements is correct?

Final Answer for (B): (a) and (d) are correct.

Assignment 3

1. Forking and Joining in Activity Diagrams (5 Marks)

Concept:

 Forking: Represents the parallel execution of multiple activities in an activity


diagram. It is depicted by a thick horizontal or vertical bar with multiple outgoing
arrows.
 Joining: Represents the synchronization of parallel activities. It is depicted by a
thick bar with multiple incoming arrows converging into one.

Example:

Consider an online shopping system:

1. After payment, the system can process the order and send a confirmation email in
parallel (Fork).
2. Once both tasks are completed, they synchronize before proceeding to dispatch the
item (Join).

2. Components of a Sequence Diagram (5 Marks)

Components of a Sequence Diagram:

1. Actors – Entities interacting with the system (e.g., User, Admin).


2. Objects – Instances participating in communication (e.g., Order, Payment).
3. Lifelines – Dotted lines extending from objects, representing their lifetime.
4. Messages – Arrows showing interaction between objects (e.g., function calls).
5. Activation Bars – Represents the active execution of an operation..

Example: Online Shopping Checkout Process


 User selects items and places an order.
 System processes payment and updates order status.

3. Component Diagram (5 Marks)

Definition:

A Component Diagram shows the structural organization of software components and


their dependencies.

Features & Uses:

 Represents modular software components like databases, APIs, services.


 Helps in system design, deployment, and maintenance.
 Used for visualizing software architecture.

Example:

A Banking System component diagram includes:

1. User Interface Component (Handles user interaction).


2. Authentication Service (Verifies login).
3. Transaction Processing Component (Handles payments).

4. Deployment Diagram (5 Marks)

Definition:

A Deployment Diagram represents the physical hardware and software nodes in a system.

Features & Uses:

 Defines hardware architecture, servers, and execution environments.


 Shows how software components are deployed on hardware nodes.
 Used for network and cloud-based applications.

Example:

A Social Media App Deployment Diagram includes:

1. Client Devices (Mobile, Web App).


2. Application Server (Handles requests, API calls).
3. Database Server (Stores user data, posts, messages).
4. Cloud Storage (Stores images, videos).
5. State Machine Diagram (5 Marks)

Definition:

A State Machine Diagram describes the different states of an object and the transitions
between them.

Components:

1. States – Different conditions of an object (e.g., Idle, Processing).


2. Transitions – Changes from one state to another.
3. Events – Triggers for state changes.
4. Initial State – The starting state.
5. Final State – The end state.

Example:

An ATM System state machine diagram:

 Idle → Card Inserted → Authentication → Transaction → Card Ejected → Idle.

6. Case Study Using All UML Diagrams (10 Marks)

Case Study: Online Food Ordering System (Using UML Diagrams)

1. Use Case Diagram

 Actors: Customer, Restaurant, Delivery Agent, Payment Gateway, Admin.


 Use Cases: Browse Menu, Place Order, Make Payment, Track Order, Manage Menu.
 Relationships: Extend (Apply Coupon), Include (Confirm Payment).

2. Class Diagram

 Main Classes:
o Customer (name, email, address)
o Order (orderID, items, status)
o Restaurant (name, menu)
o Payment (amount, method)
o Delivery Agent (agentID, status)
 Relationships:
o Customer places Order → Order processed by Restaurant → Order assigned
to Delivery Agent.

3. Sequence Diagram

1. Customer selects food and places an order.


2. System sends order to the restaurant.
3. Restaurant confirms and prepares food.
4. System assigns a delivery agent.
5. Customer makes payment.
6. Delivery agent delivers the order.

4. Activity Diagram

 Customer: Browse → Add to Cart → Place Order → Make Payment → Track Order.
 Restaurant: Receive Order → Prepare Food → Handover to Agent.
 Delivery Agent: Pick Order → Deliver → Mark as Delivered.
 Fork & Join: Payment confirmation triggers parallel processes (restaurant &
delivery).

5. Component Diagram

 Modules:
o User Interface (Mobile/Web)
o Order System (Backend)
o Payment Gateway API
o Restaurant Management System
o Delivery System

Assignment 4

1. GRASP Patterns for Object Design (10 Marks)

GRASP (General Responsibility Assignment Software Patterns) helps in assigning


responsibilities to objects in object-oriented design.

Key GRASP Patterns:

1. Creator – Assigns responsibility for creating an object to a class that has information
about it.
2. Information Expert – Assigns responsibility based on where relevant data is stored.
3. Controller – Manages system operations, delegating tasks to other objects.
4. Low Coupling – Reduces dependencies between objects to improve maintainability.
5. High Cohesion – Ensures a class has well-defined, focused responsibilities.
6. Polymorphism – Allows different classes to be used interchangeably via common
interfaces.
7. Pure Fabrication – Creates helper classes to handle responsibilities without adding
unnecessary burden to domain objects.
8. Indirection – Introduces an intermediate object to decouple classes.
9. Protected Variations – Shields the system from changes by using stable interfaces.

2. Steps to Create a Test Plan (5 Marks)


1. Define Test Objectives – Identify what needs to be tested.
2. Scope & Features to Test – Specify functionalities to be verified.
3. Test Strategy Selection – Choose appropriate testing methods (e.g., unit,
integration).
4. Test Environment Setup – Define hardware/software requirements.
5. Test Case Design – Create step-by-step test scenarios.
6. Resource Allocation – Assign team members and tools.
7. Risk Analysis – Identify potential risks and mitigation plans.
8. Test Execution & Reporting – Run tests and document results.

3. Testing Strategies & Impact of Object Orientation on Testing (10 Marks)

Testing Strategies:

1. Unit Testing – Tests individual components (e.g., classes, methods).


2. Integration Testing – Ensures different modules interact correctly.
3. System Testing – Evaluates the entire application.
4. Acceptance Testing – Confirms the software meets business needs.
5. Regression Testing – Checks that updates don’t break existing functionality.

Impact of Object-Oriented (OO) Programming on Testing:

 Encapsulation – Harder to test private methods; focus on public interfaces.


 Inheritance – Requires testing parent and child classes separately.
 Polymorphism – Tests must consider multiple object behaviors dynamically.
 Reusability – Improves efficiency but requires careful dependency testing.

4. GRASP Principles with Examples (5 Marks)

1. Creator – Example: A Customer class creates an Order object.


2. Information Expert – Example: A Student object holds and processes its own
grades.
3. Controller – Example: A LoginController handles user authentication.
4. Low Coupling – Example: Using interfaces to reduce dependencies between Order
and Payment.
5. High Cohesion – Example: A Cart class manages only shopping cart logic, not
payment.

You might also like