plantuml-generator icon indicating copy to clipboard operation
plantuml-generator copied to clipboard

Does it support branching with if else?

Open chenhaoqiang opened this issue 3 months ago • 4 comments

Can a sequence diagram present the logical flow of if else? It will make it look clearer. Thank you for providing such a great plugin!

chenhaoqiang avatar Apr 01 '24 12:04 chenhaoqiang

Sorry for the delayed answer. Logical structures such as if/else are not currently supported in the sequence diagram. Since the currently used library javassist for analyzing the control-flow makes this somewhat difficult, I would have to take a look at other libraries such as asm or similar in this regard. So I can't say at the moment when such functionality will be available.

devlauer avatar Apr 07 '24 19:04 devlauer

Sorry for the delayed answer.

Logical structures such as if/else are not currently supported in the sequence diagram. Since the currently used library javassist for analyzing the control-flow makes this somewhat difficult, I would have to take a look at other libraries such as asm or similar in this regard. So I can't say at the moment when such functionality will be available.

Thank you for your response! I would really appreciate having this feature to achieve the goal of code as documentation. I know there is a library called javaparser (https://github.com/javaparser/javaparser), and I'm wondering if it can be helpful to you? Additionally, I would like to display method comments in sequence diagrams instead of directly using method names, and I hope this can be a configurable option. As far as I know, the javaparser library is capable of parsing comments. Thank you again for your efforts!

chenhaoqiang avatar Apr 08 '24 12:04 chenhaoqiang

Bytecode is currently used for sequence analysis, as this offers greater flexibility, even across library boundaries. This would be different with JavaParser as far as I can see at first glance. But I'll take a closer look at it when I get the chance to see whether I can implement it as desired. Unfortunately, I only have very little time at the moment, so it will probably take some time.

devlauer avatar Apr 14 '24 16:04 devlauer

Bytecode is currently used for sequence analysis, as this offers greater flexibility, even across library boundaries. This would be different with JavaParser as far as I can see at first glance. But I'll take a closer look at it when I get the chance to see whether I can implement it as desired. Unfortunately, I only have very little time at the moment, so it will probably take some time.

Thank you for your reply. I'm really excited about this feature! Please plan and develop this functionality at your own pace.

chenhaoqiang avatar Apr 14 '24 17:04 chenhaoqiang