-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring - Part 3 #168
Labels
Comments
umitozmen
added a commit
to umitozmen/rse-classwork-2020
that referenced
this issue
Dec 7, 2020
nikoSchoinas
referenced
this issue
Dec 9, 2020
DavidScobie
added a commit
to DavidScobie/rse-classwork-2020
that referenced
this issue
Dec 9, 2020
premal-varsani
added a commit
to premal-varsani/rse-classwork-2020
that referenced
this issue
Dec 9, 2020
Open
nuttamas
added a commit
to nuttamas/rse-classwork-2020
that referenced
this issue
Dec 23, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This follows on from #167.
Stage 3: Object-oriented structure
We will now look at at how to represent and manipulate this data using our own user-defined objects.
Instead of a dictionary, we will define two classes, which will represent a single person and the whole group. We will restructure our code so that group functions apply directly to the group, instead of the person having all of the methods.
Again, you may also wish to refer to the course notes on object-oriented design.
Take a look at the file
initial_two_classes.py
to see one possible way in which the code could be structured.Internally, the
Group
class still uses a dictionary to track connections, but someone using the class does not need to be aware of that. We have implemented some methods for these classes, but not everything that is required (the remaining methods havepass
instead of actual code).Your task:
The text was updated successfully, but these errors were encountered: