Is probably worth understanding these things rather than trying to
back out meaning from the current rather confused situation.
see: http://en.wikipedia.org/wiki/Namespace_(computer_science)
Namespaces therefore form a key part of the contract between the user
and the service - i.e. they are external identifiers by which
FeatureType or layerName etc is mutually understood by the server and
the client.
If you have no actual agreement with the user, then namespaces should
be based on the truth: the should be an arbirtrary looking sequence
number or something. If you publish them (make them visible to a
client) then they should be stable - you become the external authority
for the namespace.
Thus, the namespace should not be automatically derived from anything
that might change : database name, datastore config, datastore
technology, layer name, grouping of data within a particular service
instance.
You ought to be able to deliver a data product from a properties file
in prototype, then deliver the same namespace+layer name from a
PostGIS datastore, then a DB on a different machine, then from a
cached remote WFS, etc without the namespace changing.
Also, much of the metadata that goes with the use of the namespace (if
its externally defined) ought to be able to be imported rather than
manually re-typed in a clunky UI or config files.
Rob A