How do you design classes in a given solution, determine a classes members, and class responsibilities? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do you design classes in a given solution, determine a classes members, and class responsibilities?

Let's say you want to make a console app for a simple card game like Go Fish. What classes/members would you choose and why? I imagine something like having a Deck class containing a Card class. Maybe a Hand class for each player. (A Person class?) The Deck could have a Shuffle() and a Deal() method. What controls each turn? What checks for a win condition? Is there a separate class to handle methods and functions involving the flow of control from person to person?

5th Aug 2018, 5:46 PM
Justin Kindrix
Justin Kindrix - avatar
1 Answer
+ 1
After a lot of reading, I think the main idea I'm missing and the mechanisms I need to learn more about are object-oriented analysis & design concepts. I'll dig into that and go from there! Great job! Self-five! :)
5th Aug 2018, 10:49 PM
Justin Kindrix
Justin Kindrix - avatar