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:
turnis an instance variable of theGameclass. Is it better design forturnto be a local, instance, or class variable? Justify your answer.user_inputis a local variable in thegetInputmethod of theConnectFourclass. Is it better design foruser_inputto be a local, instance, or class variable? Justify your answer.RANKSis a class variable of theCardclass. Is it better design forRANKSto be a local, instance, or class variable? Justify your answer.tokensis an instance variable of theConnectFourclass. Is it better design fortokensto be a local, instance, or class variable? Justify your answer.Playeris a class inwarGame.py. Is it better design for thePlayerclass to be defined inwarGame.pyor ingame.py? Justify your answer.WarGame'sstepmethod takes as a parameterdummyInput. What purpose does it serve?
Synthesis and Reflection
- Hopefully, in your process of writing the explanations, you got some clarity about how to determine what kind of variable should be used to represent various information. Go back and refine your answers, as applicable, with the clarity you had at the end.
- With that clarity, what questions should you ask to determine if a variable should be a local, instance, or class variable? Answer in your document.
- What made reading/understanding the code easy? What made it difficult? How could it be improved to make it more readable/understandable?
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.