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?
- To identify domain concepts, responsibilities and relationships
- To choose a processor clock frequency
- To delete requirements
- 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?
- Exact CPU register contents
- Actors and their interactions with system goals
- Machine instruction encodings
- 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?
- Storing every object in one global variable
- Removing class responsibilities
- Combining state and behavior behind a controlled interface
- 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?
- A mandatory replacement for composition
- A technique for compressing images
- An alternative name for a database join
- 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?
- A whole–part relationship with relatively weak ownership
- A mandatory executable method
- A network packet header
- 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?
- A sorting algorithm
- Strong whole–part ownership and dependent part lifetime
- Two unrelated classes with no association
- 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?
- Source-code font choices
- Only static inheritance links
- Time-ordered interactions and messages among participants
- 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?
- Putting every feature in one class
- Preventing any methods from being public
- Avoiding the use of interfaces
- 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?
- High-level policy should depend on abstractions rather than concrete low-level details
- Every class must depend on a database table
- Code should use only global objects
- 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?
- A syntax rule enforced by every compiler
- A reusable description of a solution to a recurring design problem
- A guarantee that every implementation is optimal
- 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.
