Podcast
Questions and Answers
Which type of object is primarily responsible for managing interactions between a system and the external world?
Which type of object is primarily responsible for managing interactions between a system and the external world?
- Collection object
- Control object
- Boundary object (correct)
- Entity object
In UML diagrams, what symbol indicates that an attribute or operation has protected visibility?
In UML diagrams, what symbol indicates that an attribute or operation has protected visibility?
- # (correct)
- +
- *
- -
Which of the following relationships is best described as a 'has-a' relationship?
Which of the following relationships is best described as a 'has-a' relationship?
- Friendship
- Inheritance
- Composition (correct)
- Abstraction
Which design pattern aims to simplify a complex subsystem by providing a higher-level interface?
Which design pattern aims to simplify a complex subsystem by providing a higher-level interface?
If Date dates[size]
is a statically allocated array of Date objects and dates
is an object of type Date
, how would you call the print()
method on the first element?
If Date dates[size]
is a statically allocated array of Date objects and dates
is an object of type Date
, how would you call the print()
method on the first element?
Flashcards
Entity Object
Entity Object
Represent real-world entities with minimal application logic, holding data related to them. Example: Student object stores student name, ID, and courses.
Control Object
Control Object
Responsible for managing program control and interactions, often containing functions that perform actions. Example: 'AddClass' function in a school management system.
Boundary Object
Boundary Object
Act as interfaces between the system and the outside world, handling input and output operations. Example: A user interface or a function that prints class details.
Collection Object
Collection Object
Signup and view all the flashcards
Facade Pattern
Facade Pattern
Signup and view all the flashcards
Study Notes
Object-Oriented Concepts
- Entity object: Represents real-world entities with minimal application logic (e.g., student, instructor).
- Control object: Manages program flow; doesn't hold much data (e.g., adding a class).
- Boundary object: Controls interactions between the system and the outside world (e.g., user interface).
- Collection object: Lists or arrays (e.g., a class list).
UML Diagrams
- UML diagrams include attributes and operations.
- Private attributes are prefixed with
for private
. - Protected attributes are prefixed with
# for protected
. - Public attributes are prefixed with
+ for public
. - Abstract class names should be italicized.
- Static members are underlined.
- Friendship relationships are not shown.
Relationships
- Composition ("has-a"): A strong relationship where the existence of one object depends on another. Example: A team has a score
scoreGoal()
is a method that returns void (doesn't return a value).
Collection Classes
- Collection classes often have constructors and destructors, along with getter and setter methods.
- These are not typically shown in UML diagrams.
- Inheritance is indicated by a triangle, not an arrow.
Object Attributes
- Object attributes are not listed individually; instead, the relationships between objects are shown.
Arrays
- Static arrays: Fixed size (e.g.,
Date dates[size]
). - Dynamic arrays: Variable size (e.g.,
Date\* dates = new Date[size]
).
Design Patterns
- Top-down inside out: A design approach.
- Facade: Simplifies complex classes into a simpler interface.
- Observer: Updates objects based on changes in other objects.
- Strategy: Defines various algorithms and lets objects choose which to use.
Design Categories
- Behaviour: Describes how objects interact.
- Architectural: Shows grouping of objects.
- Creational: Explains object creation mechanisms.
- Structural: Shows relationships between objects.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.