How much controller per area is a lot
I have a few areas in my ASP MVC project. One area has near 15 controllers and about 6-7 actions per controller. Is it a lot and would it be smarter to make area per controller?
Ok I need to provide a little more informations: I am in the middle of the project I designed database and domain model library. Now I have asp mvc project with all controlelr in root controller folder. And I now trying to switch to areas and because I am new in all asp mvc world and areas I don't 开发者_StackOverflow社区know did I choose right areas and controllers. Here is the short list if what I got so far:
Area: Authentication {AccountController, RegisterController, ForgotPasswordController}
Area: School {AboutController, ArticleController, EventController, GroupController, VoteController, QuestionController, GalleryController, TeachersController, CoursesController, NewsController, StatisticController, InformationBoardController etc.}
Area: SchoolLife {StatusFeedController, ProfileController, EventController, GroupController, VeoteController, QuestionsController, StatusBoxController, ImagesController, VideosController etc.}
Area: Admin {...}
Area per controller wouldn't make much sense. Your question is a little subjective and difficult to answer in an objective manner but let me share what I do (which of course doesn't mean that it is correct, it's just how I like working). Personally I very rarely use areas, not to say never. I prefer a RESTful organization of my application, where I define resources and for each resource I have a controller defining the standard eight operations on this resource:
Depending on the size of the application and the number of resources I am dealing with I could have lots of controllers.
精彩评论