some namespaces where I work:
Infocus.Shared <-- 'common' components, utility classes etc. This class does
not reference any other of our libs.
Infocus.Diagnostics
Infocus.ApplicationName <-- represents an application library, one which
contains:
Infocus.ApplicationName.UI.Forms
Infocus.ApplicationName.UI.Controls
Infocus.ApplicationName.Components
Infocus.ExportApi <-- an example 'api only' assembly. This is not
application specific, it merely contains a shared API used by one or more
applications.
Infocus.ApplicationName.Services <-- server-side assembly that provides
services specific to an application.
Infocus.Services <-- more generalized server-side assembly that provides
services specific to no application.
Infocus.Forms <-- Similar to System.Windows.Forms, it contains Components,
Controls submnamespaces and the root contains basic Form subclasses.
We do not create namespaces specific to content, for example, if we subclass
a grid component we don't go and create an assembly or new namespace, it
would automatically find itself in a more general namespace such as
"Infocus.Forms.Controls" with an obvious name like "UltraGridSubclass".
Also, I've found it helpful to make use of default root namespaces
cross-assembly. For example, consider I wrote my own browser, i might have
these three assemblies:
Infocus.Browser.dll
Infocus.Browser.Shared.dll
Infocus.Browser.Services.dll
Infocus.Browser would be a common namespace, this means that in all 3 dll's
ALL components by default are located at Infocus.Browser.*
Shared and Services libraries both have a subnamespace defined as
Infocus.Browser.Services, the shared lib contains interface definitions,
whereas the service lib contains the implementation code that runs at the
server.
Hope that helps,
SEWilson
----- Original Message -----
From: "M Shafaat" <po***@comhem.se>
Newsgroups: microsoft.public.dotnet.languages.csharp
Sent: Friday, April 01, 2005 11:36 AM
Subject: How to organise namespaces
Hi,
I want to develop a number of generic components which I intend to use in
different applications. Is it a good idea to put all these generic
components in one and the same namespace, e.g. named GenApplCtrls, without
any regard to whether or not the components have any functionality in
common?
Which principles should be considered when deciding which classes to
belong to a namespace?
Regards
M Shafaat