Results 1 to 4 of 4

Thread: How do you structure your MVC application?

  1. #1

    Thread Starter
    Super Moderator
    Join Date
    Dec 2003
    Posts
    4,787

    How do you structure your MVC application?

    I've spent a good 8 months working with MVC now on 2 projects. However I'm interested to see how everyone else structures there project and how each layer interacts with the other. Below is a sample of what we use,

    Project.DAL - Data Access layer, generated by subsonic and some custom repositorys for CRUD functions on the database. Each DAL class also has a partial class which does a conversion from the Data entity to the Model in the class below.

    Project.Models - This contains a seperate set of Models that are used to pass data around the application (Including the View) they are not attached to the DAL. Data validation is also here.

    Projct.BLL - Business Logic layer, this contains services and essentially the core logic for the application.

    Project.Web - The front end of the website, controllers request data from the BLL and display them in the views.

    Thoughts? Questions? Opinions?

  2. #2
    Hyperactive Member Krokonoster's Avatar
    Join Date
    Jan 2010
    Location
    Cape Town
    Posts
    448

    Re: How do you structure your MVC application?

    Myself break what you have as Project.Web a bit further, only to keep things a bit more organized

    Project.Web.UI : Only Views (Areas), scripts and stylesheets
    Project.Web.Core: Controllers , ViewModels

    Apart from that, pretty much the same you have there.


  3. #3

    Thread Starter
    Super Moderator
    Join Date
    Dec 2003
    Posts
    4,787

    Re: How do you structure your MVC application?

    Quote Originally Posted by Krokonoster View Post
    Myself break what you have as Project.Web a bit further, only to keep things a bit more organized

    Project.Web.UI : Only Views (Areas), scripts and stylesheets
    Project.Web.Core: Controllers , ViewModels

    Apart from that, pretty much the same you have there.
    Interesting, effectivly my Models are my ViewModels, they are the abstraction of the DAL model into a more friendly Model to display data.

    Thanks for the reply.

  4. #4
    Hyperactive Member Krokonoster's Avatar
    Join Date
    Jan 2010
    Location
    Cape Town
    Posts
    448

    Re: How do you structure your MVC application?

    Wanted to do this for a while, and started to create a application structure for future projects..

    Figured might be a good idea to share and hear what others think (at the risk of making a complete fool out of myself).

    So far just the different projects (see SolutionInfo.txt and ProjectInfo.txt in each project), IoC setup (Castle) and Bootstrap tasks.

    Download it here. (Feel free to criticize, but take it easy will you?)

    Might look like overkill to break things up that much, but working on this current project taught me you just cannot keep things separated enough.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width