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

Fire - Anna #42

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

Fire - Anna #42

wants to merge 15 commits into from

Conversation

annakim93
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? The initialize method will create a new object and is run when the "new" method is used.
Why do you imagine we made our instance variables readable but not writable? We do not want the user to be able to overwrite or change the instance variables.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? Instead of having instance variables for the different planet fields, I imagine those would be stored as key-value pairs, and you would access those using the key name (planet[:field] vs @field).
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? If we used a hash instead of an array to store the planets, then we could use the hash key to return a planet instead of iterating through the list to find it.
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? Yes, they do follow this principle. The Planet class is responsible for managing single planets whereas the SolarSystem class is responsible for managing multiple planets in a collective system.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? My main.rb and test files needed "require" at the beginning. For main, I needed "require_relative 'filepath'". For test files I also required various minitest items.

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