naming conventions - What should I do if I have the same class name on different namespaces? -


I am working on a project and I have come to the following naming issue .

I want to apply the factory pattern but I do not have to use the names of the best class (I am changing from one to the other and it takes a lot of time: s).

I usually go to namespaces to separate groups of classes, but my problem is with this special code:

  square aries {...}; Name Location Factory {Class Aries {...}; } ... factory :: trap netfactor; Aries * Trap = Arbitrage Make (...);  

My problem is that if I use this structure then I can mix mesh classes (whether factory square or actual mesh class). Actually, this is a simplification, my problem involves some other namespace and those classes are used in both names.

I was thinking of using suffix to isolate and separate classes, for example the same name space:

  class mesh {... }; Square MeshFactory {...}; MeshFattery Mesphacator; Aries * Trap = Arbitrage Make (...);  

So there is no confusion on what each class does.

I do not like the simple solution that is to use different namespaces and to invent different names, because I should separate them using the namespace name:

  square aries {...}; Nameshot Factory {class MeshFactory / I can not understand a better different name {...}; }  

I like the second option.

Is there any solid reason that the first option is to improve? Is there any other way? What do the best practices say about this?

What are the reasons why you got the name of Aries class "Aries"?

Does the factory class produce the mesh example, all share the same reasons?

If this happens, then they should have the same name with the same name.

If it is not, then they should have different classes with different names.

Since it is likely that they are the only one purpose of the factory class, examples of Aries class, I suggest you give it the name meshfactry.

The namespace is not relevant.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -