Deck 8: Class and Method Design
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/97
Play
Full screen (f)
Deck 8: Class and Method Design
1
Of all of the types of interaction coupling, _____ is the worst.
A) stamp
B) data
C) content or pathological
D) common or global
E) control
A) stamp
B) data
C) content or pathological
D) common or global
E) control
C
2
_____ suggests that only the information required to use an object should be available outside the object.
A) encapsulation
B) information hiding
C) polymorphism
D) inheritance
E) cohesion
A) encapsulation
B) information hiding
C) polymorphism
D) inheritance
E) cohesion
B
3
When a global data area exists outside individual objects, the resulting system has _____ interaction coupling.
A) stamp
B) data
C) content or pathological
D) common or global
E) control
A) stamp
B) data
C) content or pathological
D) common or global
E) control
D
4
Fan-out refers to _____.
A) the number of attributes a class has
B) the number of messages sent by a method
C) the number of times a message is sent by a method
D) the number of times an attribute is passed from a class
E) none of these
A) the number of attributes a class has
B) the number of messages sent by a method
C) the number of times a message is sent by a method
D) the number of times an attribute is passed from a class
E) none of these
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
5
A class/object should only represent one thing, and a method should only solve a single task. This principle is often referred to as _____.
A) coupling
B) cohesion
C) connascence
D) multiple inheritance
E) none of these
A) coupling
B) cohesion
C) connascence
D) multiple inheritance
E) none of these
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
6
Which of the following types of interaction coupling is "best?"
A) stamp
B) data
C) content or pathological
D) common or global
E) control
A) stamp
B) data
C) content or pathological
D) common or global
E) control
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
7
In terms of levels of abstraction, which of the following is at the lowest level relative to the rest?
A) system
B) partition/package
C) library
D) class/object
E) method
A) system
B) partition/package
C) library
D) class/object
E) method
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
8
The basic building block of a system is the _____.
A) object
B) attribute
C) message
D) partition
E) method
A) object
B) attribute
C) message
D) partition
E) method
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
9
What are the two types of coupling in object-oriented systems?
A) interaction, data
B) data, inheritance
C) data, stamp
D) interaction, inheritance
E) data, common
A) interaction, data
B) data, inheritance
C) data, stamp
D) interaction, inheritance
E) data, common
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
10
_____ refers to the level of interdependency or interrelationship among the modules in a system.
A) coupling
B) cohesion
C) connascence
D) multiple inheritance
E) single inheritance
A) coupling
B) cohesion
C) connascence
D) multiple inheritance
E) single inheritance
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
11
In order to get an object to perform a method, a(n) _____ is sent to the object.
A) state
B) object
C) attribute
D) message
E) instance
A) state
B) object
C) attribute
D) message
E) instance
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
12
Object-oriented systems have three general types of cohesion: _____, _____, and _____.
A) method, class, inheritance
B) method, generalization/specialization, inheritance
C) generalization/specialization, class, object
D) method, class, generalization/specialization
E) functional, sequential, procedural
A) method, class, inheritance
B) method, generalization/specialization, inheritance
C) generalization/specialization, class, object
D) method, class, generalization/specialization
E) functional, sequential, procedural
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
13
The audience for pseudocode is the _____.
A) analyst
B) programmer
C) manager
D) user
E) customer
A) analyst
B) programmer
C) manager
D) user
E) customer
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
14
When a method of one object refers to the inside hidden parts of another object, these methods are exhibiting _____ coupling.
A) data
B) stamp
C) control
D) common or global
E) content or pathological
A) data
B) stamp
C) control
D) common or global
E) content or pathological
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
15
In an object-oriented system, changes can take place at the following level of abstraction.
A) variable
B) method
C) class/object
D) cluster (examples: partition, package)
E) all of these
A) variable
B) method
C) class/object
D) cluster (examples: partition, package)
E) all of these
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
16
A class has an attribute in which a range of values has a semantic meaning. This class has _____ connascence.
A) Name
B) Type or Class
C) Convention
D) Algorithm
E) Position
A) Name
B) Type or Class
C) Convention
D) Algorithm
E) Position
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
17
Detailed design is important for two reasons. First, preexisting classes and components need to be understood, organized, and pieced together, and second, _____.
A) it is common for the project team to write some code and produce original classes that support the application logic of the system
B) it is tempting to jump in without planning
C) modular design is outdated
D) the SDLC continues to be used instead of a more reliable method of analysis for systems
E) top-down modular approaches are an acceptable method of analysis that must be performed during the planning phase
A) it is common for the project team to write some code and produce original classes that support the application logic of the system
B) it is tempting to jump in without planning
C) modular design is outdated
D) the SDLC continues to be used instead of a more reliable method of analysis for systems
E) top-down modular approaches are an acceptable method of analysis that must be performed during the planning phase
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
18
_____ means having the ability to send the same message to different objects, which can be interpreted differently by different objects.
A) encapsulation
B) polymorphism
C) inheritance
D) coupling
E) cohesion
A) encapsulation
B) polymorphism
C) inheritance
D) coupling
E) cohesion
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
19
Which of the following Structured English statements is an advanced form of an IF statement?
A) action statement
B) For statement
C) While statement
D) Case statement
E) Do statement
A) action statement
B) For statement
C) While statement
D) Case statement
E) Do statement
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
20
_____ has emerged as the standard for the design of object-oriented systems.
A) Java
B) C++
C) VisualBasic
D) UML
E) Microsoft .NET
A) Java
B) C++
C) VisualBasic
D) UML
E) Microsoft .NET
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
21
Contracts document the message passing that takes place between objects.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
22
High levels of inheritance coupling in a system are always good and desirable.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
23
C++ forces programmers to write code with good levels of interaction coupling.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
24
Polymorphism is the mechanism that combines the processes and data into a single object.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
25
Many project teams are too quick to jump into writing code for classes without first designing them.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
26
Coincidental is the worst type of method cohesion.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
27
You should maximize connascence within an encapsulation boundary and minimize connascence between the encapsulation boundaries.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
28
It is impossible for a subclass to inherit from more than one superclass.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
29
Because of potential problems, developers must be aware of the effects of modifications in a superclass and in each of the subclasses that will inherit the modification.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
30
Method specifications can be somewhat vague, as the programmers will have a good idea of what the analyst needs done in the system.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
31
The constraints and contracts in class and method design models were derived from the ____________ requirements and the problem domain representations.
A) business
B) regularly
C) non-functional
D) functional
E) reliability
A) business
B) regularly
C) non-functional
D) functional
E) reliability
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
32
A post-condition is one that must be valid for a method to execute.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
33
There are three different types of constraints typically captured in object-oriented design: preconditions, postconditions, and _____________.
A) regular conditions
B) guard conditions
C) exception handling
D) invariants
E) contracts
A) regular conditions
B) guard conditions
C) exception handling
D) invariants
E) contracts
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
34
Dynamic binding refers to the ability of object-oriented systems to defer the data typing of objects to run time.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
35
Constraints can be written in either a natural language, a semiformal language, or a formal language such as ________________.
A) UML
B) Structured English
C) Use case diagrams
D) English
E) UML's Object Constraints Language
A) UML
B) Structured English
C) Use case diagrams
D) English
E) UML's Object Constraints Language
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
36
A derived attribute results from storing the value of a computation.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
37
Essentially, all OCL expressions are simply a declarative statement that evaluates to either being true or false. If the expression evaluates to true, then the constraint has been _______________.
A) satisfied
B) executed
C) always true
D) served as an invariant
E) skipped
A) satisfied
B) executed
C) always true
D) served as an invariant
E) skipped
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
38
Subclasses inherit the appropriate attributes and methods from the superclass above them.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
39
Like other problem domain models, the _____________, contracts, and method specifications in class and method design need to be verified and validated.
A) constraints
B) classes
C) behaviors
D) associations
E) polymorphisms
A) constraints
B) classes
C) behaviors
D) associations
E) polymorphisms
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
40
Fan-out refers to the number of attributes passed by one object to another.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
41
Functional method cohesion is the "best" type of method cohesion.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
42
A Case statement is an advanced form of an If statement.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
43
Clicking a mouse can be an event.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
44
The signature of a method is completely specified by the name of the method and the parameters that must be passed to the method.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
45
A For statement simply performs some action.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
46
You should try to maximize the cohesion within an encapsulation boundary and minimize the coupling between the encapsulation boundaries.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
47
A method that combines two functions that use the same attributes to execute exhibits Communicational cohesion.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
48
Using an attribute to store the value of a computation is the use of a derived attribute.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
49
The worst type of method cohesion is logical method cohesion.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
50
Method signatures, in conjunction with frameworks, class libraries and design patterns, offer excellent opportunities for reuse.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
51
Mixed-role class cohesion is the worst type of class cohesion.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
52
A method that performs multiple functions that are unrelated to one another exhibits Coincidental cohesion, and this type of cohesion is undesirable.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
53
When a calling method passes a variable to the called method, the two exhibit content or pathological coupling.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
54
Generalization/specialization cohesion addresses the sensibility of the inheritance hierarchy.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
55
A self-contained, encapsulated piece of software that can be plugged into a system is often referred to as a design a pattern.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
56
Pseudocode is useful for writing algorithm specifications.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
57
The order of the code in a method is critical for the method to execute correctly. This method has position connascence.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
58
Moving the attributes to a calling class when it is the only class that needs those attributes is not a method of optimizing the design of a system?
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
59
Class cohesion addresses the cohesion within each individual method of a class.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
60
Method cohesion is concerned with the level of cohesion among the attributes and methods of a class.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
61
Essentially, all OCL expressions are simply a declarative statement that evaluates to either being true or false.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
62
Invariants are a type of constraints captured in object-oriented design
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
63
Constraints can only be written in either a semiformal language or a formal language.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
64
A post-condition is a constraint that must be met for a method to execute.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
65
In order to verifying and validating class and method design, all constraints, contracts, and method specifications must be tested.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
66
There are only two different types of constraints typically captured in object-oriented design: preconditions and postconditions.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
67
What is coupling? Is this desirable or undesirable in a system? Why?
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
68
A Case statement in Structured English specifies some action to be performed.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
69
Written documents that include explicit instructions on how to write the code to implement the method are called method specifications.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
70
What is interaction coupling? How can interaction coupling be minimized?
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
71
A pre-condition is a constraint that must be met after the method executes.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
72
An If statement in Structured English controls actions that are performed under different conditions.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
73
A detailed outline of the lines of code that need to be written is known as pseudocode.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
74
Contracts contain a detailed algorithmic description of how the method is to work.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
75
UML's Object Constraint Language is a formal language.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
76
A listing of the items that trigger the functionality in the program is known as events.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
77
Since a Manager has a higher position than an Employee, it is a good idea to design class Manager as a superclass, and the class Employee inherits class Manager.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
78
One of inheritance abuses in Object-oriented design is the inheritance was used to implement an association relationship.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
79
A Case statement in Structured English has several mutually exclusive branches.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck
80
Invariants model constraints that must always be true for all instances of a class.
Unlock Deck
Unlock for access to all 97 flashcards in this deck.
Unlock Deck
k this deck