The purpose of this workshop is to introduce you to the benefits of OOD by giving you the opportunity to refactor some procedural code into an OO design.
The program takes a list of student data and produces an output of student names and ratings, ordered by rating. Rating is an arbitrary calculation with no specific significance other than it's numeric.
Work in groups of 4-5 people. You should each work on your own local version of the code, but collaborate as a group on the solution, sharing code and screens etc. as you go.
- Fork this repo.
- Clone your version onto your machine.
- Open
lib/students.rb
and familiarize yourself with what it does. - Run the file -
$ ruby ./lib/students.rb
to check the output. - Refactor the code to use an object-oriented design.
Take an iterative approach. It's tempting to dive in and start changing everything, but try to stick to one refactor at a time.
If you are confident with RSpec, use TDD to drive your new design. If not, simply test that the file runs correctly after each iteration.
Commit your code after each iteration, with a message that explains what you did. This will help you understand your approach later on and enable you to rollback simply if you need to.