C# Project folder naming conventions

后端 未结 5 1117
轻奢々
轻奢々 2021-02-05 20:19

I have a project called Data which is a data layer. In this project, all files are just lying in the top folder. I have enumerations, POCOs, repositories, partial classes and so

5条回答
  •  礼貌的吻别
    2021-02-05 20:38

    I (currently - changes based on project) tend to use this approach when naming assemblies/projects/namespaces in a SAAS/Web style project)

    • CompanyName.
      • ProductName.
        • Data.
        • Business. (references data)
        • Model. (POCO and interfaces - referenced by all)
        • Services. (WCF service layer)
        • ServiceClient. (referenced by web clients)
        • Web. (web client business layer)
          • ViewModel. (view specific model)
          • {client facing product segment} [Commerce, CMS, CRM, Reporting, etc.]

    To explain the Services/Service Client...I use an IoC (currently StructureMap) that allows my WebClient to either speak directly to the Business layer or to be redirected to speak through the ServiceClient through Services to the Business layer. This gives me the flexibility to either deploy my app layer to my web applications or to distribute pieces of my business layer (app layer) to different servers by way of WCF/SOA principles.

提交回复
热议问题