Object-Oriented Design Steps Quiz
10 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 is the primary role of a controller class in object-oriented design?

  • To mediate between boundary and entity classes (correct)
  • To categorize model elements by characteristics
  • To define the attributes of an entity class
  • To manage the database connection
  • Which of the following statements is true regarding persistent classes?

  • They cannot be instantiated but only inherited.
  • Their objects continue to exist after the system is shut down. (correct)
  • They are primarily used for user interface elements.
  • They only exist during the execution of a program.
  • In the context of method signatures, what does the visibility symbol '+' indicate?

  • The method is private and only accessible within its class.
  • The method is static and does not apply to instance objects.
  • The method is abstract and cannot be instantiated.
  • The method is public and can be invoked by other objects. (correct)
  • What does the notation '-accountNo: String {key}' signify in a class diagram?

    <p>A private attribute of type String that serves as a key.</p> Signup and view all the answers

    What are boundary classes primarily designed to represent?

    <p>The interface elements between the user and the system.</p> Signup and view all the answers

    What is a defining character of abstract classes in object-oriented design?

    <p>They are intended only for inheritance and cannot be instantiated.</p> Signup and view all the answers

    '-check Validity(date): int' is an example of what type of method?

    <p>A private instance method returning an integer.</p> Signup and view all the answers

    What does the notation '<<Boundary>>' represent in a design class diagram?

    <p>A categorization of the class as a boundary class.</p> Signup and view all the answers

    What is the significance of using lower case camelback notation for attribute names?

    <p>It standardizes the naming convention for attributes.</p> Signup and view all the answers

    Which of the following best describes a data access class?

    <p>A class that retrieves and sends data to a database.</p> Signup and view all the answers

    Study Notes

    Object-Oriented Design Steps

    • Object-oriented design identifies classes, methods, and messages needed for a use case.
    • Design is carried out for each use case individually.

    Design Class Diagrams

    • Stereotype: Categorizes model elements by characteristics (e.g., <<>>).
    • Persistent Class: Objects persist after system shutdown (data remembered).
    • Entity Class: Identifies domain problem classes (usually persistent).
    • Boundary Class/View Class: Exists on system boundaries (e.g., input windows, web pages).
    • Controller Class: Mediates between boundary and entity classes, acting as a switchboard between view and domain layers.
    • Data Access Class: Retrieves and sends data to/from database.

    Notation for Design Class Syntax

    • Attributes:

      • Visibility: Indicates access (+ public, - private).
      • Name: Lower camel case (e.g., attributeName).
      • Type: Data type (e.g., string, integer, date).
      • Initial Value (if applicable): Default value.
      • Property (if applicable): Indicates a key (e.g., {key}).
    • Methods:

      • Visibility: Indicates access (+ public, - private).
      • Name: Lower camel case (e.g., methodName).
      • Parameters: Variables passed to a method.
      • Return Type: Data type returned by the method.
    • Examples:

      • accountNo: String {key}
      • startingJobCode: integer = 01
      • +getName(): string
      • -checkValidity(date): int
    • Class Level Methods (Static Methods): Methods that apply to the class itself, not individual objects, underlined (e.g., _findStudentsAboveHours(hours): Array).

    • Class Level Attributes (Static Attributes): Attributes belonging to the class, not individual objects, underlined (e.g., _noOfPhoneSales: int).

    • Abstract Classes: Cannot be instantiated; used for inheritance (italicized).

    • Concrete Classes: Can be instantiated.

    Studying That Suits You

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

    Quiz Team

    Related Documents

    Description

    Test your knowledge on the essential steps of object-oriented design, including the identification of classes, methods, and messages for various use cases. This quiz also covers the various class types and syntax used in design class diagrams.

    More Like This

    UML Class Diagram Flashcards
    21 questions
    Class Diagrams - Introduction
    7 questions

    Class Diagrams - Introduction

    PrizeIndianapolis8680 avatar
    PrizeIndianapolis8680
    Use Quizgecko on...
    Browser
    Browser