hallvard / plantuml

Embed UML diagrams in files and view them in Eclipse
http://plantuml.sourceforge.net/
209 stars 57 forks source link

Generate associations for methods #97

Closed dpolivaev closed 3 years ago

dpolivaev commented 4 years ago

Currently associations are generated only for fields. It is not enough.

If I use java annotation processors to generate value objects for given interfaces, all properties are declared as methods (see e.g. https://immutables.github.io/) For methods associations are not generated by the plantuml plugin.

I think that generation associations for method arguments and return types could be also useful in other cases because even if it were a class, the association would indicate a dependency. May be generating associations for class and interface methods could be made optional.

I would like to contribute a pull request, but unfortunately I do not understand how to load the project in eclipse and how to run a build. Neither eclipse project files nor pom files available in the repository contain references to the sources. So if you could help me to get working development environment I could contribute some code to your project.

dpolivaev commented 4 years ago

Code example:

package elements;
import java.util.List;

interface Element {
}

interface Elements {
    List<Element> elements();
}
hallvard commented 4 years ago

This sounds like something that could correspond to a derived association (end). A derived feature har a slash prepended to the name, e.g. /elements.

dpolivaev commented 4 years ago

In my particular use case, where interface is used to define value objects I would rather see it as a aggregation or composition and prefer a solid line because here Elements really contain the list of Element objects. But even the representation with the dashed line could be helpful to see the dependency graph.

dpolivaev commented 4 years ago

Could you please tell me how to run the build? If I go to bundles directory and run mvn clean verify no code is compiled and no jar files are generated.

hallvard commented 4 years ago

The project is structured according to Eclipse conventions, where the build is run from the releng/aggregator project.

dpolivaev commented 4 years ago

Many thanks, you gave me the missing link.

dpolivaev commented 4 years ago

https://github.com/hallvard/plantuml/pull/98