PDA

Click to See Complete Forum and Search --> : VS 2010 How do you structure your MVC application?


Pino
May 21st, 2010, 12:53 PM
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?

Krokonoster
May 21st, 2010, 05:35 PM
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.

Pino
May 22nd, 2010, 03:01 AM
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.

Krokonoster
May 22nd, 2010, 01:23 PM
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 (http://www.krokonoster.com/). (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.