Skip to content

Branches - Julia Bouvier#26

Open
juliabouv wants to merge 13 commits intoAda-C12:masterfrom
juliabouv:master
Open

Branches - Julia Bouvier#26
juliabouv wants to merge 13 commits intoAda-C12:masterfrom
juliabouv:master

Conversation

@juliabouv
Copy link

@juliabouv juliabouv commented Aug 21, 2019

Solar System

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
When does the initialize method run? What does it do? When I create a new instance of a class, the initialize method will automatically run the code inside. I can use it to create initial values and pass arguments directly through the new object of the class.
Why do you imagine we made our instance variables readable but not writable? We need them to be readable in order to access the variables in our main.rb. However we do not need the instance variables to be writable because the user should not have the ability to reassign the variables.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? The SolarSystem class would store the planet information as hashes in the @planets array. The keys could be used to pull the values instead of the instance variables names. This would likely require more iterating to access the values.
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 still be able to add key/value pairs to the hash without changing the writability of the program. We would need to use a different method to add the planet values to the hash other than the push or shovel method, and accessing the planet values would need to be refactored to use the hash keys.
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? If I am understanding SRP correctly...The Planet class follows the SRP: it is only responsible for creating each instance of the planet with the planets' attributes and returning a summary of these attributes. The SolarSystem class does not follow the SRP because it is responsible for more than one method/behavior.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? I only put two require statements in the main.rb file: One for the Planet class and one for the SolarSystem class. The files that contain the classes did not need a require to access information from each other, but the main file that was using the class information and calling the methods needed requires.

@jmaddox19
Copy link

jmaddox19 commented Aug 27, 2019

Solar System

What We're Looking For

Feature Feedback
Baseline
Whitespace (indentation, vertical space, etc) X
Variable names X
Git hygiene Great small and descriptive commits!
Planet
initialize method stores parameters as instance variables with appropriate reader methods X
summary method returns a string X
SolarSystem
initialize creates an empty list of planets X
add_planet takes an instance of Planet and adds it to the list X
list_planets returns a string X
find_planet_by_name returns the correct instance of Planet X
CLI
Can list planets and quit X
Can show planet details X
Can add a planet X
Complex functionality is broken out into separate methods main could've been broken up into methods but definitely not a big problem for this assignment. In all projects we've done and will do since, we'll have unit tests which will definitely require breaking things up into smaller methods.
Overall Great!

It all looks great!

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.

2 participants