AndroidStudio可用的函数时序图生成插件 --- SequencePlugin

Refrence

https://vanco.github.io/SequencePlugin/

SequenceDiagram

SequenceDiagram for IntelliJ IDEA http://vanco.github.io/SequencePlugin.

with this plugin, you can

  • generate Simple Sequence Diagram.
  • Navigate the code by click the diagram shape.
  • Delete Class from diagram.
  • Export the diagram as image.
  • Export the diagram as PlantUML file.
  • Exclude classes from diagram by Settings > Tools > Sequence Diagram
  • Smart Interface(experimental)
  • Lambda Expression(experimental)

Experimental features

The experimental features are created by myself, which is not part of UML standard. Use this feature in your own risk.

Smart Interface

Find the implementation of the interface smartly. e.g.

public interface Fruit {
    int eat();
}

public class Apple implements Fruit {
    @Override
    public int eat() {
        return 5;
    }
}

Appleimplemented the Fruitinterface. When we generate sequence diagram for the eatFruit method:

public class People {
    
    private Fruit fruit = new Apple();

    public void eatFruit() {
        fruit.eat();
    }
}

I draw dummy implementation call in dash line.
https://vanco.github.io/SequencePlugin/imges/smart_interface.png
smart_interface
For the interface or abstract class, if there is only one implementation found, it will draw in diagram automatically. More than one implementations, you need to choose one to draw. this is an option in settings.

Lambda Expression

No standard for the lambda expression in the sequence diagram yet. So I create mine. e.g.

public interface Service<Int, String> {

    String invoke(Int a);
}

And I need draw the sequence diagram for hello method:

public class Lambda {

    public Service<Integer, String> hello() {
        return a -> {
            Fruit fruit = new Apple();
            fruit.eat();
            return "I'm good!";
        };
    }
}

I draw a dummy λ→ self call in diagram.
https://vanco.github.io/SequencePlugin/imges/lambda_expr.png
lambda_expr

How to use

SequenceDiagram ONLY generate sequence diagram for the CURRENT method of JAVA file in the editor.

When installed, where to find it?

  1. Open a JAVA file in editor.
  2. Navigate to one Method, which you want to generate sequence diagram. Place the caret inside Method name, (See the screenshot bellow)
  3. From the Tools > Sequence Diagram… menu.
    https://vanco.github.io/SequencePlugin/imges/tools_menu.png
    tools_menu
    https://vanco.github.io/SequencePlugin/imges/context_menu.png
    context_menu
    Place the caret inside the method name, trigger it from Tools menu or context menu > Sequence Diagram

Version History

Current Verison 2.0

versions: Changelog

Acknowledgement

Name history

  • SequencePlugin Maintained by Kentaur(Kesh Sibilev, ksibilve@yahoo.com) until 2011
  • SequencePluginReload Maintained by Vanhg(Evan Fan, fanhuagang@gmail.com) 2011 - 2015
  • SequenceDiagram Maintained by Vanco(Evan Fan, fanhuagang@gmail.com) since 2016

Why change name?

Since 2011, I found a solution of NPE of original SequencePlugin, so I write email to Kentaur with my solution, He said he was not coding any more. Instead, he send me the code. I fix the NPE issue and publish to plugin repository with new name SequencePluginReload.

But in 2015, the IntelliJ change the login system, and I lost my account, cannot continue publish new version to the repository.

In 2016, I change the Name again to SequenceDiagram and host the source code on github. Now it open source.

Thanks Kentaur for the great work on the original source.


编辑: 2021年7月26日。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值