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:
- Returning null values unnecessarily when you should be returning a meeting.
- Instantiating an object and then instantiating the same object within itself. You can simply use this.
- You could use public properties rather than GetMeetings() to retrieve the meetings. Using a method is probably more OOP
- You can create a method which checks for clashes with other meetings.
The refactored code:
Written on September 25, 2017