How to organize the project structure

 参考:How do you organize your projects? [closed]

 Address: https: //softwareengineering.stackexchange.com/questions/40394/how-do-you-organize-your-projects

 

 

In the design of the project layout and architecture, I started from two directions. First, I see the project being designed, and determine what issues need to be addressed. I'm going to look at the person using it, from the beginning of a rough UI design. At this point, I ignored the data, just to see what user requirements and who will use it.

 

Once I have a basic understanding of what they requested, I will determine what their core data is to be operated, and began to perform basic database layout for the data. Then I started to ask some questions to define business rules around data.

 

By independently from both ends, I was able to combine both ends in a way to plan a project. I always try to design separate as much as possible, then put them together, but when I move on, remember that each design.

 

Once I each end of the problem have a good understanding, I started to solve the problem and design the structure of the project.

 

After creating the basic layout of the project solution, I'll look at the function of the project, and according to a set of basic namespace type setting work done by the use of. This could be such an account, shopping cart, surveys.

 

Here is what I usually start from here the basic layout solutions. When the project is better defined, I will be refined to meet the specific needs of each project. Some areas may merge with other areas, I can add some specific areas when needed.

SolutionName

.ProjectNameDocuments 
  For large projects, and their need to save some documents together. To this end, I actually created a separate project or folder to save them in the solution. 
  
.ProjectNameUnitTest 
  unit tests always depends on the project - sometimes it really is 
       a basic feature, you can capture extreme cases, sometimes set to complete code 
       coverage. I recently added a graphical unit test to the armory. 

.ProjectNameInstaller 
   some projects have specific installation requirements, need to be addressed at the project level. 
.ProjectNameClassLibrary 
   if required Web services, API, DLL and so on. 
.ProjectNameScripts ( ** Added 2 / 29 / 2012 ** ) 
   I added this because I just found a demand in my current project. The project includes the following types of scripts: SQL (tables, pros, view), SQL data update script, VBScripts and so on. 
.ProjectName 
    .DataRepository 
       comprising a base class and the database communication. SQLProcs save sometimes contain any directory or other specific code. 
    .DataClasses
       Comprising a base class, the structure and enumeration is used in the project. They may be related to the data repository, but not necessarily connected to a data repository data repository. 
    .Services 
       perform all CRUD operations on the data, so you can change the repository, without having to rewrite any higher-level code. 
    .Business 
      perform any calculations or data service level data validation, carried out most of the interaction with the service layer. 
    .Helpers 
      I always create a code module contains helper classes. These items may be on the system, standard verification tools, regular expressions or customizations extension. 
    .UserInterface 
       user interface is used to display and manipulate data. UI Forms namespace always organized according to the functional unit, and provides additional folders for sharing forms and custom controls.

 

------------------------------------

I like to think my project is divided into several levels

Thus, the cycle of dependency management easier. For example, I can guarantee that no items improperly imported into view project (layer). I also tend to put my broken down into sub-layer layer. So all my solutions have this list of items:

  • Product.Core
  • Product.Model
  • Product.Presenter control layer
  • Product.Persistence persistence layer
  • Product.UI
  • Product.Validation
  • Product.Report
  • Product.Web

They are my application in larger "building blocks." Then, in each project, I organized in a more logical name space, but great changes. For UI, when you create many forms, I try to think in the space division, and then create a namespace for each "space." Suppose there are a bunch of user preferences, user controls and forms, I will give them a namespace called UserPreferences, and so on.

 

-------------------------------------

When I write code in .NET, there is a clear trend, that is a group of related functions. Each one of them may have some of the same subset. I like to break the major groups in the body - each a VS project. I then use the Assembly further its logical subdivision. According to this model, my current project is as follows:

Wadmt (solution)

  • Wadmt.Common
  • Wadmt.Data
    • Wadmt.Data.MySql
    • Wadmt.Data.SqlServer
    • Wadmt.Data.Oracle
  • Wadmt.Domain
  • Wadmt.Services
  • Wadmt.Tests
    • Wadmt.Tests.Common
    • Wadmt.Tests.Domain
    • Wadmt.Tests.Services
    • Wadmt.Tests.Integration
  • Wadmt.Web

Hope this is useful to you. Degree of separation took me some time to figure out.

 

-------------------------

to sum up:

In fact, what a mess has a hierarchical manner, I see much more in the future but do not care about the hierarchical structure of the project;

Undoubtedly the most classic three-tier architecture

Followed by four layers

Then the multi-layered;

…………

 

Guess you like

Origin www.cnblogs.com/Tpf386/p/12002848.html