Object-Oriented Design Steps Quiz

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. (D)</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. (D)</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. (D)</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. (D)</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. (A)</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. (A)</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. (C)</p> Signup and view all the answers

Flashcards

Object-Oriented Design

Identifying classes, methods, and messages needed for a use case.

Use Case Driven Design

Designing by focusing on use cases one by one.

Persistent Class

A class whose objects survive program shutdown.

Entity Class

A class representing real-world problem domain objects, often persistent.

Signup and view all the flashcards

Boundary Class

A class on the system boundary, like input forms or web pages.

Signup and view all the flashcards

Controller Class

Mediates between boundary and entity classes.

Signup and view all the flashcards

Data Access Class

Retrieves data from/sends data to a database.

Signup and view all the flashcards

Attribute Visibility

Indicates if an attribute is accessible (+, public or - private).

Signup and view all the flashcards

Method Visibility

Indicates if a method can be called from outside the class (+, public or - private).

Signup and view all the flashcards

Class Level Method

A method that operates on the class itself, not individual objects.

Signup and view all the flashcards

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

More Like This

Use Quizgecko on...
Browser
Browser