Object Oriented Analysis and Design
31 Questions
0 Views

Object Oriented Analysis and Design

Created by
@FamedHexagon

Questions and Answers

What level of abstraction does a class represent compared to the classes that make up its implementation?

Higher level of abstraction

The GrowingPlan class is independent of the Garden class.

False

Which of the following is NOT one of the principles of the object model?

  • Inheritance (correct)
  • Encapsulation
  • Abstraction
  • Concurrency
  • What is a characteristic of strong typing?

    <p>Strictly enforces type conformance</p> Signup and view all the answers

    What is object-oriented programming (OOP)?

    <p>A method of implementation in which programs are organized as cooperative collections of objects, each representing an instance of some class, unified by inheritance relationships.</p> Signup and view all the answers

    What is the difference between static typing and dynamic typing?

    <p>Static typing means types are fixed at compilation time, while dynamic typing means types are determined at runtime.</p> Signup and view all the answers

    Object-oriented analysis and design represent a revolutionary development in software engineering.

    <p>False</p> Signup and view all the answers

    Which of the following programming languages is strongly typed and statically typed?

    <p>Ada</p> Signup and view all the answers

    What major trend marked the evolution of object-oriented languages from 1980 to 1990?

    <p>The object-orientation boom</p> Signup and view all the answers

    Polymorphism is the opposite of __________.

    <p>monomorphism</p> Signup and view all the answers

    Object-oriented programming languages like Smalltalk and Java are designed to facilitate __________.

    <p>data abstraction</p> Signup and view all the answers

    What is a heavyweight process?

    <p>One that is independently managed and has its own address space</p> Signup and view all the answers

    Which programming language is often credited with first implementing the object-oriented paradigm?

    <p>Simula</p> Signup and view all the answers

    Concurrency can be defined as the property that distinguishes an active object from a non-active object.

    <p>True</p> Signup and view all the answers

    Match the following programming languages with their key features:

    <p>C++ = Derived from C and Simula Java = Designed for portability Ada = Strong typing with heavy Pascal influence Python = Object-oriented scripting language</p> Signup and view all the answers

    What is persistence in the context of object models?

    <p>The property of an object through which its existence transcends time and/or space.</p> Signup and view all the answers

    What is the purpose of object-oriented analysis (OOA)?

    <p>To build real-world models using an object-oriented view of the problem domain.</p> Signup and view all the answers

    Which of the following is NOT one of the benefits of using the object model?

    <p>Creating complex programming languages</p> Signup and view all the answers

    Data abstraction is not important for managing complexity in programming.

    <p>False</p> Signup and view all the answers

    The five attributes of well-structured complex systems include hierarchy, relative primitives, __________, patterns, and stable intermediate forms.

    <p>separation of concerns</p> Signup and view all the answers

    Which programming style is best suited for the design of computation-intense operations?

    <p>Procedure-oriented programming</p> Signup and view all the answers

    Which of the following is NOT one of the four major elements of the object model?

    <p>Polymorphism</p> Signup and view all the answers

    What is the principle of least commitment?

    <p>It ensures that the interface of an object provides its essential behavior without committing to specific implementations.</p> Signup and view all the answers

    The principle of least astonishment helps in capturing the entire behavior of an object.

    <p>True</p> Signup and view all the answers

    Define encapsulation.

    <p>Encapsulation is the process of compartmentalizing the elements of an abstraction, hiding the structure and implementation details.</p> Signup and view all the answers

    In a modularized system, what is the main goal?

    <p>Reducing software cost and allowing independent design and revision of modules</p> Signup and view all the answers

    Match the following abstraction types with their definitions:

    <p>Entity Abstraction = An object that represents a useful model of a problem domain Action Abstraction = An object that provides a generalized set of operations Virtual Machine Abstraction = An object that groups operations used by a superior level of control Coincidental Abstraction = An object that packages unrelated operations</p> Signup and view all the answers

    Hierarchy represents the relationship among classes in object-oriented systems.

    <p>True</p> Signup and view all the answers

    Encapsulation serves to separate the contractual interface of an abstraction and its _______.

    <p>implementation</p> Signup and view all the answers

    What is inheritance in the context of object-oriented programming?

    <p>Inheritance is a mechanism where a subclass inherits the structure and behavior from one or more superclasses.</p> Signup and view all the answers

    Which of the following statements regarding modularity is correct?

    <p>Modules should be loosely coupled to minimize interdependencies.</p> Signup and view all the answers

    Study Notes

    The Object Model

    • Object-oriented technology is based on a robust engineering foundation known as the object model.
    • Principles of the object model include abstraction, encapsulation, modularity, hierarchy, typing, concurrency, and persistence.
    • Object-oriented analysis and design diverges from traditional structured design, necessitating a new approach to decomposition.

    Evolution of the Object Model

    • Object-oriented development evolved from past software engineering trends, rather than being a spontaneous innovation.
    • Key trends include the shift from programming-in-the-small to programming-in-the-large and advancements in high-order programming languages.

    Generations of Programming Languages

    • First-generation languages (1954–1958): Focused on mathematical expressions (e.g., FORTRAN I, ALGOL 58).
    • Second-generation languages (1959–1961): Introduced subroutines and data types (e.g., FORTRAN II, ALGOL 60, COBOL).
    • Third-generation languages (1962–1970): Supported data abstraction and class structures (e.g., PL/1, ALGOL 68, Pascal, Simula).

    Object-Orientation Boom (1980–1990)

    • Emergence of object-oriented languages like Smalltalk 80 and C++, along with Ada83 and Eiffel.
    • Introduction of frameworks such as Visual Basic, Java, and Python aimed at easing application development and enhancing portability.

    Topology of Programming Languages

    • First and Early Second Generation: Used global data and subprograms, leading to ripple effects from errors due to global visibility.
    • Late Second and Early Third Generation: Emergence of procedural abstractions and structured programming, improving control over algorithms and code organization.
    • Late Third Generation: Introduced separately compiled modules for independent development, but still lacked robust support for data abstraction.

    Object-Based and Object-Oriented Programming

    • Object-oriented programming prioritizes data abstraction and the use of classes and objects rather than algorithms.
    • Fundamental building block of object-oriented languages is the module, which organizes classes and objects.

    Foundations of the Object Model

    • The object model applies across various domains in computer science, including user interfaces and databases.
    • Diverse terminology in object-oriented languages reflects shared concepts, including methods in Smalltalk and virtual functions in C++.

    Definition of Object-Oriented Programming

    • Defined as a method where programs consist of cooperative collections of objects, each an instance of a class organized in hierarchical relationships.
    • Core requirements include data abstractions with named operations, hidden states, and inheritance support.

    Relationship of OOA, OOD, and OOP

    • Object-oriented analysis (OOA) creates models leading to object-oriented design (OOD), which lays the groundwork for implementation using object-oriented programming (OOP).

    Programming Styles

    • Five main styles: Procedure-oriented (algorithms), Object-oriented (classes), Logic-oriented (goals), Rule-oriented (if-then rules), and Constraint-oriented (invariant relationships).
    • Object-oriented programming aligns with complex applications and serves as an architectural framework for other paradigms.

    Elements of the Object Model

    • Major elements are abstraction, encapsulation, modularity, and hierarchy, while minor elements include typing, concurrency, and persistence.
    • Abstraction distinguishes essential characteristics of an object, forming a conceptual boundary relative to the viewer.

    Abstraction in Object-Oriented Design

    • Defines essential traits distinguishing objects and separates behaviors from implementations.
    • Achieved through principles such as the least commitment (interface behavior) and least astonishment (capturing full behavior).### Abstraction
    • Entity abstraction represents a model of problem or solution domain entities.
    • Action abstraction provides a generalized set of operations performing similar functions.
    • Virtual machine abstraction groups operations under a higher-level control mechanism.
    • Coincidental abstraction consists of unrelated operations packaged together.
    • Each operation has a unique signature; the entire set with legal invocation order is known as a protocol.
    • Preconditions indicate assumptions before an operation; postconditions confirm invariants after execution.
    • Violation of preconditions or postconditions breaks the reliability of the contract between client and server.
    • Static properties of objects are constant attributes, while dynamic properties change during their lifecycle.
    • Procedure-oriented programming changes values through subprograms; rule-oriented programming relies on event-triggered rules; object-oriented programming triggers actions through object communication.

    Encapsulation

    • Encapsulation hides an object's internal structure and implementation from clients.
    • For example, in photosynthesis, the inner workings of plant roots are irrelevant to the plant's function visible to the outside.
    • Each class comprises an interface (external behavior view) and an implementation (internal mechanics).
    • Encapsulation compartments the elements of an abstraction, separating its interface from its implementation.
    • Encapsulation aims to prevent misuse and accidents rather than fraud.

    Modularity

    • Modularity reduces program complexity by partitioning it into well-defined modules.
    • In Smalltalk, classes serve as the sole physical unit, while languages like Java have packages for grouping classes.
    • Effective modularization allows independent design, revision, and maintenance of modules.
    • The connections between modules are outlined through their assumptions about each other.
    • Modules should be cohesive (related concepts) and loosely coupled (minimal dependencies).
    • Proper modularization allows ease of implementation changes without affecting other modules.
    • Choosing the right modules and abstractions is crucial and often iterative in the design process.

    Hierarchy

    • Hierarchy categorizes abstractions via class structure ("is a" relationships) and object structure ("part of" relationships).
    • Single inheritance allows subclasses to inherit structures/behaviors of superclasses, allowing for a generalization/specialization hierarchy.
    • Example: In a Hydroponics Farming System, subclasses like FruitGrowingPlan inherit from GrowingPlan.
    • Multiple inheritance connects classes to more than one superclass, introducing complexities such as name clashes.
    • Aggregation relationships demonstrate "part of" hierarchies, where high-level abstractions encompass specialized low-level abstractions.

    Typing

    • Typing is a classification mechanism ensuring that entities share structural/behavioral characteristics.
    • Strong typing strictly enforces type conformance; weak typing allows more flexibility in interchanging objects.
    • Typed languages promote early error detection and more efficient code generation but can complicate changes in class interfaces.
    • Static typing fixes types at compile time, while dynamic typing does so at runtime, impacting how variables and expressions are bound.### Typing and Polymorphism
    • Languages can be strongly and statically typed (e.g., Ada), strongly typed with dynamic typing support (e.g., C++, Java), or untyped with dynamic typing capabilities (e.g., Smalltalk).
    • Polymorphism allows a single variable name to refer to objects from different classes sharing a common superclass, enabling them to perform a common set of operations.
    • Monomorphism contrasts with polymorphism and is evident in strongly and statically typed languages.
    • Polymorphism is fundamental to object-oriented programming (OOP) and distinguishes it from traditional programming with abstract data types.

    Concurrency

    • Concurrency involves multiple threads of control in a program, which may be transient or persist for the system's lifetime.
    • Concurrency can be either true (multiple CPUs) or illusory (single CPU using time-slicing).
    • Heavyweight processes have independent management by the operating system and maintain separate address spaces, while lightweight processes share address spaces within a single operating system process.
    • Communication between heavyweight processes incurs higher costs compared to lightweight processes, which often use shared data.
    • Challenges in concurrent programming include deadlock, livelock, starvation, mutual exclusion, and race conditions.
    • OOP can reduce concurrency challenges by encapsulating complexities within reusable abstractions.

    Object-Oriented Design and Concurrency

    • Objects in OOP unify data abstraction and concurrency, with active objects representing separate threads of control.
    • Active objects can manage their processes concurrently, enabling cooperation among various objects in a system.
    • Three approaches to implementing concurrency in object-oriented design:
      • Certain programming languages integrate concurrency mechanisms.
      • Class libraries provide lightweight processes, often platform-dependent for implementation.
      • Interrupts create the illusion of concurrency, requiring knowledge of low-level hardware.

    Persistence in Object-Oriented Systems

    • Persistence relates to the lifespan of objects within software, varying from transient to long-lived objects in databases.
    • Objects can exist across different levels, including:
      • Transient results from expressions.
      • Local and global variables.
      • Data persisting beyond a program's execution or version changes.
    • Traditional languages often only manage transient and local variable persistence; persistent storage is typically handled by databases.
    • Frameworks like ADO.NET support data persistence across Web applications and disconnected scenarios.

    Applying the Object Model

    • The object model promotes well-structured complex systems characterized by:
      • Hierarchies to represent relationships.
      • Use of relative primitives for layered abstraction.
      • Separation of concerns for distinct functionalities.
      • Recognizing patterns for common software architecture.
      • Stable intermediate forms that adapt to change.

    Benefits of the Object Model

    • Utilizing the object model enhances the capabilities of object-oriented programming languages, preventing misuse of their powerful features.
    • Encourages software and design reuse, facilitating the creation of application frameworks.
    • Results in systems based on stable intermediate forms that are less vulnerable to modifications.

    Open Issues in Object-Oriented Design

    • Clarification of definitions for classes and objects.
    • Identification of relevant classes and objects for specific applications.
    • Development of suitable notations for object-oriented system designs.
    • Establishing processes to create structured object-oriented systems.
    • Understanding management implications when applying object-oriented design principles.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    This quiz explores the fundamental concepts of Object Oriented Analysis and Design, focusing on the object model and its core principles such as abstraction, encapsulation, modularity, and more. Test your understanding of these key concepts that form the backbone of object-oriented technology.

    More Quizzes Like This

    Use Quizgecko on...
    Browser
    Browser