Week 13 Flashcards

1
Q
  • Implementation Hiding means
A

o Hiding the details of how a method works

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  • Method cohesion
A

o A measure of how the internal statements serve to accomplish the methods purpose

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  • A method with high cohesion has all of it’s ________ operarions
A

o Has all its internal operations focused on one task or goal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  • Low cohesion method traits
A

o Tries to do too many things

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  • noticeable high cohesion method traits
A

o Easy to read, maintain, reliable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

o How much methods are connected/share information

A
  • Method Coupling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  • Methods that are interdependent on each other have
A

o Tight coupling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  • Methods that are not interdependent
A

o Loose coupling
o Can be called in any order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  • Tightly coupled methods are known to use _____ level variables
A

o class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  • Tightly coupled methods are ____ to understand, and hard to ________
A

o Hard, maintain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  • T/F - Tightly coupled methods often have to be called in a certain order to work properly
A

o True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  • T/F – Global variables should be avoided to prevent tight coupling
A

o True (although Java does not have global vars, closest thing is a public class var)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  • T/F – A method with tight coupling and low cohesion is strong
A

o False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  • The word fragile is used to describe tight coupling and low cohesion
A

o True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  • What makes a good class?
A

o Represents a single concept

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  • Bad class design
A

o Name does not tell you what it does

17
Q
  • If the name of the class is a noun but a verb instead, you are making a mistake, why?
A

o You should be making a method instead of a class

18
Q
  • Public methods for a class should be related to
A

 One single concept from the domain of what the class represents

19
Q

o If one class needs to call methods from another class it’s referred to as

A

 Object dependency

20
Q

o Placing method calls to java API also creates ______ ___________

A

method dependencies

21
Q
  • Program outputs are best handled with a
A

o Dedicated output class

22
Q

o If you omit mutators from your class it becomes _________

A

immutable

23
Q

o An immutable class cannot be

A

 Changed after it has been created

24
Q

o Advantage of immutable objects? They can be freely references in

A

 They can be freely referenced in many places in a program, nothing can change its state unexpectedly

25
Q

o Mutable classes should follow the guideline: any method that accesses the objects values

A

 Should never change the object

26
Q

o Public methods are collectively referred to as

A

 Class-interface

27
Q

o When program logic places a method call it should only need to know

A

 The method name, parameters, and data to be returned