Framework namespaces

  • Thread starter Thread starter Ludwig
  • Start date Start date
L

Ludwig

Hi,

we're planning to create a framework of reusable components. Now, we
are having a discussion on how to set up the namespace hierarchy.

We have components like a mult-select TreeView, a VATChecker, a
serializable Dictionary and so on.

One approach could be:
Company.Windows.Forms (containing treeview)
Company.Common.Validators (containing VATChecker class)
Company.Common.Collections.Generic.SerializableDictionary
Company.Web (web related stuff)
Company.NetCF (mobile stuff)

Someone told me to add business into the namespace hierarchy, like:
Company.Finance (containing VATChecker class).

So I'm looking for some guidance here: what is the best approach and
why?

Thanks!
 
Sure adding business is good if your components are for that domain only. If
not what you have is perfect

VJ
 
One step my company has added is?


MyCompany.Applications

where .Apps is an application
and the lack of an "Applications" means a framework piece.


As in.

MyCompany.Exceptions
MyCompany.IO
MyCompany.Messaging
...
MyCompany.Applications.NorthwindManager

Thus we have a way to seperate framework from applications.


I would (personally) avoid the Common word.

Company.Collections.Generic.SerializableDictionary
instead of
Company.Common.Collections.Generic.SerializableDictionary

I think trying to relay the intention of Common is hard sometimes, and
inevitably somebody is going to put something in there you don't want.
(unless you have an approval process).

I try to look at the System namespaces and try to mimick them if I can.

System.Exceptions
becomes
MyCompany.Exceptions namespace.
 
One step my company has added is?


MyCompany.Applications

where .Apps is an application
and the lack of an "Applications" means a framework piece.


As in.

MyCompany.Exceptions
MyCompany.IO
MyCompany.Messaging
..
MyCompany.Applications.NorthwindManager

Thus we have a way to seperate framework from applications.


I would (personally) avoid the Common word.

Company.Collections.Generic.SerializableDictionary
instead of
Company.Common.Collections.Generic.SerializableDictionary

I think trying to relay the intention of Common is hard sometimes, and
inevitably somebody is going to put something in there you don't want.
(unless you have an approval process).

I try to look at the System namespaces and try to mimick them if I can.

System.Exceptions
becomes
MyCompany.Exceptions namespace.

Thank you for you remark. We do have an approval process, but I will
take your remark in consideration! Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top