Deck 8: Class and Method Design

Full screen (f)
exit full mode
Question
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
Use Space or
up arrow
down arrow
to flip the card.
Question
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 the above
Question
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 the above
Question
The basic building block of a system is the _____.

A) object
B) attribute
C) message
D) partition
E) method
Question
_____ 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
Question
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
Question
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
Question
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
Question
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
Question
_____ 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
Question
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
Question
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
Question
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 the above
Question
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
Question
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
Question
_____ has emerged as the standard for the design of object-oriented systems.

A) Java
B) C++
C) VisualBasic
D) UML
E) Microsoft .NET
Question
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
Question
The audience for pseudocode is the _____.

A) analyst
B) programmer
C) manager
D) user
E) customer
Question
_____ 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
Question
Which of the following types of interaction coupling is "best?"

A) stamp
B) data
C) content or pathological
D) common or global
E) control
Question
It is impossible for a subclass to inherit from more than one superclass.
Question
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
Question
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
Question
A Case statement is an advanced form of an If statement.
Question
Many project teams are too quick to jump into writing code for classes without first designing them.
Question
Method specifications can be somewhat vague, as the programmers will have a good idea of what the analyst needs done in the system.
Question
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
Question
A derived attribute results from storing the value of a computation.
Question
You should maximize connascence within an encapsulation boundary and minimize connascence between the encapsulation boundaries.
Question
Fan-out refers to the number of attributes passed by one object to another.
Question
A post-condition is one that must be valid for a method to execute.
Question
Subclasses inherit the appropriate attributes and methods from the superclass above them.
Question
Contracts document the message passing that takes place between objects.
Question
C++ forces programmers to write code with good levels of interaction coupling.
Question
Polymorphism is the mechanism that combines the processes and data into a single object.
Question
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.
Question
Dynamic binding refers to the ability of object-oriented systems to defer the data typing of objects to run time.
Question
High levels of inheritance coupling in a system are always good and desirable.
Question
Clicking a mouse can be an event.
Question
Coincidental is the worst type of method cohesion.
Question
Pseudocode is useful for writing algorithm specifications.
Question
A For statement simply performs some action.
Question
Method cohesion is concerned with the level of cohesion among the attributes and methods of a class.
Question
A self-contained, encapsulated piece of software that can be plugged into a system is often referred to as a design a pattern.
Question
Functional method cohesion is the "best" type of method cohesion.
Question
A post-condition is a constraint that must be met for a method to execute.
Question
Class cohesion addresses the cohesion within each individual method of a class.
Question
Method signatures, in conjunction with frameworks, class libraries and design patterns, offer excellent opportunities for reuse.
Question
A method that performs multiple functions that are unrelated to one another exhibits Coincidental cohesion, and this type of cohesion is undesirable.
Question
The signature of a method is completely specified by the name of the method and the parameters that must be passed to the method.
Question
The order of the code in a method is critical for the method to execute correctly. This method has position connascence.
Question
A pre-condition is a constraint that must be met after the method executes.
Question
The worst type of method cohesion is logical method cohesion.
Question
You should try to maximize the cohesion within an encapsulation boundary and minimize the coupling between the encapsulation boundaries.
Question
When a calling method passes a variable to the called method, the two exhibit content or pathological coupling.
Question
Mixed-role class cohesion is the worst type of class cohesion.
Question
Generalization / specialization cohesion addresses the sensibility of the inheritance hierarchy.
Question
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?
Question
A method that combines two functions that use the same attributes to execute exhibits Communicational cohesion.
Question
Using an attribute to store the value of a computation is the use of a derived attribute.
Question
Invariants model constraints that must always be true for all instances of a class.
Question
What is inheritance coupling? How can inheritance coupling be minimized?
Question
Invariants are a type of constraints captured in object-oriented design
Question
A listing of the items that trigger the functionality in the program is known as events.
Question
Contracts contain a detailed algorithmic description of how the method is to work.
Question
What is cohesion? Is this desirable or undesirable in a system? Why?
Question
UML's Object Constraint Language is a formal language.
Question
A Case statement in Structured English has several mutually exclusive branches.
Question
Constraints can only be written in either a semiformal language or a formal language.
Question
A detailed outline of the lines of code that need to be written is known as pseudocode.
Question
Essentially, all OCL expressions are simply a declarative statement that evaluates to either being true or false.
Question
One of inheritance abuses in Object-oriented design is the inheritance was used to implement an association relationship.
Question
An If statement in Structured English controls actions that are performed under different conditions.
Question
Written documents that include explicit instructions on how to write the code to implement the method are called method specifications.
Question
Describe the concept of inheritance. How does this impact the development of object-oriented systems?
Question
What is coupling? Is this desirable or undesirable in a system? Why?
Question
A Case statement in Structured English specifies some action to be performed.
Question
There are only two different types of constraints typically captured in object-oriented design: preconditions and postconditions.
Question
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.
Question
What is interaction coupling? How can interaction coupling be minimized?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/92
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 8: Class and Method Design
1
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
2
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 the above
E
3
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 the above
B
4
The basic building block of a system is the _____.

