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.
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.
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.
Some projects have specific installation requirements that need to be handled at a project level.
Used if there is a need for web services, APIs, DLLs or such.
The repository contains base data classes and database communication. Sometimes also hold a directory that contains any SQL stored procedures or other specific code.
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.
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.
Performs any data calculations, business level data validation, does most interaction with the Service layer.
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.
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.