Design Discussion Lab
Due Friday at the beginning of class
Objectives
- To analyze software design decisions
Motivation: Throughout this class, we'll talk a lot about design decisions. You and/or your professors have been making design decisions for awhile.
Design Discussion
Let's consider some design decisions from the provided code. For each of the following questions, first confirm my first intro/set up statement. Then, in a document, answer the questions:
turn
is an instance variable of theGame
class. Is it better design forturn
to be a local, instance, or class variable? Justify your answer.user_input
is a local variable in thegetInput
method of theConnectFour
class. Is it better design foruser_input
to be a local, instance, or class variable? Justify your answer.RANKS
is a class variable of theCard
class. Is it better design forRANKS
to be a local, instance, or class variable? Justify your answer.tokens
is an instance variable of theConnectFour
class. Is it better design fortokens
to be a local, instance, or class variable? Justify your answer.Player
is a class inwar.py
. Is it better design for thePlayer
class to be defined inwar.py
or ingame.py
? Justify your answer.War
'sstep
method takes as a parameterdummyInput
. What purpose does it serve?
Synthesis: What questions should you ask to determine if a variable should be a local, instance, or class variable? Answer in your document.
Submitting your assignment
Show Professor Sprenkle your assignment during the beginning of class on Friday.
Grading (10 pts)
You will be graded on making a good-faith effort in answering the design questions.