Good Namespace Naming Conventions

后端 未结 7 723
情话喂你
情话喂你 2021-01-14 06:00

I am creating a class library for a CRUD business application. The major \"categories\" of business objects (with related data access layer objects) are:

  • Maint
7条回答
  •  耶瑟儿~
    2021-01-14 06:24

    It's generally a good idea to not name your packages after any specific pattern implemented but rather the business or functional domain they belong to.

    ie:

    Org.MyCompany.BusinessObjects.Maintenance.Contacts
    Org.MyCompany.BusinessObjects.Incidents.Contacts
    Org.MyCompany.BusinessObjects.Search.Contacts
    

    instead:

    Org.MyCompany.Contacts
    

    which would contain classes/interfaces/objects/whatever that perform operations on "Contacts".

提交回复
热议问题