๐ย ๐ย ๐ฆย ๐ย ๐ย ๐ฆย ๐ธ ๐ฆ๐ณย ๐ธย ๐ย ๐ฅย ๐ย ๐ฅ๐ฟ
public class InstantFeedbackQuiz extends Quiz {
// REQUIRES: questions cannot be an empty list
// EFFECTS: constructs quiz with given list of questions
public InstantFeedbackQuiz(QuestionList questions) {
super(questions);
}
// MODIFIES: this
// EFFECTS: submit an answer to the current question
// and return feedback string
@Override
public String submitAnswer(String answer) {
boolean correct = super.checkAnswer(answer);
return correct ? "Correct!" : "Incorrect!";
}
}
a bunch of code
Well-designed software modules
Tight Coupling
Loose Coupling
Semantic Coupling (detected at runtime)
Class depends on impl. in another class
Change in class causes bug in other class
Remember Single Point of Control in CPSC 110
Changes should be needed only in one place
Your Design
Unnecessary coupling!
Who owns the phone?
Who pays?
For what account?
3. Long distance calls!
If you find this happening to you...
...look for ways this month's techniques can help!