Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are ReadSelfAction and ReadStructuralFeatureAction?

Shulou Source: shulou.com Published: 2022-06-01 03:38:29 10月01日 Update

This article mainly introduces "What is ReadSelfAction and ReadStructuralFeature Action". In daily operation, I believe many people have doubts about what ReadSelfAction and ReadStructuralFeature Action are. I have consulted all kinds of materials and sorted out simple and easy operation methods. I hope to help you answer the doubts of "What is ReadSelfAction and ReadStructuralFeature Action"! Next, please follow the small series to learn together!

Read SelfAction

ReadSelfAction is an action that reads the host object of the action. Every action is ultimately part of an action. Behavior is attached to the entity of a method in a manner consistent with the specification of a category, and when the behavior is executed, the action acts in the context of a specified host object of the category. ReadSelfAction takes this host object and places it on the output pin.

Read StructuralFeature Action

ReadStructuralFeature Action is an action to get a structural feature value.

It has an input pin that specifies the input object. When an input object is specified, the value of the structural property of that object is placed on the output pin of the action. The type, order, and multiplicity of output pins should be appropriate to the structural characteristics.

example

Continue with the example of solving a quadratic equation in one variable. First look at the class diagram.

CalculateCoordinator manages instances of Calculator and CalculatorPanel. In calculateMain method, first call CalculatorPanel's getInput method to obtain the three coefficients a,b and c of the quadratic equation, and then call Calculator's solveEquation method to solve the equation. Today, I first asked for methods to get calculator objects and panel objects.

preparations

Create an activity diagram named CalculateCoordinator::calcuateMain

Add initial node

Add AcceptCallAction and specify Trigger as CalcuateCoordinator.calculateMain. Please refer to the previous article for specific steps.

Added ReadSelfAction, ReadStructuralCharacteriseAction

Drag the Action icon from the toolbar to the flowchart and select the Action type ReadSelf

Specify Action Name as Coordinator

Right-click to open the ReadSelfAction menu and select Structural Elements. In the dialog box that appears, select the result pin and adjust the position.

Connect AcceptCallAction and ReadSelfAction with control flow

Drag the Action icon from the toolbar to the flowchart and select the Action Type as ReadStructuralFeature

Specify Action Name as CalculateCoordinator

Modify the output pin named result, specify the name Calculator, select the type Calculator

Add an output pin named panel of type CalculatorPanel.

Right-click to open the ReadStructuralFeature Action menu and select Structural Elements. In the dialog box that appears, select all pins and adjust the position.

Connect the output pin of ReadSelfAction to the input pin of ReadStructuralAction object.

illustrates

ReadSelfAction is an action that reads the host object of CalculateCoordinator::calculateMain. When an action is executed, it works in the context of a host object of the CalculateCoordinator class. ReadSelfAction takes this host object and places it on the output pin. Do you understand? ReadSelfAction functions like this pointer in C++!

In this example, the input pin of ReadStructuralCharacteriseAction specifies an instance of CalculateCoordinator obtained by ReadSelfAction, and the values of the object's structural properties calculator: Calculator and panel: CalculateorPanel are placed on the output pin of the action. The type, order, and multiplicity of output pins should be appropriate to the structural characteristics. Still take C++ as an example, ReadStructuralFeature Action function is actually input object, output object data members!

At this point, the study of "What is ReadSelfAction and ReadStructuralFeature Action" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Tags: Object action output selection name host method type input structure structure feature behavior learning order univariate quadratic equation up and down position function function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei macOS Docker Shulou Information MariaDB