A) object
B) attribute
C) message
D) partition
E) method
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
5
_____ 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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
6
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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
7
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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
8
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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
9
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
Unlock Deck
Unlock for access to all 92 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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
11
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
Unlock Deck
Unlock for access to all 92 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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
13
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 the above
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
14
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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
15
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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
16
_____ has emerged as the standard for the design of object-oriented systems.

A) Java
B) C++
C) VisualBasic
D) UML
E) Microsoft .NET
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
17
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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
18
The audience for pseudocode is the _____.

A) analyst
B) programmer
C) manager
D) user
E) customer
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
19
_____ 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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
20
Which of the following types of interaction coupling is "best?"

A) stamp
B) data
C) content or pathological
D) common or global
E) control
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
21
It is impossible for a subclass to inherit from more than one superclass.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
22
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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
23
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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
24
A Case statement is an advanced form of an If statement.
Unlock Deck
Unlock for access to all 92 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 92 flashcards in this deck.
Unlock Deck
k this deck
26
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 92 flashcards in this deck.
Unlock Deck
k this deck
27
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
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
28
A derived attribute results from storing the value of a computation.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
29
You should maximize connascence within an encapsulation boundary and minimize connascence between the encapsulation boundaries.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
30
Fan-out refers to the number of attributes passed by one object to another.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
31
A post-condition is one that must be valid for a method to execute.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
32
Subclasses inherit the appropriate attributes and methods from the superclass above them.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
33
Contracts document the message passing that takes place between objects.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
34
C++ forces programmers to write code with good levels of interaction coupling.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
35
Polymorphism is the mechanism that combines the processes and data into a single object.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
36
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 92 flashcards in this deck.
Unlock Deck
k this deck
37
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 92 flashcards in this deck.
Unlock Deck
k this deck
38
High levels of inheritance coupling in a system are always good and desirable.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
39
Clicking a mouse can be an event.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
40
Coincidental is the worst type of method cohesion.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
41
Pseudocode is useful for writing algorithm specifications.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
42
A For statement simply performs some action.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
43
Method cohesion is concerned with the level of cohesion among the attributes and methods of a class.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
44
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 92 flashcards in this deck.
Unlock Deck
k this deck
45
Functional method cohesion is the "best" type of method cohesion.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
46
A post-condition is a constraint that must be met for a method to execute.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
47
Class cohesion addresses the cohesion within each individual method of a class.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
48
Method signatures, in conjunction with frameworks, class libraries and design patterns, offer excellent opportunities for reuse.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
49
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 92 flashcards in this deck.
Unlock Deck
k this deck
50
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 92 flashcards in this deck.
Unlock Deck
k this deck
51
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 92 flashcards in this deck.
Unlock Deck
k this deck
52
A pre-condition is a constraint that must be met after the method executes.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
53
The worst type of method cohesion is logical method cohesion.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
54
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 92 flashcards in this deck.
Unlock Deck
k this deck
55
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 92 flashcards in this deck.
Unlock Deck
k this deck
56
Mixed-role class cohesion is the worst type of class cohesion.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
57
Generalization / specialization cohesion addresses the sensibility of the inheritance hierarchy.
Unlock Deck
Unlock for access to all 92 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 92 flashcards in this deck.
Unlock Deck
k this deck
59
A method that combines two functions that use the same attributes to execute exhibits Communicational cohesion.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
60
Using an attribute to store the value of a computation is the use of a derived attribute.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
61
Invariants model constraints that must always be true for all instances of a class.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
62
What is inheritance coupling? How can inheritance coupling be minimized?
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
63
Invariants are a type of constraints captured in object-oriented design
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
64
A listing of the items that trigger the functionality in the program is known as events.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
65
Contracts contain a detailed algorithmic description of how the method is to work.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
66
What is cohesion? Is this desirable or undesirable in a system? Why?
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
67
UML's Object Constraint Language is a formal language.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
68
A Case statement in Structured English has several mutually exclusive branches.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
69
Constraints can only be written in either a semiformal language or a formal language.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
70
A detailed outline of the lines of code that need to be written is known as pseudocode.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
71
Essentially, all OCL expressions are simply a declarative statement that evaluates to either being true or false.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
72
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 92 flashcards in this deck.
Unlock Deck
k this deck
73
An If statement in Structured English controls actions that are performed under different conditions.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
74
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 92 flashcards in this deck.
Unlock Deck
k this deck
75
Describe the concept of inheritance. How does this impact the development of object-oriented systems?
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
76
What is coupling? Is this desirable or undesirable in a system? Why?
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
77
A Case statement in Structured English specifies some action to be performed.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
78
There are only two different types of constraints typically captured in object-oriented design: preconditions and postconditions.
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
79
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 92 flashcards in this deck.
Unlock Deck
k this deck
80
What is interaction coupling? How can interaction coupling be minimized?
Unlock Deck
Unlock for access to all 92 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 92 flashcards in this deck.