Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net MVC Solution/Project layouts [closed]

This is more of an open question rather than looking for one specific answer.

As we all know there is no one answer that fits all solutions but I am curious to find out how you structure you asp.net MVC solutions and any pitfalls you may have come across in your design or things that you would do differently if you could start again.

The standard asp.net MVC template is just a basic template and I'm sure I've read/heard in a podcast that Scott Hanselman stated the only reason the Model folder is there is so people didn't ask where's the model. This already implies that maybe it should be moved to its own separate class.

Personally in the small MVC apps I've done I've separated out the model into its only class that holds the model and the repository while the 'MVC' project has the controller and the views. This has generally workout without any issues but as I said these have only been small apps.

So what are most people doing? - Just using the standard template? - Separating out just the model? - Separating out the model and the controller? - Separating out even move so all the data access is done through web services or some sort of data portal? - Or something totally different?

Finally how are people creating unit tests? Just one unit test class that test each of the projects or a unit test class for each project?

like image 563
lancscoder Avatar asked Feb 19 '10 09:02

lancscoder


1 Answers

Personally I use Jimmy Bogard's approach: Organizing ASP.NET MVC solutions.

like image 181
mrydengren Avatar answered Sep 23 '22 15:09

mrydengren