Last post Mar 18, 2013 04:57 PM by stmarti
Mar 18, 2013 10:03 AM|Novice Kid|LINK
I need your opinions on the folder structure of a large project with multiple modules that I am going to work on. There are multiple modules such as sales, finance, accounting, and so on. Which of the following folder structures for the project makes better
sense, and what are the pros and cons of each?
In the first schema, under the solution, we have different projects for sales, finance, accounting, etc., and each project has its own model, view and controller
In the second schema, there are 3 projects under the solution - namely, model project, view project and controller project. In each project, there are multiple folders, for sales, finance, accounting and other modules. Under each respective folder in the
respective projects, there are the corresponding model, view and controller classes pertaining to that module. For e.g., in the model project, under the sales folder, there is the sales model, and similarly in the view and controller projects, under the Sales
folder, there are sales view and sales controller classes. Similar for accounting and other folders.
Could my Gurus please give me comments on the above 2 solution structures? What are the pros and cons of each? The second one looks new to me, don't know whether it is good or bad. But at first look, it appears that a change to one module will affect every
other module using the second approach. What do my Gurus say?
Seeking enightenment from my Gurus!
Mar 18, 2013 10:20 AM|stmarti|LINK
I'm using the 2nd approach.
In the view project I separate the views with areas.
In the controller project the controllers separated by namespaces.
The model also separeted by namespaces.
Mar 18, 2013 10:32 AM|Novice Kid|LINK
Thanks Guru stmarti! But how is the second approach better than the first?
Mar 18, 2013 04:57 PM|stmarti|LINK
I'm not guru :)
I'm simply using the 2nd approach because I've always developed asp.net mvc applications using separate assemblies for the model and the controller. This is also a little bit harder, but powerful, you can have shared layouts and shared controllers for common
functionality of different areas, you need to maintain only a single web site etc.
Search for tutorials about asp.net mvc areas, and decide whether it fit in your project.