COM Component reuse - Quiz Explanation
The answers you selected are indicated below, along with text that explains the correct answers.
1.
C++ inheritance is
Please select the best answer.
A.
A reuse mechanism that integrates objects at runtime
B.
A reuse mechanism that integrates objects at development/build time
C.
Not a reuse mechanism
D.
A binary reuse mechanism
The correct answer is B
. You need an include file describing the layout of base classes to compile with your code.
2.
Component reuse is
Please select the best answer.
A.
How one component inherits functionality from another
B.
Not very useful because it does not support inheritance
C.
Based on object composition at runtime
D.
A source-code-based mechanism
The correct answer is C. Objects are composed at runtime.
3.
Object composition can be
Please select the best answer.
A.
A limited mechanism because it does not support inheritance
B.
Multilevel, that is, object A reuses object B, which reuses object C
C.
Set up when you compile your code
D.
Obtained by inheriting the implementation of a set of base objects
The correct answer is B.
Objects can be composed in a multilevel fashion.
4.
Assume we have a client, the
FileManager
component, and the
FindFile
component. Which of the following is correct?
Please select the best answer.
A.
The client is aware that
FileManager
is using the
FindFile
component.
B.
The client can tell
FileManager
not to load
FindFile
.
C.
The client sees only the
FileManager
component;
FileManager
is a composition of two components--itself and
FindFile
.
D.
The client links to a library that contains object definitions for
FileManager
and
FindFile
.
The correct answer is C.
The
FindFile
component is not visible as a separate component to the client;
FileManager
is composed of itself and
FindFile
.