I'm working on a project to bring in existing code to model and refactor. I'm mostly interested in the structural model.
The source code (C/C++) structure is translated to TextUML and them imported into a UML editor/modeler.
The issue I'm having is that nested classes are not supported. Flattening a nested class is time consuming and not realistic, given
the number of lines of code I'm working with. I've tried writing code to auto-flatten the class, but there too many issues to do this
cleanly. UML does support nested classes. While I understand the undesirability of nesting a class, having this capability supported would save a great deal of time and effort.
Examples I'm looking to support (based on real C/C++ code):
- Simple 'typedef'.
import mdd_types;
class beta
attribute prime : Integer;
end;
class foo
class myType specializes some_other_type;
attribute something_special : String;
end;
attribute alpha : myType;
end;
- Nested enumeration.
class bar
enumeration DeviceState
ON;
OFF;
end;
attribute power_switch : DeviceState;
end;
While these are simple examples, the code base is more complex.
I'm working on a project to bring in existing code to model and refactor. I'm mostly interested in the structural model.
The source code (C/C++) structure is translated to TextUML and them imported into a UML editor/modeler.
The issue I'm having is that nested classes are not supported. Flattening a nested class is time consuming and not realistic, given
the number of lines of code I'm working with. I've tried writing code to auto-flatten the class, but there too many issues to do this
cleanly. UML does support nested classes. While I understand the undesirability of nesting a class, having this capability supported would save a great deal of time and effort.
Examples I'm looking to support (based on real C/C++ code):
While these are simple examples, the code base is more complex.