Re: Same namespace, different files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Richard Myers (richard.spam-free.myers_at_basd.co.nz)
Date: 07/04/04


Date: Sun, 4 Jul 2004 19:01:15 +1200

If they are in the same assembly you can drop the namespace reference.

SomeClassA.MethodA()

You SHOULD have different classes in different files.
Any other form of organisation, except with nested classes obviously, is not
considered best practise.

Something else you might check is in the Project settings. Make sure you
have removed the implicit default namespace from the textbox that says
"Namespace".

Otherwise the effective namespace will be a union of this implicit project
parameter and that which you have defined explicitly in the class....

i.e Possibly you cannot get a reference to MethodA because it's actually
fully qualified as

SomeNamespace.Somenamespace.SomeClassA.MethodA().

The union of the implicit and explicit namespace declarations.
So basically dont combine explicit and implicit namespacing in your
classes... standardise on one or the other....and I'd recommend explicit.

hth
Richard



Relevant Pages

  • Re: Network namespaces a path to mergable code.
    ... So I think the abstraction that we use to access per network namespace ... Returning to implicit vs explicit function arguments, ... term we want a configuration option. ...
    (Linux-Kernel)
  • Re: I really hate .NET especially inside Delphi
    ... The question answers itself - you can't preserve the implicit make ... Since all the tooling around the language is predicated on ... packages, maybe, just maybe a move to explicit make logic would work. ... I can put that class in the namespace it logically belongs in, ...
    (borland.public.delphi.non-technical)
  • Re: Puzzling OO design problem
    ... > since you explicit allowed metaprogramming hacks :-), ... from version_1 import Namespace as PreviousNamespace ... George ...
    (comp.lang.python)
  • Re: Network namespaces a path to mergable code.
    ... patches just introducing namespaces for sockets in 2 ways: ... function parameters and using implicit current context. ... So I think the abstraction that we use to access per network namespace ... The explicit versus implicit lookup is just ...
    (Linux-Kernel)
  • Re: Designer generated code fails to compile
    ... I can tell you that you cannot get the tool to change it spots. ... is explicit should not matter. ... which is in this default namespace. ... How do I stop the designer from setting the namespace explicitly. ...
    (microsoft.public.dotnet.framework.adonet)