Imagine I have the following namespace structure:
- components
--- x
----- [MyComponent]
----- [YourComponent]
--- y
----- [MyComponent]
----- [YourComponent]
MyComponent
and YourComponent
are classes within the x
and y
namespaces.
My understanding was that I would be able to access the desired class by using components;
and accessing them via x.MyComponent
and y.MyComponent
. This however doesn't seem to be the case, and I have to use the longer namespace name: components.x.MyComponent
.
Is there a solution that would allow me to use the next immediate namespace in the hierarchy (e.g. x
or y
) to distinguish between the classes, rather than a 'full' or 'longer' namespace name (e.g. component.x
and components.y
)?
PS: I'm aware of the issues around class name sharing
Edit: Apologies, I'd like to know if there's a solution that doesn't require using aliases (if possible) unless it provides a workaround that allows me to specify x.MyComponent