Skip to content

Space - Nora#23

Open
thenora wants to merge 4 commits intoAda-C13:masterfrom
thenora:master
Open

Space - Nora#23
thenora wants to merge 4 commits intoAda-C13:masterfrom
thenora:master

Conversation

@thenora
Copy link

@thenora thenora 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? Initialize is known as a "constructor" which means it "constructs" the object. In this case it's a method that automatically runs and helps setup a class.
Why do you imagine we made our instance variables readable but not writable? We wanted to be able to output the variable information, but not write over them.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? If we were using hashes, each hash would need key value pair rather than an intial setup for the class.
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? If I was storing information in a hash instead of an array, I'd need to create key value pairs for each hash.
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? My classes follow SRP. The solar system stores the list of planets within a solar system. My planet stores specific information about a planet.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? Planet didn't need require because it's not trying to read from any classes or information on other files. Main needed to access both the planet and solarsystem. And the solar system needed to access the planet.

@thenora
Copy link
Author

thenora commented Feb 20, 2020

submitting!

@thenora thenora closed this Feb 20, 2020
@thenora thenora reopened this Feb 20, 2020
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