Object-Oriented Design Fundamentals
30 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What term describes a class whose objects retain their existence after the system has been shut down?

  • Transient class
  • Controller class
  • Boundary class
  • Entity class (correct)
  • Which class type serves as a mediator between boundary classes and entity classes?

  • Persistent class
  • Controller class (correct)
  • Data access class
  • View class
  • What is the visibility indication for an attribute that can be accessed by other objects?

  • -
  • #
  • *
  • + (correct)
  • Which notation is used to indicate that a method cannot be invoked outside its own class?

    <ul> <li></li> </ul> Signup and view all the answers

    What does a design class diagram stereotype indicate?

    <p>The characteristics of a model element</p> Signup and view all the answers

    What notation is specifically used for attributes that only apply to the class and not its instances?

    <p>Class attribute</p> Signup and view all the answers

    Which of the following is true about abstract classes?

    <p>They can only be used for inheritance</p> Signup and view all the answers

    Which type of operation does a class level method pertain to?

    <p>The class itself</p> Signup and view all the answers

    What is the appropriate notation for the initial value of an attribute in a class?

    <p>Default value</p> Signup and view all the answers

    Which method signature denotes a method that will return an integer?

    <p>-calculateTotal(): int</p> Signup and view all the answers

    What does the principle of encapsulation specifically help to reduce?

    <p>System complexity</p> Signup and view all the answers

    Which design principle focuses on protecting stable parts of a system from those likely to change?

    <p>Protection from variations</p> Signup and view all the answers

    What is considered an indicator of high cohesion within a class?

    <p>A class that has a clear and focused set of responsibilities</p> Signup and view all the answers

    Which term describes the quantitative measure of how closely related classes are linked?

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

    Which principle advocates for grouping similar functionalities into classes?

    <p>Separation of responsibility</p> Signup and view all the answers

    What is the primary benefit of inheritance in object-oriented design?

    <p>It enables the creation of a class hierarchy sharing attributes and methods</p> Signup and view all the answers

    Why is it preferable to have classes that are loosely coupled?

    <p>It allows for independent function modifications without widespread impact</p> Signup and view all the answers

    Which of the following is NOT a consequence of low cohesion in a class?

    <p>Better organization of functionality</p> Signup and view all the answers

    What is the primary assumption that underlies object responsibility in design?

    <p>Objects know how to perform actions and will do what is requested</p> Signup and view all the answers

    What does high cohesiveness indicate about a class's responsibilities?

    <p>Responsibilities are well-aligned and logical</p> Signup and view all the answers

    What is the primary role of a subclass in object-oriented design?

    <p>To extend or inherit properties and methods from a superclass.</p> Signup and view all the answers

    Which concept allows different methods of the same name to coexist in a class?

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

    What is the significance of indirection in class design?

    <p>It helps reduce coupling and enhances security.</p> Signup and view all the answers

    What does the dashed line in a sequence diagram represent?

    <p>The lifeline of an object.</p> Signup and view all the answers

    How does a base controller function in an object-oriented design?

    <p>It serves as a switchboard between UI classes and domain classes.</p> Signup and view all the answers

    When creating a design class diagram (DCD), which step follows extending input messages?

    <p>Determining all internal messages.</p> Signup and view all the answers

    What do activation lifelines in a sequence diagram indicate?

    <p>The time period when an object is executing based on received messages.</p> Signup and view all the answers

    What assumption is made regarding technology in object-oriented design?

    <p>That technology is perfect and free from logon issues.</p> Signup and view all the answers

    What is expected when determining the objects involved in a message during design?

    <p>To include both origins and destinations as part of the analysis.</p> Signup and view all the answers

    Which is a characteristic of a controller class in object-oriented design?

    <p>It serves as an artifact without intrinsic business logic.</p> Signup and view all the answers

    Study Notes

    Steps of Object-Oriented Design

    • Object-oriented design identifies the classes, their methods, and messages for a use case.
    • Design is use-case driven.

    Design Class Diagrams

    • Stereotype: categorizes model elements by characteristics (e.g., <<>>).
    • Persistent class: object exists after system shutdown (data remembered).
    • Entity class: identifies a problem domain class (usually persistent).
    • Boundary class/view class: exists at system boundary (e.g., input window, webpage).
    • Controller class: mediates between boundary and entity classes, acting as a switchboard.
    • Data access class: retrieves and sends data to/from a database.

    Notation for a Design Class

    Syntax for Name, Attributes, and Methods

    Attributes

    • Visibility: indicates access (+ public, - private).
    • Attribute name: lower camel case (e.g., accountNo).
    • Type expression: class, string, integer, etc.
    • Initial value (if applicable); e.g., accountNo: String {key}.
    • Property (if applicable), e.g., {key}.

    Method Signature

    • Visibility: indicates access (+ public, - private).

    • Method name: lower camel case (verb-noun), e.g., getName().

    • Parameters: variables passed to a method.

    • Return type: the data type returned by the method, e.g., getName(): string.

    • Class-level method: applies to the class, not objects (static method).

    • Class-level attribute: applies to the class, not objects (static attribute); underlined (e.g., -noOfPhoneSales: int).

    • Abstract class; Italicized, cannot be instantiated, only used for inheritance.

    • Concrete class: can be instantiated.

    Studying That Suits You

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

    Quiz Team

    Description

    Explore the essential steps and components of object-oriented design through this quiz. Understand the classification of design elements, including classes, methods, and their interactions. Test your knowledge on design class diagrams and the notation for defining attributes and methods.

    More Like This

    Use Quizgecko on...
    Browser
    Browser