OOAD - Object Oriented Analysis & Design, Past Papers

Object Oriented Analysis & Design Past Paper 2025 BSCS & BSIT UOS

Object Oriented Analysis & Design Past Paper 2025 BSCS & BSIT UOS

Object Oriented Analysis & Design Past Paper 2025 BSCS & BSIT UOS

Object Oriented Analysis & Design Past Paper 2025 (text version)

University of Sargodha – BS 5th Semester Examination 2025, CS/IT
Paper: Object Oriented Analysis & Design (CSSC-307 / SE-3311) · Time: 2:30 hours · Maximum marks: 60
Note: Objective part is compulsory. Attempt any three questions from the subjective part. Illustrate answers with diagrams where needed.

Objective part (compulsory, 12 × 2)

  1. What are the advantages of object-oriented design?
  2. What are static diagrams in UML?
  3. What is inception?
  4. What are the supplementary specifications?
  5. Write the benefits of use-case diagrams.
  6. What are the elements of a state-chart diagram?
  7. What is a vision document?
  8. What is risk analysis?
  9. Define the include relationship.
  10. Differentiate between lifeline and activation bar.
  11. What are the components of a collaboration diagram?
  12. Define the aggregation relationship.

Subjective part (attempt any three, 12 marks each)

  • Q.2 What are the elements of a UML use-case diagram? Explain the use-case model and writing requirements in context.
  • Q.3 Draw a UML domain model representing the following elements from the problem domain of a football league: A football league is made up of at least five football teams. Each team is composed of 11 to 25 players, and one player captains the team. A team has a name and a record. Players have a number and a position. Football teams play games against each other. Each game has a score and a location. Teams are sometimes led by a coach. A coach has a level of accreditation and a number of years of experience, and can coach multiple teams. Coaches and players are people, and people have names and addresses.
  • Q.4 Write a note on any two of the following patterns and their benefits: (a) Facade (b) Adapter (c) Singleton.
  • Q.5 Explain in detail the mapping of design to code implementation.
  • Q.6 Write brief notes on (a) RUP disciplines (b) sequence diagram with an example.

Short questions solved

  1. Advantages of OOD: models the real world naturally, encapsulation hides details, reuse through inheritance and composition, easier maintenance and extension, modular and testable design.
  2. Static (structural) diagrams show the structure of a system that does not change over time: class, object, component, deployment, package and composite-structure diagrams.
  3. Inception: the first, short phase of the Unified Process; it establishes a common vision and scope, the business case, key use cases, rough estimates and major risks, to decide whether the project is worth pursuing.
  4. Supplementary specification: captures requirements not covered by use cases – non-functional requirements (performance, usability, reliability, security), legal and licensing constraints, standards and the operating environment.
  5. Benefits of use-case diagrams: show the system boundary and who uses it, capture functional requirements from the user’s view, aid communication with stakeholders, and give a basis for planning, design and test cases.
  6. State-chart elements: states (including initial and final pseudo-states), transitions, events (triggers), guard conditions, and actions/activities (entry, do, exit).
  7. Vision document: a high-level summary of the project – the problem, stakeholders, key needs and features, and constraints – that gives everyone a shared understanding of what is being built and why.
  8. Risk analysis: identifying what could go wrong (technical, schedule, cost, people), estimating each risk’s probability and impact, prioritizing them and planning mitigation and contingency.
  9. Include relationship: a base use case always incorporates the behaviour of another use case, used to factor out common steps; drawn as a dashed arrow labelled «include» from base to included use case (e.g. Withdraw Cash «include» Authenticate).
  10. Lifeline is the vertical dashed line showing an object’s existence over time in a sequence diagram; an activation bar is the thin rectangle on it showing the period during which the object is actively executing an operation.
  11. Collaboration (communication) diagram components: objects/participants, links between them, and numbered messages showing the sequence of interaction.
  12. Aggregation: a weak “whole–part” relationship in which the part can exist independently of the whole (e.g. Department–Professor); drawn with a hollow diamond at the whole end.

Solved subjective questions

Q.2 Use-case diagram elements: actors (stick figures – primary, supporting, offstage), use cases (ovals), the system boundary (rectangle), associations between actors and use cases, and relationships – «include», «extend» and generalization. Use-case model: the set of all written use cases plus the optional diagram; it is the main model of functional requirements. Use cases are text stories of an actor using the system to meet a goal, written in brief, casual or fully dressed format. A fully dressed use case includes: primary actor, stakeholders and interests, preconditions, success guarantee (postconditions), main success scenario, extensions (alternate flows), special requirements and frequency. Requirements in context: instead of a flat “the system shall…” list, use cases place each requirement inside the scenario where it is needed, showing who needs it and why, which makes requirements easier to understand, validate and test.

