ucsb-cs56-projects / cs56-games-maze

-
3 stars 9 forks source link

Refactor to use proper MVC design pattern #18

Open jstaahl opened 10 years ago

jstaahl commented 10 years ago

Right now, the code has a fairly convoluted class structure with some circular dependencies (a MazeGrid has a MazePlayer and a MazePlayer has a MazeGrid)

Refactor the code to adhere to the MVC design pattern and remove these circular dependencies. You will find that certain existing classes lend themselves well to Views while others seem to do the work of both a Controller and a View at the same time. Separate these classes into separate View and Controller entities.

You can also remove classes if you do not see them fitting as either a Model or a View or a Controller.

As a start: Try breaking MazeComponent up into a view and a controller. The controller should have a MazeGrid among other things. A MazeGrid lends itself well to a Model, as does a MazePlayer. A MazeGrid should have a MazePlayer (but a MazePlayer should not have a MazeGrid). These are just some suggestions to get you started. You will most likely find many other instances of classes that should be broken up or absorbed into Models, Views, and/or Controllers.

~estimated 400

asyung commented 8 years ago

F16 OK (400 pts)

CDLlo commented 6 years ago

W18 OK 400 points