Questions tagged [namespace]
Namespaces are a language feature of many programming languages, allowing local reuse of class and variable names.
98 questions
-2
votes
1
answer
257
views
What is a component in C#?
Introduction
Components are an important building block of software. In terms of software architecture, there are a lot of principles regarding components that should be adhered to (high cohesion, low ...
3
votes
3
answers
2k
views
C++ Is it okay to use nested classes as a way to namespace derived classes?
I have many abstract classes that describe many abstract ideas and objects. These classes have many complex relationships with each other, and I realize that while writing code with some of the ...
3
votes
3
answers
3k
views
Why would you have a different namespace for each folder in a C# project?
I can't see how having a namespace for each folder makes sense. As near as I can tell, the point of having namespaces is to avoid name conflicts. But, Microsoft, in their namespace naming conventions, ...
0
votes
1
answer
3k
views
aliases for namespaces in headers?
Everytime I write a header I end up doing something like this:
#ifndef D723E2D5_1943_4166_87CC_73F5C9C47544
#define D723E2D5_1943_4166_87CC_73F5C9C47544
#include "RandomIntegers.hpp"
...
#...
1
vote
1
answer
1k
views
Namespace hierarchy in C#
I have a C# class library shared among several applications. The library is divided into a few smaller components which have dependencies shown in the picture below. Each component is placed in its ...
0
votes
0
answers
475
views
Is it a bad practice to have a class with a namespace that goes "out" of it's project name?
I have a solution with multiple projects, lets suppose there's one project with the name Company.Name.Foo.Bar.
If I declare a class inside the project Company.Name.Foo.Bar but with a namespace Company....
1
vote
1
answer
551
views
Is it a good practice to have XML document with no-namespace elements in the middle
I have an XML looking like this:
<?xml version="1.0" encoding="utf-8"?>
<n0:OrderConfirmation xmlns:n0="http://company.org/interface/MVSI"
xmlns:ord="...
0
votes
3
answers
606
views
Using the symbol ⎋ to denote any "escape" in Javascript, CSS, HTML etc
I know that:
Computer keyboards have an Escape Key
The symbol for the Escape Key is U+238B Broken Circle with Northwest Arrow (⎋)
and I also know that:
HTML5 & CSS3 both have escape characters
...
3
votes
3
answers
1k
views
Are namespace constructs like 'using std::string' unacceptable also in .cpp files?
I understand the rationale of avoiding using namespace std - this defines too many casual names the developer may not be even aware of.
I tried to work around the problem with the help of using ...
3
votes
2
answers
334
views
Am I using namespaces wrong?
I'm obsessed with organization - it's probably the real reason why I enjoy coding. So I namespace everything. But I'm just curious if I'm doing it wrong by being redundant.
Consider this, which I ...
3
votes
2
answers
550
views
Should I use other framework's namespaces in my code?
I'm writing some tools to be used on the top a specific framework, in C#.
Most of my code should use the naming convention CompanyName.TechnologyName[.Feature][.Design], but I wonder if in some cases ...
4
votes
2
answers
2k
views
How can I cleanly handle deeply nested namespaces in C++?
The first language that I truly learned was Java. In it, it is very syntactically easy to nest classes in an essentially arbitrarily complex package hierarchy, which keeps the code organized. It is ...
1
vote
0
answers
184
views
Can/should multiple application contexts share a common microservice in a single namespace?
My current employer has a single namespace into which all microservices for all projects are deployed.
Projects A, B and C all use microservice x in this common namespace:
Rather than each design and ...
3
votes
2
answers
2k
views
Refactor namespaces in a library while keeping backwards-compatibility
We developed a generic .NET library for our line-of business applications. This is what our namespace/class structure looked like 5 years ago:
...
AcmeCorp.Tools.ExcelWriter
AcmeCorp.Tools....
0
votes
2
answers
283
views
When no other class ever needs to touch the (nested) class - should I always make it a (private) nested class?
And what is the recommended file structure?
The question is a bit similar to this one, but I'm looking for more explicit recommendations.
In theory I think it's a good concept to keep files short ...