-
May 21st, 2010, 12:53 PM
#1
Thread Starter
Super Moderator
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?
-
May 21st, 2010, 05:35 PM
#2
Hyperactive Member
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.
-
May 22nd, 2010, 03:01 AM
#3
Thread Starter
Super Moderator
Re: How do you structure your MVC application?
Originally Posted by Krokonoster
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.
-
May 22nd, 2010, 01:23 PM
#4
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|