D
Dave Slinn
Any advice on how to organize my core class library project into
sub-namespaces? What are the general rules of thumb regarding
cross-namespace references? Can I have a class in namespace A have a
function or a property that returns a class from a different namespace?
For example, lets say I have a root namespace called ACME for my class
library project. Under the root namespace are classes such as Individual,
Address, etc. I also have a namespace defined for financial classes, called
ACME.Financial, which contains classes such as Invoice and Transaction.
Under Financial is a subnamespace called Discounts
(ACME.Financial.Discounts). A second namespace under the root, called
ACME.Groups, contains classes such as Group, GroupPlan, etc.
ACME
ACME.Financial
ACME.Financial.Discounts
ACME.Groups
Now, if I'm coding something for the GroupPlan class in ACME.Groups, is it
ok (I know it's possible but is it acceptable) to return an object of type
ACME.Financial.Invoice from the ACME.Groups.GroupPlan class or should I
stick to classes contained within the local namespace boundary (ACME.Groups)
or higher (ACME)?
Any thoughts or articles discussing Namespace coding best practices (all I
could find were ones about naming standards - not enough detail regarding
class layout) would be appreciated.
- Dave
sub-namespaces? What are the general rules of thumb regarding
cross-namespace references? Can I have a class in namespace A have a
function or a property that returns a class from a different namespace?
For example, lets say I have a root namespace called ACME for my class
library project. Under the root namespace are classes such as Individual,
Address, etc. I also have a namespace defined for financial classes, called
ACME.Financial, which contains classes such as Invoice and Transaction.
Under Financial is a subnamespace called Discounts
(ACME.Financial.Discounts). A second namespace under the root, called
ACME.Groups, contains classes such as Group, GroupPlan, etc.
ACME
ACME.Financial
ACME.Financial.Discounts
ACME.Groups
Now, if I'm coding something for the GroupPlan class in ACME.Groups, is it
ok (I know it's possible but is it acceptable) to return an object of type
ACME.Financial.Invoice from the ACME.Groups.GroupPlan class or should I
stick to classes contained within the local namespace boundary (ACME.Groups)
or higher (ACME)?
Any thoughts or articles discussing Namespace coding best practices (all I
could find were ones about naming standards - not enough detail regarding
class layout) would be appreciated.
- Dave