jfeliu007 / goplantuml

PlantUML Class Diagram Generator for golang projects
MIT License
1.78k stars 167 forks source link

Some changes in connections #111

Open tombenke opened 3 years ago

tombenke commented 3 years ago

Dear Javier,

  1. I think the counterpart of inheritance in golang is the embedding of structures, so in case of the extends relation the current connection is not correct in my opinion. Either the *-- should point to the opposite direction or it's even better to use the <|-- relation instead.

  2. In case of interfaces the implements relation should be noted with the dotted line, instead of the solid one.

So, I would like to kindly ask you to accept and approve these two changes in the generated notations:

I also added a go.mod file to the repo:

Best Regards, Tamás Benke

jfeliu007 commented 3 years ago

Thanks, @tombenke for your suggestion. Let me take a look at this to see how it changes the definitions. In any case, this PR is failing tests because it changes how relations are rendered. If I ultimately agree with you on this change, we need to have a PR that does not break the testing of the packages.

codecov[bot] commented 3 years ago

Codecov Report

Merging #111 (c0fda4d) into master (2adf2cf) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head c0fda4d differs from pull request most recent head 13c6c11. Consider uploading reports for the commit 13c6c11 to get more accurate results

@@            Coverage Diff             @@
##            master      #111    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            5         5            
  Lines          625       510   -115     
==========================================
- Hits           625       510   -115     
Impacted Files Coverage Δ
parser/class_parser.go 100.00% <100.00%> (ø)
parser/alias.go 100.00% <0.00%> (ø)
parser/field.go 100.00% <0.00%> (ø)
parser/struct.go 100.00% <0.00%> (ø)
parser/function.go 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

tombenke commented 3 years ago

Sorry, I forgot to change the test cases, now I have fixed them, hopefully I made it well. Anyway, what about using GitHub actions instead of Travis?

fractalqb commented 2 years ago

Dear Javier,

1. I think the counterpart of inheritance in golang is the embedding of structures, so in case of the extends relation the current connection is not correct in my opinion. Either the `*--` should point to the opposite direction or it's even better to use the `<|--` relation instead.

[…]

Sorry, but I have to disagree. Inheritance has something to do with the substitution principle, i.e. everywhere where a baseclass is required a derived class can be passed. For Go struct + embedding this is simply not the case. IMHO Go only has interface inheritance, i.e. embedding of interfaces – and that's it.

Embedding of struct only is some syntactical sugar that makes addressing of fields somewhat less verbose. But I don't see a real correspondence to UML concepts.