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

Solar System #43

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

Solar System #43

wants to merge 4 commits into from

Conversation

MonaRahmani
Copy link

@MonaRahmani MonaRahmani commented Sep 23, 2020

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? it is called automatically from within the new method and runs when we create a new instance of a class. It sets up the object based on the arguments passed in
Why do you imagine we made our instance variables readable but not writable? when we don't want the instance variables to be changed, we make our instance variables just readable.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? We should have to iterate through the hash in order to get the information,
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? We should have to loop through the hash and use all keys to get the information.
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? For the planet, it handles single planet objects, and for solar_system, it deals with multiple planets.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? main.rb uses the classes from planet.rb and solar_system.rb, main.rb needs require_relative. planet.rb and solar_system.rb, don't use the classes from other files, so they don’t need require statements.

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