bafolts / tplant

Typescript to plantuml
https://segmentationfaults.com/tplant/default.html
GNU General Public License v3.0
270 stars 35 forks source link

Missing Aggregation/Composition feature #48

Closed ThePlenkov closed 2 years ago

ThePlenkov commented 4 years ago

Hi! First of all I would like to express great admire to this idea.

It's so simple and implementation is perfect.

However I would like to have some feature which I wish to have in my diagram.

Sometimes we have classes which have instances of another classes. So it's not inheritance but another way of relationship.

How about the idea to invent pseudo comment (may be TSDoc) in ts file declaring that a specific attribute is a relationship in fact: aggregation or composition? Or at least by default all kinds of attributes with references to interfaces/classes include with aggregation by default?

Thank you!

iiian commented 4 years ago

Agree, would also like this feature. Any suggestions on how to contribute?

bafolts commented 4 years ago

If you were to invent some comment tag it should be straight forward to parse that tag. Would something similar to:

@aggregates Class1, Class2, Class3

work easy enough?

esmiralha commented 3 years ago

I believe this should work without a comment or decorator. Inspect the members of the class and create relationships for those who point to user-defined types (classes, interfaces, etc.).