I've been using ASP.net MVC for about two years, and I'm still learning the best way to structure my application.
I wanted to throw away these ideas that I put together and see if they are βacceptableβ ways in the community for developing MVC applications.
Here is my main layout:
Project DataAccess . Contains all repository classes, LINQ-to-SQL data contexts, filters, and custom business objects for non-MS SQL database repositories (which LINQ-to-SQL doesnβt create). Repositories usually only have a basic CRUD for the object they are managing.
Service project . Contains service classes that execute business logic. They take orders from controllers and tell repositories what to do.
User Interface Project . Contains view models and some wrappers around things like ConfigurationManager (for unit testing).
The main MVC project . Contains controllers and views, as well as javascript and css.
Does this sound like a good way to structure ASP.NET MVC 2 applications? Any other ideas or suggestions?
Are view models used for all types of output for presentation and input from views?
-, , . . -. , , MVC/MVC2, , - .
MVC 2, viewmodel , -?
unit test , unit test ?
!