13 Lecture
CS504
Midterm & Final Term Short Notes
Object Oriented Analysis and Design
Object-Oriented Analysis and Design (OOAD) is a software engineering approach that facilitates the development of robust and scalable systems. It emphasizes modeling real-world entities as objects, encapsulating data and behavior within classes,
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
Which of the following is NOT a key principle of Object-Oriented Analysis and Design? a) Inheritance b) Encapsulation c) Abstraction d) Procedural Programming Solution: d) Procedural Programming Which UML diagram is used to visualize the dynamic behavior of a system? a) Class Diagram b) Use Case Diagram c) Sequence Diagram d) Activity Diagram Solution: c) Sequence Diagram In OOAD, what is the purpose of the "Aggregation" relationship between classes? a) It represents a whole-part relationship where a part can exist independently. b) It represents a strong association between classes. c) It represents a one-to-many relationship between classes. d) It represents a many-to-many relationship between classes. Solution: a) It represents a whole-part relationship where a part can exist independently. What does the term "Polymorphism" mean in OOAD? a) It allows objects to hide their internal state. b) It allows a class to inherit from multiple superclasses. c) It allows a class to have multiple constructors. d) It allows objects of different classes to be treated as objects of the same class. Solution: d) It allows objects of different classes to be treated as objects of the same class. Which design pattern is used to ensure that a class has only one instance and provides a global point of access to that instance? a) Singleton Pattern b) Factory Pattern c) Observer Pattern d) Prototype Pattern Solution: a) Singleton Pattern Which of the following is an advantage of using interfaces in OOAD? a) Interfaces allow multiple inheritance in Java. b) Interfaces provide concrete implementations of methods. c) Interfaces enable loose coupling between classes. d) Interfaces can have private data members. Solution: c) Interfaces enable loose coupling between classes. In OOAD, what does the term "Abstraction" mean? a) It represents a relationship between two classes where one class inherits from another. b) It allows objects to hide their internal state and only reveal relevant information. c) It represents a relationship between two classes where one class contains objects of another. d) It allows a class to inherit from multiple superclasses. Solution: b) It allows objects to hide their internal state and only reveal relevant information. What is the purpose of the "CRC cards" technique in OOAD? a) It is used to model the static structure of a system using class diagrams. b) It is used to document the responsibilities of classes in a system. c) It is used to model the flow of activities in a system using activity diagrams. d) It is used to visualize the sequence of interactions between objects in a system. Solution: b) It is used to document the responsibilities of classes in a system. Which OOAD principle is violated if a subclass overrides a method of its superclass but does not call the superclass method in the overridden method? a) Polymorphism b) Abstraction c) Encapsulation d) Inheritance Solution: d) Inheritance Which OOAD activity involves refining use cases and identifying the classes and their relationships? a) Design Patterns b) Object-Oriented Design c) Use Case Analysis d) Object-Oriented Analysis Solution: d) Object-Oriented Analysis
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
Q: What is Object-Oriented Analysis and Design (OOAD)? A: Object-Oriented Analysis and Design is a software engineering approach that focuses on modeling a system using objects, classes, and their interactions to develop robust and maintainable software solutions. Q: Explain the key concepts of Object-Oriented Analysis and Design. A: The key concepts include abstraction, encapsulation, inheritance, and polymorphism. Abstraction hides unnecessary details, encapsulation bundles data and behavior together, inheritance enables code reuse, and polymorphism allows objects of different classes to be treated as instances of the same class. Q: Describe the purpose of UML diagrams in OOAD. A: UML (Unified Modeling Language) diagrams are used to visually represent different aspects of a system, such as its structure, behavior, and interactions. They aid in understanding, communicating, and documenting the system's design. Q: What is the difference between a class diagram and an object diagram in UML? A: A class diagram depicts the static structure of a system, showing classes, their attributes, and relationships. An object diagram, on the other hand, shows specific instances of classes and their relationships at a particular moment in time. Q: Explain the importance of the "Single Responsibility Principle" in OOAD. A: The Single Responsibility Principle states that a class should have only one reason to change. It promotes maintainability by ensuring that each class has a focused responsibility, making the code easier to understand and modify. Q: What is the purpose of the "Factory Method" design pattern in OOAD? A: The Factory Method pattern provides an interface for creating objects, allowing subclasses to decide which class to instantiate. It promotes loose coupling and allows the system to be more flexible when creating objects. Q: How does the "Observer" design pattern work, and where is it commonly used in OOAD? A: The Observer pattern defines a one-to-many dependency between objects, so when one object changes state, all its dependents are notified and updated automatically. It is commonly used in GUI frameworks and event-driven systems. Q: Describe the difference between composition and aggregation relationships in OOAD. A: Composition represents a strong "whole-part" relationship where the child cannot exist independently of the parent. Aggregation represents a weaker relationship where the child can exist independently. Q: What is "Use Case Analysis" in OOAD, and how is it used during system development? A: Use Case Analysis involves identifying and defining the functional requirements of a system from the perspective of its users. Use cases describe the interactions between actors (users) and the system to understand the system's behavior. Q: How does OOAD facilitate software development in large-scale projects? A: OOAD promotes modularity, reusability, and maintainability through its principles and design patterns. It allows developers to break down complex systems into smaller manageable components, making it easier to collaborate and develop large-scale software projects.