Skip to content

Time - Alicia#24

Open
aecombs wants to merge 7 commits intoAda-C13:masterfrom
aecombs:master
Open

Time - Alicia#24
aecombs wants to merge 7 commits intoAda-C13:masterfrom
aecombs:master

Conversation

@aecombs
Copy link

@aecombs aecombs commented Feb 20, 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 runs when we create a new object. It creates our object using the required number of arguments and assigning them as our object's instance vars
Why do you imagine we made our instance variables readable but not writable? Unless our user is also acting as creator of the universe, it would not make sense to give our users the power to modify qualities of our objects. Those are facts that are intrinsically tied to our objects.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? It would mean interacting with the program in subtle but different ways -- accessing them differently and creating methods that would be used in conjunction with our hash.
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? I wouldn't be able to shovel my planets into it! Also, I'd have to come up with keys for this hash. Maybe the names of the planets would be the keys and the planet objects would be the values.
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 my classes do, but not my methods -- I wish I had more time to refactor it and make things more organized.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? I put the require relative statements at the top of my main.rb and only required planets.rb and solar_system.rb. I tried to do a test file, which I couldn't run ultimately, but required a bunch of minitest files for that.

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