Font size
WorksheetsObject-Oriented Design Final Exam
Total questions: 23
Worksheet time: 16mins
The first stage of the two-stage design process is (a) design.
The second stage of the two-stage design process is (a) design.
Which of these conceptual design techniques will help you analyze the problem space to determine classes for your object-oriented software?
Choose the two correct answers.
mockups
requirements
CRC
tradeoffs
During conceptual design, once the problem is mapped into components, what are the other two critical pieces of information that you must specify for these classes or components?
Choose the two correct answers.
methods
responsibilities
collaborators
abstract data types
You are writing the CRC card for a Bear component.
Choose the two responsibilities.
eat berries
hunger
camper
den
You are writing the CRC card for a Bear component.
Choose the three collaborators.
tree
computer
den
guitar
bear
You create an object that represents a user, storing important information about them such as their preferences. What kind of object is this?
control
client
entity
boundary
You create an object that represents a dialog box. It creates buttons and text fields, etc, for the user to interact with, and it logs those interactions. What kind of object is this?
control
interaction
entity
boundary
display
You create an object that compares values from two different sources. It then updates the smaller value to be equal to the larger one. What kind of object is this?
control
update
entity
repository
Which of these is an example of a quality tradeoff?
Adding security knowing it will reduce speed
Not delivering key features so that deadlines can be met
Adding preferences that allow users to switch some features on and off
Limiting features knowing that they can be added later
What is the term for reducing a class or object to its inputs and outputs in modelling?
filter thinking
black box thinking
pipe thinking
process thinking
Which one of these classes is in most need of being decomposed?
Student
Book
Store
Order
Which design principle enables developers to follow the guideline D.R.Y. ("Don't Repeat Yourself"):
encapsulation
generalization
abstraction
decomposition
Select the object pairing that has an association relationship:
Tree - Root
Coffee - Water
Book - Page
Hiker - Trail
Select the object pairing that has an aggregation relationship:
Car - Road
Pie - Crust
Book - Page
Stapler - Staple
Select the object pairing that has a composition relationship:
Bear - Forest
Tea - Sugar
Book - Page
Record Player- Record -
Choose the two answers that correctly complete the following sentence:
"We say that a class has low cohesion if..."
...it tries to encapsulate too many unrelated responsibilities.
...its purpose is unclear.
...it does not have all the necessary parts, i.e. it is incomplete.
...connects to many other classes.
Two classes are tightly coupled. What are some ways you might be able to tell
Choose the two correct answers.
In order to understand one class, you need to open up the other to look at the implementation
Their interactions are limited and controlled
They can easily be swapped with different implementations of the same class
They are very highly reliant on each other
How can you apply the principle of Separation of Concerns in object-oriented programming?
Ensure classes are only concerned with their own data
Separate data and actions (methods) into different classes
Separate objects or components according to their role in the software
Split developers into teams that each deal with different parts of the software
Which of these violates Liskov's Substitution Principle?
the superclass is too general
the subclass adds behaviour
subclasses specify the abstract methods of the superclass
an operation in the superclass is replaced by a different operation in the subclass
For which of these situations would you use a sequence diagram?
To show the different modes that your program can be in.
To show the relationship between classes
To show all of the different processes of your program.
To show the collaborative behaviour of objects in your program.
What is the purpose of model checking?
To check the software for errors before release
To verify that the conceptual model of your software matches the customer's requirements.
To test for user-reported bugs
To verify that the technical implementation matches conceptual mockups
What is an abstract data type?
variables that are assigned a type (i.e. integer, double) but does not yet have a value assigned.
a data type that cannot be used directly but must be implemented as an interface
a type of data defined by the developer rather than the language.
a data-centric class
