Code Review – Refactor Meeting Scheduler (OOP)

This is another refactoring problem I answered on CodeReview.

Here is the original code:

My suggestions for reform:

Things a little unorthodox:

  1. Returning null values unnecessarily when you should be returning a meeting.
  2. Instantiating an object and then instantiating the same object within itself. You can simply use this.
  3. You could use public properties rather than GetMeetings() to retrieve the meetings. Using a method is probably more OOP
  4. You can create a method which checks for clashes with other meetings.

The refactored code:

Written on September 25, 2017