I’m having some trouble figuring out how to break a project into various
controllers. Here’s my situation. Say I’m building a small web store
that sells software. Each piece of software will belong to a given
Vendor.
Ok, so there are my two models ‘Software’ and ‘Vendor’. I’d like to be
able to do basic CRUD on both a Vendor and and or a Product. However, I
want the Vendor to be a sort of Gateway to the Product. So let’s say I
create the basic CRUD actions for the Vendor. If I’m viewing a Vendor’s
info–name, address, url, etc-- that’s where I would also see options
like: ‘List Products’, ‘Create Product’.
So the real question is should I use one controller or two controllers?
If I used one controller I would have actions like:
/admin/vendor/add
/admin/vendor/list
/admin/vendor/view
/admin/vendor/add_product
/admin/vendor/list_products
/admin/vendor/view_product
If I used two controllers:
/admin/vendor/add
/admin/vendor/list
/admin/vendor/view
/admin/product/add
/admin/product/list
/admin/product/view
Thanks,
Steven