Skip to content
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

Taylor/Solar-System #39

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

TaylorMililani
Copy link

Assignment Submission: Solar System

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Question Answer
When does the initialize method run? What does it do? its the first thing to run in main, and it creates a solar system. the planets added are put into @planets array.
Why do you imagine we made our instance variables readable but not writable? So the user can't go back in and change anything in the array or any of the details.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? the Hash class variable wouldn't belong to only the Planet class, but to solar system as well
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? you could extract the instance variables, but couldn't them back from the hash to use in a different way. you could clone them I suppose to make that hash
There is a software design principle called the SRP. The Single Responsibility Principle (SRP) says that each class should be responsible for exactly one thing. Do your classes follow SRP? What responsibilities do they have? The planet class's one responsibility is to create planets. the solar system class, however, is responsible for a few things.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? Solar system required Planet, and vice versa. Main required both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant