Standard project layout

When I am designing a project and laying out the architecture for it I start from two directions. First I look at the project being designed and determine what the business problems are that needs to be solved. I look at the people who will be using it and start with a crude UI design. At this point I am ignoring the data and just looking at what the users are asking for and who will be using it.

Once I have a basic understanding of what they are asking for I determine what the core data is that they will be manipulating and begin a basic database layout for that data. Then I start to ask questions to define the business rules that surround the data.

By starting from both ends independently I am able to lay out a project in a way that melds the two ends together. I always try to keep the designs separate for as long as possible before melding them together, but keep in mind the requirements of each as I move forward.

Once I have a good solid understanding of each end of the problem I begin to lay out the structure of the project that will be created to solve the problem.

Once the basic layout of the project solution is created I look at the functionality of the project and set up a base set of namespaces that are used depending on the type of work being done. This may be things like Account, Shopping Cart, Surveys, etc.

Here is the basic solution layout that I always start with. As the projects get better defined I refine it to meet the specific needs of the project. Some areas may be merged with others and I may add a few special ones as needed.

SolutionName

.ProjectNameDocuments

For large projects there are certain documents that need to be kept with it. For this I actually create a separate project or folder within the solution to hold them.

.ProjectNameUnitTest

Unit testing always depends on the project sometimes it is just really basic to catch edge cases and sometimes it is set up for full code coverage. Recently I have added graphical unit testing to the arsenal.

.ProjectNameInstaller

Some projects have specific installation requirements that need to be handled at a project level.

.ProjectNameClassLibrary

Used if there is a need for web services, APIs, DLLs or such.

.ProjectName

.DataRepository

The repository contains base data classes and database communication. Sometimes also hold a directory that contains any SQL stored procedures or other specific code.

.DataClasses

These classes contain the base classes, structs, and enums that are used in the project. These may be related to but not necessarily be connected to the ones in the data repository.

.Services

Contains any code that will perform CRUD actions with the data. It is coded in a way that the repository can be changed out with no need to rewrite any higher level code.

.Business

Performs any data calculations, business level data validation, does most interaction with the Service layer.

.Helpers

I always create a code module that contains helper classes. These may be extensions on system items, standard validation tools, expressions or custom built items.

.UserInterface

The user interface is built to display and manipulate the data. UI Forms always get organized by functional unit namespace with an additional folder for shard forms and one for custom controls.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s