Asp.net MVC Solution / Project Layouts

This is more an open question than a search for a specific answer.

As we all know, there is not a single answer that matches all the solutions, but I am curious to know how you structure asp.net MVC solutions and any pitfalls that may arise in your design, or things that you will do another if you can start again.

The asp.net MVC standard template is just a basic template, and I'm sure I read / heard in the podcast that Scott Hanselman stated that the only reason the Model folder is located was because people didn't ask where the model is . This already implies that perhaps it should be moved to a separate class.

Personally, in the small MVC applications that I executed, I allocated the model to my only class, which contains the model and repository, while the MVC project has a controller and views. This is generally a workout without any problems, but, as I said, these are just small applications.

So what do most people do? - Just using a standard template? - Separate only the model? - Separate the model and the controller? β€œIs the separation even moving, so is all access to data through web services or some kind of data portal?” β€œOr something completely different?”

Finally, how do people create unit tests? Only one unit test class that tests each project or unit test class for each project?

+6
asp.net-mvc projects-and-solutions project-management
source share
2 answers

Personally, I use the Jimmy Bogard approach: Organization of ASP.NET MVC solutions .

+4
source share

Honestly, most of the time I found a standard template, sufficient to just reuse it. I would say that this is true, right down to your own special preferences.

If my model were really big, I would definitely think about creating a separate class library project for it.

0
source share

All Articles