Good namespace conventions

I am creating a class library for a CRUD business application. The main "categories" of business objects (with related objects of the data access level):

  • Maintenance (for working with the table wizard (main lists) in the database
  • Incidents (most facilities relate to a real incident)
  • Search (obviously)

At the moment, my namespaces are configured as follows:

  • BusinessObjects.Maintenance.Contacts
  • BusinessObjects.Maintenance.Products
  • BusinessObjects.Maintenance.Classifications
  • .
  • BusinessObjects.Incidents.Contacts
  • BusinessObjects.Incidents.Products
  • BusinessObjects.Incidents.Classifications
  • .
  • BusinessObjects.Search.Contacts
  • BusinessObjects.Search.Products
  • BusinessObjects.Search.Classifications
  • .
  • Dal.Maintenance.Contacts
  • Dal.Maintenance.Products
  • Dal.Maintenance.Classifications
  • .
  • Dal.Incidents.Contacts
  • Dal.Incidents.Products
  • Dal.Incidents.Classifications
  • .
  • Dal.Search.Contacts
  • Dal.Search.Products

, .

?

- , ? , / ?

, , . . , .

+3
7

, . , . .

"Lets take a look at the BusObjConfIntContYYYYmmdd package now..."

, , - . , . - , ?:

BusinessObjects.Incidents.Classifications
BusinessObjects.Classifications.Incidents

BusinessObjects.Forms.ProjectManager.Exportable.Windows.XP
BusinessObjects.Forms.ProductManager.Exportable.Windows.XP

.

+5

, - , - , .

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

:

Org.MyCompany.Contacts

///, "".

+5

, . , , , . 3-5 . , , .

, . , ...

+2

, , ( ), ( 5 ). (, ), , .

, , , . , , , ( ) Maintenance, , , , , , (, , ), . , , .

+1

, . , .

:

class Vehicle 

class Car : Vehicle
class CarRed : Car 
class CarBlue : Car 

class Truck : Vehicle 
class TruckRed : Truck 
class TruckBlue : Truck

, . , . , , , .

GOF - , Bridge.

, , , . , , .

+1

. . , , , :

  • ALib -
  • Mongo - --.
  • DBLite - SQLite3
  • Track1 - ( )

, . , , , , .

0

Source: https://habr.com/ru/post/1703828/


All Articles