Administration Area in Asp.Net MVC

Flesym picture Flesym · May 25, 2009 · Viewed 9.2k times · Source

My question may be obvious but I'd like to build a well-designed web application. As for any administration area, the admin should be able to list/create/delete/modify users, articles, posts, etc...

I'd like to know what is the best way to design the application. Should I create a controller for each one of those items (/Users/Create/id or /Posts/Delete/id), or create all of the action in my Administration Controller (/Administration/CreateUser/id or /Administration/DeletePost/id) ?

Answer

womp picture womp · May 25, 2009

You should write a separate controller for each entity to keep a clean separation of concerns for your controller classes. If you only have one controller, then you will only have one Views directory with dozens of views, and your controller will contain dozens of methods, and that will soon become unmanageable.