From kde-core-devel Tue May 23 15:33:59 2006 From: Hans Meine Date: Tue, 23 May 2006 15:33:59 +0000 To: kde-core-devel Subject: Re: [RFC] Solid and use of namespaces Message-Id: <200605231734.00058.hans_meine () gmx ! net> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=114839847200684 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