locked
Solution structure for a project with multiple modules RRS feed

  • Question

  • User-545631939 posted

    Gurus!

    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?

    1.

    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

    2.

    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!

    Novice Kid

    Monday, March 18, 2013 10:03 AM

Answers

  • User1070236303 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 18, 2013 10:20 AM

All replies

  • User1070236303 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 18, 2013 10:20 AM
  • User-545631939 posted

    Thanks Guru stmarti! But how is the second approach better than the first?

    Monday, March 18, 2013 10:32 AM
  • User1070236303 posted

    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.

    Monday, March 18, 2013 4:57 PM