Skip to content

Conversation

@yesentorres
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 creates a new instance of a class.
Why do you imagine we made our instance variables readable but not writable? We probably don't want the users of this program to be able to mess with our class structure.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? The program would need to use different methods for the control loop.
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? We would need to introduce new instance variables to support key-value pairs.
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 they do. The solar system class is responsible for being composed of different planets. The planet class has the responsibility of storing information about planets in the Solar System.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? I wrote my require statements at the top of my main.rb. The classes themselves did not require "require statements" since main.rb does all the work of bringing them together.

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