Naming diagrams in in project is not strict enough
mrpetro opened this issue · 2 comments
mrpetro commented
Currently its possible to create or rename two or more diagrams having same type and same name under one project.
This may lead to odd behavior while code generation
There is also problem with using white characters and nonstandard characters in diagram names, since the diagram names are used in RootNamespace generation and the RootNamespace is used in code generation, which leads to bad code generation.
Two things can be done here:
- Restrict naming/renaming diagrams to use only characters allowed in namespace naming of C# and/or Java
- Separate Namespace as a Diagram setting which could be auto filled (and validated) on diagram naming (and then changed as an diagram property.)
gbaychev commented
- Absolutely. Also everything used for code generation should be validated as well (e.g. Class names, etc.)
- In general I agree that we should decouple the namespace from the diagram name, but also theoretically is also possible that you can have more than one namespace/package per diagram. What do you think about it?
mrpetro commented
- Yes, that's absolutely fine, because this is what UML Packages are for, a containers for other types. And also I think that Class Diagram itself can be treated as sort of "root" package where other packages can be nested.
OK, so are base assumption is that one UML Class Diagram is equivalent of C# Project, and each C# project has its assembly default namespace. And this can be set to something different than the {Solution}.{C#Project} name.