Object Oriented Analysis and Design

Object Oriented Analysis and Design

Introduction

Model requirements and design reliable systems with object-oriented concepts.

Topic-Wise Course Outline

  • Object-oriented modelling foundations and principles
  • Requirements, use cases and analysis
  • Class diagrams, relationships and structural models
  • Interaction, activity and state diagrams
  • Architecture, patterns, implementation and validation

Study Guidance

Begin with key concepts and clear definitions. Practise each topic using examples and independent exercises. Topic-wise MCQs, short questions and worked solutions will be added after verification.

Explore Computer Science Subjects

Practice MCQs — Set 1 (Questions 1–10)

Choose the best answer, then open the explanation to check your reasoning.

Question 1. What is the primary purpose of object-oriented analysis?

  1. To identify domain concepts, responsibilities and relationships
  2. To choose a processor clock frequency
  3. To delete requirements
  4. To replace all user interviews
Show correct answer and explanation

Correct answer: A. To identify domain concepts, responsibilities and relationships

Object-oriented analysis models the problem domain and required behavior. Design later turns these concepts into implementable structures.

Question 2. What does a UML use-case diagram primarily show?

  1. Exact CPU register contents
  2. Actors and their interactions with system goals
  3. Machine instruction encodings
  4. Database file sizes
Show correct answer and explanation

Correct answer: B. Actors and their interactions with system goals

Use-case diagrams present external actors and the functionality they seek. They describe user-facing goals rather than detailed implementation.

Question 3. What does encapsulation mean in object-oriented design?

  1. Storing every object in one global variable
  2. Removing class responsibilities
  3. Combining state and behavior behind a controlled interface
  4. Making all fields public
Show correct answer and explanation

Correct answer: C. Combining state and behavior behind a controlled interface

Encapsulation groups data with related operations and controls access to internal representation. It helps maintain class invariants.

Question 4. What is inheritance in an object-oriented model?

  1. A mandatory replacement for composition
  2. A technique for compressing images
  3. An alternative name for a database join
  4. A mechanism allowing a subtype to reuse or extend a parent type
Show correct answer and explanation

Correct answer: D. A mechanism allowing a subtype to reuse or extend a parent type

Inheritance expresses a type hierarchy when a subtype can be treated appropriately as its parent. It should model a valid substitutability relationship.

Question 5. What does aggregation represent in UML?

  1. A whole–part relationship with relatively weak ownership
  2. A mandatory executable method
  3. A network packet header
  4. A transaction log
Show correct answer and explanation

Correct answer: A. A whole–part relationship with relatively weak ownership

Aggregation denotes a whole–part association without implying the strict lifetime ownership normally associated with composition.

Question 6. What does composition normally imply in UML?

  1. A sorting algorithm
  2. Strong whole–part ownership and dependent part lifetime
  3. Two unrelated classes with no association
  4. A compiler’s final machine code
Show correct answer and explanation

Correct answer: B. Strong whole–part ownership and dependent part lifetime

Composition models strong ownership: a part instance belongs to at most one composite at a time. Its lifetime is typically governed by the whole.

Question 7. What does a UML sequence diagram emphasize?

  1. Source-code font choices
  2. Only static inheritance links
  3. Time-ordered interactions and messages among participants
  4. Disk block sizes
Show correct answer and explanation

Correct answer: C. Time-ordered interactions and messages among participants

Sequence diagrams show participants and messages arranged by interaction order. They are useful for reasoning about scenarios.

Question 8. What is a key aim of the Single Responsibility Principle?

  1. Putting every feature in one class
  2. Preventing any methods from being public
  3. Avoiding the use of interfaces
  4. Giving a module one coherent reason to change
Show correct answer and explanation

Correct answer: D. Giving a module one coherent reason to change

A module should have a focused responsibility aligned with one class of change. This reduces coupling between unrelated concerns.

Question 9. What is the dependency inversion principle?

  1. High-level policy should depend on abstractions rather than concrete low-level details
  2. Every class must depend on a database table
  3. Code should use only global objects
  4. All abstract classes must be removed
Show correct answer and explanation

Correct answer: A. High-level policy should depend on abstractions rather than concrete low-level details

Depending on stable abstractions allows low-level implementations to change without rewriting high-level policy. Interfaces and dependency injection often help.

Question 10. What is a design pattern?

  1. A syntax rule enforced by every compiler
  2. A reusable description of a solution to a recurring design problem
  3. A guarantee that every implementation is optimal
  4. A replacement for requirements analysis
Show correct answer and explanation

Correct answer: B. A reusable description of a solution to a recurring design problem

Patterns describe structures and tradeoffs that recur across designs. They need to be chosen based on the actual problem rather than used automatically.