Skip to content

Charlotte - Space -Solar System#43

Open
FreeMonkey19 wants to merge 5 commits intoAda-C13:masterfrom
FreeMonkey19:master
Open

Charlotte - Space -Solar System#43
FreeMonkey19 wants to merge 5 commits intoAda-C13:masterfrom
FreeMonkey19:master

Conversation

@FreeMonkey19
Copy link

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 called. It creates the actual object
Why do you imagine we made our instance variables readable but not writable? To prevent the values from being reassigned.
How would your program be different if each planet was stored as a Hash instead of an instance of a class? A lot more work! Uh...which layer is that? Did I dive deep enough to get the values I'm after?
How would your program be different if your SolarSystem class used a Hash instead of an Array to store the list of planets? A lot of key, value sorting going on unnecessarily.
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? yes. my planet class creates a planet and can dispaly a planet's details. My solar_system class can do what a solar system can do: add planets, calculate distances etc.
How did you organize your require statements? Which files needed requires, and which did not? What is the pattern? classes need to be required in the main. the main is 'running' the program and 'using' the classes. so require is needed in main only for both classes

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