So far we’ve covered the basics of what this project is all about and we’ve covered all of the database tables we’re going to need. Now it’s time to start getting into the Visual Studio Solutions and Projects. Just to clarify again, we’re doing this project in Visual Studio 2010. Later on we’ll get into stuff that is specific to VS 2010 and .Net 4 so if you’re trying to follow along in VS 2008, things won’t make complete sense down the road.
Because we want strict control over our project names, we’re going to create our Solution file separate from everything else. So in Visual Studio, go to New and then Project. Under “Other Project Types” (this won’t be beneath “Visual C#”) we’re going to select “Visual Studio Solutions” and then “Blank Solution”. This is going to give us a solution with no precreated projects inside of it which is just what we want. You might have a naming convention you want to follow but we’re just going to use “Veritas” for the name of our solution. Once that is done we can create our projects.
Anyone familiar with an N-tier architecture will understand why we’re going to add 4 different projects to our solution. First we’ll create our UI project. After going into “Add New Project” we’re going to choose a “ASP .Net MVC 2 Empty Web Application”. If you haven’t used the MVC project template before, I strongly suggest creating a “ASP .Net MVC 2 Web Application” and understandubg how things work before proceeding. We’ll name our project “Veritas.UI.Web”.
Next we need to create our Business Layer and our Data Layer projects. So go to “Add New Project” and under “Windows” add a “Class Library” named “Veritas.BusinessLayer” and “Veritas.DataLayer”. After we’ve created these, we can go and add some references we’ll need later. The BusinessLayer project should reference the DataLayer. The UI should reference both the BusinessLayer and the DataLayer. Lastly, we need to add a “Test Project” (located under “Test”) which we’ll use for all of our unit and integration tests. Go ahead and name it “Veritas.Tests”.
The last thing we’ll do for today is remove some of the default files that were created that we don’t need. In the business and data layer projects, there will be a “Class1.cs” file that is generated. Go ahead and delete that. Once you’re done with that, do the same thing with “UnitTest1.cs” in the tests project.
So now we’re done with our solution and projects. In the next entry we’ll actually start doing some coding. If you’d like a look at the project structure as it should be so far, you can download what we’ve done here.