[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [RFC] Solid and use of namespaces
From: Hans Meine <hans_meine () gmx ! net>
Date: 2006-05-23 15:33:59
Message-ID: 200605231734.00058.hans_meine () gmx ! net
[Download RAW message or body]
On Sunday 21 May 2006 13:18, Krzysztof Lichota wrote:
> Definitely "PowerManager". Using generic names ("Manager") makes it
> harder to grep for name, replace it with other, find it using filtering
> by class names, etc.
AFAICS, one can combine the advantages of namespaces (grouping together what
belongs together) with the advantage of grep'ability by just sticking to
// only use Solid::Power here if your whole .cpp is about Power stuff:
using namespace Solid;
Power::Manager man;
man.foo();
...
Yes, I see that this could break _all.cpps.
Note that it's also possible to create special namespaces for "using" them:
namespace PowerNS
{
typedef Power::Battery Battery;
typedef Power::UPS UPS;
...
// prefix only the too general term(s):
typedef Power::Manager PowerManager;
};
ALAS, this introduces slight redundancies, especially with enum values etc.
Ciao, / /
/--/
/ / ANS
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic