[JAVA] Ideas for introducing symbols for OOP in flowcharts

There is a standard UML class diagram for drawing object-oriented programming (OOP), but I thought it would be easier to explain if there was a symbol for OOP when explaining the main flow. フローチャート上でのメソッド使用指示.png


First of all, the existing flow diagram symbols alone cannot capture the flow of OOP in the following points.

・ Limitations of OOP support for existing flow charts

  1. I don't know what I did for each instance in the main flow.
  2. I don't know if there is no return value (void) in the operation of each instance, or what is passed when there is a return value.
  3. I don't know what variables (properties) are prepared in the called object (abstract class) and what methods can be used.
  4. I don't understand the relationship between object (abstract class) inheritance and interface inheritance.

So I devised a symbol to represent the instance. The following figure is an instance of the calculator object in the article Introduction of window operation program for object-oriented programming experience made with VBS that was uploaded to qiita before. It is a diagram showing the conversion. 電卓クラスのインスタンス化の操作.PNG


The symbols used to represent the behavior of the instance on the main flow diagram are スライド1.PNG It becomes an expression like.


A flow chart that uses the symbols of this instance to express a simple process for operating two instances of a red calculator and a black calculator in cooperation with each other. 個々のインスタンスの操作を示す流れ図.png It will be shaped like.


The Java language code in the form of this flowchart

Dentaku2 AkaDentaku = new Dantaku2();
Dentaku2 KuroDantaku = new Dentaku2();
AkaDentaku.tasu(2.0);
KuroDentaku.tasu(5.0);
AkaDentaku.kakeru(4.0);
Double a = AkaDentaku.tasu(0.0));
a += KuroDentaku.tasu(0.0));
If (a >= 10.0)
        System.out.println("The answer of the red calculator"+ AkaDentaku.tasu(0.0));
Else
        System.out.println("The answer of the black calculator"+ KuroDentaku.tasu(0.0));

is.


In order to express it as a flow chart without disturbing the analysis of the main flow, I thought that it would be good to introduce a flow chart symbol for OOP.

I put the draw image of this instance symbol in the PowerPoint slide of "Object-oriented programming introductory kit 2". I will. You can use it when you want to incorporate it into your own flow chart.

Recommended Posts

Ideas for introducing symbols for OOP in flowcharts
Key points for introducing gRPC in Java
[For newcomers] Introducing JUnit