Skip to content

Conversation

@antoniairizarry
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? It runs when a new instance is created, it adds parameters to the instance.
Why do you imagine we made our instance variables readable but not writable? Variables don't need to be writable unless they're going to be reassigned.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? A different way of accessing that information would need to be made taking into consideration that we'd probably need to get a hash key as the name.
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? It would've been more difficult to call a method on 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? I think so, though in main.rb things could've been a bit more compartmentalized.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? Both files needed a corresponding require statement on main.rb, which is the file that ran the program. The required files' use was storing information, I placed their require statements at the very top of main.rb.

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