DRAFT EVALUATION OF AN INTUITIVE
INTRODUCTION
TO OOSD USING THE UML (with a link to
hints and answers at the end)
Multiple
Choice and Matching Questions
Note that some of the multiple choice
questions
may have more than one correct answer; you should circle the most
appropriate
answer.
The most fundamental construct in object
oriented
softwared development is: (a) object (b) program (c)
UML
(d) algorithm (e) None of these
Match the following OOP concepts with the
equivalent UML
term by writing the letter from the first column in front of the
corresponding word in the right column.
is-a
association
has-a
attribute
uses-a
class
abstract object
dependency
behavior
generalization
state
operation
Which of the the following, at least in Java
(and
C++), is a synonym
for 'object'? (a) method (b) attribute (c)
instance
(d) class
The creation of an object is
called:
(a) declaration
(b) instantiation (c) initialization (d) all of these
In the definition of a class the developer encapslates
the class ____________. (a) attributes (b) members
(c)
methods (d) objects
The fundamental UML
construct for implementing object oriented behavior is the: (a)
procedure (b) function (c) method (d) operation
(e) program
The fundamental OOP language construct
for
implementing
object oriented behavior is: (a)
procedure (b) function (c) method (d) operation
(e) program
The fundamental OOP languageconstruct
for
specifying the state of an object is: (a) attribute
(b) variable (c) instance (d) class (e) object
Short
Answer Questions (Italics indicates answers probalbly not
covered
explicitly in the presentation.)
(K) (a) Which
kind of software construct
(class, functional operation, or procedural
operation) should be named with nouns?
(b) Which should be named
with verbs?
(U) What is the most important (a) similarity
and
(b) difference
(1) between association and inheritance, (2) between association
and dependency, (3) between encapsulation and visibility
(access
control), (4) between class and object, (5) betweeninstance
and object, and (6)
betweendeclaration,
instantiation,
and
initialization..
(K)
In Java (and C++), how does one
implement (1) encapsulation,
(2) access control (visibility), (3) generalization (4)
polymorphism*,
and (5) instantiation?
(S) (a) Draw the UML class diagrams with
inter-class relationships
for an "efficient" object oriented architecture of a "Cube
Analyzer"
application that determines the area, volumn,
and location
of cubes from data input by a user. Use, among others, three
classes:
(1) Cube which calculates the area and volumn,
(2) UserInterface which instantiates a variable testCube
of type Cube and allows the user to give it various values,
and (3) Point3D which specifies the location of a
point
(which is used to designate a cube's center).
(b)
Expand this architecture by incorporating the MOST useful abstract
class
for this software architecture. (c) Write
a
skeleton code for the Java C++
implementation of this architecture; do
NOT write the code for any of the methods (Replace this with comments.).
(U/synthesis)Illustrate
the basic UML class diagram constructs (covered in this
presentation) using four
connected
rectangles to represent (1) encapsulation (including visibility and
member syntax) and (2) semantic
relationships (including UML names, colloquialisms, navigability, and
multiplicity).
Final
Synthesis Question
When I develop object oriented software*,
I
develop
_________ and then I ________ them thus creating a software
_____________.
They get ___________ when the software is executed; then they become
_______________.
( *Note that "develop object oriented software" means from start to
finish,
i.e from conception to writing Java (or any object oriented language)
code. Also note that
"implement",
"compile", or "code" do not fit in any of these blanks because
they
are implied when I said "develop object oriented software".) (Try to answer
this a second time AFTER you have checked your answers on the preceding
questions.).
{Under
development.} Consider the following "draft"
comments, hints, and answers to the preceding questions:
This is the "first" and, perhaps, most fundamental multiple
choice question of which I can think. Some might call it "tricky"
because I expect most students to miss this question, so be thoughtful; read each possible answer
carefully. Note that "construct"
is exactly as the name implies, something with which you construct
things in computer science. The answer is the same, whether you
are "constructing" UML diagrams or writing OO code.
No hints; no answers. Each of the words in the left column
are FUDAMENTALUML terms, so if you are not
comfortable with them, look 'em up and make friends with them.
See the comment on the previous question.
Ditto
Ditto
Ditto
No hints; no answers. Each of the words in the left column
are FUDAMENTALobject oriented language terms, so
if you are not comfortable with them, look 'em
up and make friends with them.
Ditto
Hint: nouns are names of "things"; verbs are names of "actions".
Both (1) and (2) have the same similarity; in fact, all four
terms in those parts of the question all have one thing in common; they
are all _______________. In (3) one of the concepts requires the
other. (4) Consider reality versus abstraction. (5) They
are not synonyms; one is a special case of the other, i.e. which is
true: (a) "An object is an instance, but not visa versa." or (b) "An
instance is an object, but not visa versa".
Currently
not convered by the presentation.
Use the figures of section 4 as your example. If you
think about it the basic structure of the UML class diagrams will be
the same; only the details (class names and members) will differ.
The simplest way to answer this question is to draw one main
class (name it "C"). Then, since we have three relationships,
draw three more classes (suggenstion: place class "S" above C; place
class "A" to the left of C; and place class "D" to the right of
C. Then include the members of class C (only) and draw the
relationships betwee C and S, C and A, as well as C and D; it is not
necessary to draw relationships between A, D, and S.
This is not a good "test" question, i.e. if you don't start
correctly, everything will be off. However, this is a good
discussion question. Just be careful when considering the first
blank; consider question 1, above.