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

Earth - Emily #38

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

Earth - Emily #38

wants to merge 2 commits into from

Conversation

emirry
Copy link

@emirry emirry 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? "Initialize" is the constructor, which runs the instance methods with .new("") Since I can add in an argument, I don't need to call any instance of a class? i.e., ada.email

| Why do you imagine we made our instance variables readable but not writable? | We want it readable so that it only prints out that variable when it's called, not changed.

| How would your program be different if each planet was stored as a Hash instead of an instance of a class? | If it was a hash, we would have to iterate through that data structure to pull the information. It's easier to be able to call an instance of a class..

| How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? | Sounds complicating. I don't think it'll be that different, because I would still have to iterate through. It might be useful to use for a many-to-manay object composition.

| 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 it follows it. The planet.rb is responsible for gathering information for a single planet. Solar_system handles a collection of planets, where I can write methods to print out information about any planet.

| How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? | main.rb needed require_relative statements to be able to pull in data from the class files. Without, main.rb wouldn't work because there wouldn't be a way to call in the data from planets and solar system (unless everything was written out in one file?)

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