wildbee/wildbee — pull request #35 by FranciscoCanas (2014-01-09 20:50:00+00:00)
Title: Generified Entity Controllers for standard CRUD

Here is an initial draft for the EntityController trait, and all of the changes necessary to have our other standard entity models make use of it. It's a draft, so feel free to throw suggestions about how to improve the design. I will also do a few passes for general code formatting and such once we've come up with suggested changes.

Goal:
With generic controller traits we can avoid writing all of the boilerplate code for each of model/entity we add, so long as it follows a standard pattern (this pattern is up for discussion!). Having all entities make use of this single generified controller also helps ensure we keep CRUD useage uniform. This also is another step towards making it simpler to write a 'scaffold' style plugin to generate new model/view/controller code for us.

Changes:
- EntityController generically handles controlling standard CRUD ops.
- Workflows, Tasks, Users, Statuses, and Packages now use EntityController for all (or only some) of their CRUD operations.
- Necessary exceptions (like for controlling packages, for example) are implemented in the regular Controller file.
- Views that are handled by the EntityController now have uniform method signatures.