Q.3 Domain model – football league:

+-----------------+ 1      5..* +-------------+ 1     11..25 +--------------+
|     League      |<>------------|    Team     |<>-------------|    Player    |
+-----------------+  made up of  +-------------+   composed of +--------------+
                                 | name        |               | number       |
                                 | record      |               | position     |
                                 +-------------+               +--------------+
                                   |  2   | *      1 captains 1      |
                         plays     |      | led by                   |  is-a
                                   |      | 0..1                     v
                              * +------+ +-----------------+   +-------------+
                                | Game | |      Coach      |-->|   Person    |
                                +------+ +-----------------+   +-------------+
                                | score| | accreditation   |   | name        |
                                | loca-| | yearsExperience |   | address     |
                                | tion | +-----------------+   +-------------+
                                +------+   1 coaches 1..* Team

Coach and Player both inherit from Person (generalization).

Key points: League–Team (1 to 5..*) and Team–Player (1 to 11..25) are whole–part associations; one Player captains each Team; Team plays Game (each game involves 2 teams); Coach leads 0..* Teams and a Team is led by 0..1 Coach (“sometimes”); Coach and Player are specializations of Person, which holds name and address. A domain model shows conceptual classes, attributes and associations only – no methods.

Q.4 Design patterns (any two):

  • Facade: provides a single simplified interface to a complex subsystem (e.g. a HomeTheaterFacade.watchMovie() that switches on the TV, amplifier and player). Benefits: low coupling between clients and the subsystem, easier use, and the subsystem can change behind the facade.
  • Adapter: converts the interface of an existing class into the interface a client expects (e.g. an adapter that lets a POS system call different tax-calculator or payment APIs through one ITaxCalculatorAdapter). Benefits: reuse of incompatible or third-party classes without changing them; supports protected variations.
  • Singleton: ensures a class has only one instance and gives a global access point – private constructor plus a static getInstance() (e.g. a ServicesFactory or logger). Benefits: controlled access to one shared resource, lazy creation; use carefully because it adds global state.

Q.5 Mapping design to code: after the design (interaction diagrams and design class diagrams, DCDs) the code is written as follows: (1) Class definitions from DCDs – each class becomes a class with its attributes and method signatures; (2) Reference attributes – associations navigable from a class become attributes referencing the other object; (3) Method bodies from interaction diagrams – the sequence of messages in a sequence/communication diagram becomes the statements inside the method; (4) Collections – one-to-many associations become collection attributes such as List; (5) Exceptions and error handling added; (6) Order of implementation – from least-coupled to most-coupled classes; (7) test-first development and refactoring as the code evolves. Example:

public class Register {
    private Sale currentSale;
    private ProductCatalog catalog;      // attribute from DCD association

    public void enterItem(ItemID id, int qty) {   // method from interaction diagram
        ProductDescription desc = catalog.getProductDescription(id);
        currentSale.makeLineItem(desc, qty);
    }
}

public class Sale {
    private List<SalesLineItem> lineItems = new ArrayList<>();  // 1..* -> collection
    public void makeLineItem(ProductDescription d, int qty) {
        lineItems.add(new SalesLineItem(d, qty));
    }
}

Q.6(a) RUP disciplines: engineering disciplines – business modelling, requirements, analysis & design, implementation, test and deployment; supporting disciplines – configuration & change management, project management and environment. Every iteration across the four phases (inception, elaboration, construction, transition) involves several disciplines with different emphasis.

Q.6(b) Sequence diagram: an interaction diagram that shows objects as lifelines arranged horizontally and the messages between them in time order, top to bottom, with activation bars, return messages, and frames (alt, loop, opt) for logic. Example – ATM cash withdrawal:

Customer        :ATM               :Bank
   |  insertCard()   |                   |
   |---------------->|                   |
   |  enterPIN(pin)  |                   |
   |---------------->| verify(card,pin)  |
   |                 |------------------>|
   |                 |<- - - - ok - - - -|
   | withdraw(amount)|                   |
   |---------------->| debit(acct,amt)   |
   |                 |------------------>|
   |                 |<- - - done - - - -|
   |<- - cash, receipt                   |

Answers prepared by Shining Study for revision. Check them against your class notes and teacher’s guidance.

About Saif R

An educator and technology enthusiast passionate about empowering students through quality education and digital learning. Dedicated to making academic resources and opportunities accessible to everyone.