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 Submission #30

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

Solar System Submission #30

wants to merge 3 commits into from

Conversation

hn4ever
Copy link

@hn4ever hn4ever 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 will run at the very beginning to "initialize" the class variables
Why do you imagine we made our instance variables readable but not writable? to protect them from being written by a wrong input from the user
How would your program be different if each planet was stored as a Hash instead of an instance of a class? I would create an array of hashes, each hash represents a single planet. The hashes keys would be the planets' details like name, color and other attributes.
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? For SolarSystem, if a hash was used, I can create an array of hashes where each hash represents a "solar system" with two keys: star and planets (planest will be an array here).
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 tried to do that where SolarSystem class represents the star and its planets, while the Planet Class represents the individual planets details. Each of these classes has their own methods to access more details or to apply some actions about the two classes.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? my require statement were like the following: require_relative 'planet' require_relative 'solar_system', both files were needed for the program to work.

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