Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling auto-generated method -- Refactoring JavaClassGenerator #1529

gublan24 opened this issue Feb 13, 2020 · 0 comments

Disabling auto-generated method -- Refactoring JavaClassGenerator #1529

gublan24 opened this issue Feb 13, 2020 · 0 comments


Copy link

@gublan24 gublan24 commented Feb 13, 2020

Several templates in UmpleToJava/UmpleTLTemplates do business logic such as generating class constructors, getters and setters. Let's take class attributes as an example:
In JavaClassGenerator, the "private String getAttributeCode( ...)" in JavaClassGenerator.ump loops through attributes and write out their get methods and set methods to string output.

This is not the ideal case. A generators in Umple should be lightweight. It should translate UmpleModel to a target language.

The business logic in generators should be refactored and moved to UmpleInternalPraser. Therefore, UmpleModel should contain all auto-generated methods after parsing.

Although currently some logic such as obtaining constructors, getters and setters of class attributes are represented (added) in UmpleClass model after parsing, they have nothing to do with the generated code. The (Java) generator will produce constructors, setters and getters again (regardless of what UmpleClass model contains).

Disabling auto-generated methods is not possible after parsing (at current state). A refactoring of the generator code is a per-request step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.