溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

EA畫UML活動(dòng)圖中Structural Feature Actions的示例分析

發(fā)布時(shí)間:2021-12-20 14:14:52 來源:億速云 閱讀:93 作者:小新 欄目:大數(shù)據(jù)

這篇文章主要介紹EA畫UML活動(dòng)圖中Structural Feature Actions的示例分析,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

16.8.1 Summary(概要)


StructuralFeatureActions support the reading and writing of StructuralFeatures.

結(jié)構(gòu)特征動(dòng)作支持讀寫結(jié)構(gòu)特征。

16.8.2 Abstract Syntax(抽象語法)

EA畫UML活動(dòng)圖中Structural Feature Actions的示例分析

16.8.3 Semantics(語義)


16.8.3.1 Structural Feature Actions(結(jié)構(gòu)特征動(dòng)作)


A StructuralFeatureAction is given a statically-specified StructuralFeature of a Classifier, and an object on which to act on its object InputPin. This object is either an instance (direct or indirect) of the Classifier that owns the StructuralFeature or, if the StructuralFeature is an ownedEnd of a binary Association, an instance of the type of the opposite end of the Association. If the StructuralFeature is an Association end, then a StructuralFeatureAction has the same semantics as a LinkAction on an Association that has the StructuralFeature as an end (see specializations of StructuralFeatureAction). The semantics are undefined if the StructuralFeature is not visible from the context Classifier of the StructuralFeatureAction or from the containing Behavior, if there is no context Classifier (see sub clause 16.2.3 about context objects), or if the StructuralFeature has isStatic=true.

結(jié)構(gòu)特征動(dòng)作有兩個(gè)輸入:靜態(tài)定義的類目的結(jié)構(gòu)特征和通過object輸入引腳指定的操作對(duì)象。這個(gè)對(duì)象可以是擁有結(jié)構(gòu)特征的類目的一個(gè)實(shí)例(直接或間接),如果結(jié)構(gòu)特征是是一個(gè)二元關(guān)聯(lián)的擁有者端,一個(gè)某種類型的實(shí)例位于關(guān)聯(lián)的反對(duì)端。如果結(jié)構(gòu)特征是一個(gè)關(guān)聯(lián)端,對(duì)于一端為結(jié)構(gòu)特征的關(guān)聯(lián)來說,結(jié)構(gòu)特征動(dòng)作和鏈接動(dòng)作具有相同的語義(參考結(jié)構(gòu)特征的特化)。下列情況下語義未定義:當(dāng)結(jié)構(gòu)特征在結(jié)構(gòu)特征的上下文類目中或者在包含它的動(dòng)作中不可見時(shí);如果不存在上下文類目或者結(jié)構(gòu)特征的isStatic屬性為true時(shí)。


The StructuralFeatures and Associations in which an object participates may change over time due to dynamic classification (see ReclassifyObjectAction in sub clause 16.4). However, the type of the object InputPin of a StructuralFeatureAction is a single Classifier, and the semantics are defined only when the object passed to the Action is classified by that Classifier (directly or indirectly) at the time the Action accepts it and while the Action is executing.The StructuralFeature is referenced from a StructuralFeatureAction as a model Element, so it is uniquely identified,even if there are other StructuralFeatures of the same name on other Classifiers.


因?yàn)閯?dòng)態(tài)分類,結(jié)構(gòu)特征和一個(gè)對(duì)象參與的關(guān)聯(lián)有可能隨著時(shí)間改變(參見16.4 小節(jié) ReclassfityObjectAction)。然而結(jié)構(gòu)特征動(dòng)作的object輸入引腳的類型是一個(gè)單獨(dú)的類目,而且它的語義只在動(dòng)作執(zhí)行時(shí)接受的對(duì)象是被這個(gè)類目分類的情況下才有意義。

A ReadStructuralFeatureAction reads the values of a StructuralFeature and places these values on its result OutputPin.The other kinds of StructuralFeatureActions, WriteStructuralFeatureActions (including AddStructuralFeatureValueActions and RemoveStructuralFeatureValueActions) and ClearStructuralFeatureActions modify the values of a StructuralFeature. These Actions may optionally have a result OutputPin. If a result OutputPin is provided, then the input object, as modified, is placed on this OutputPin. If the input object is a data value (an instance of a DataType), then a copy of the input data value is placed on the output pin, but with the appropriate structural feature modified. As a data value does not have an independent identity, the only way to obtain the modified data value is through the use of the result OutputPin.


讀結(jié)構(gòu)特征動(dòng)作讀取結(jié)構(gòu)特征的值并將這些值放到result輸出引腳上。其他種類的結(jié)構(gòu)特征動(dòng)作,寫結(jié)構(gòu)特征動(dòng)作(包括增加結(jié)構(gòu)特征值動(dòng)作和移除結(jié)構(gòu)特征值動(dòng)作)和清除結(jié)構(gòu)特征動(dòng)作會(huì)修改結(jié)構(gòu)特征。這些動(dòng)作可能會(huì)包含一個(gè)可選的result輸出引腳。如果存在這個(gè)輸出引腳,那么修改后的對(duì)象會(huì)被放到這個(gè)輸出引腳上。如果輸入對(duì)象是數(shù)據(jù)對(duì)象(某個(gè)DataType的實(shí)例),那么輸入數(shù)據(jù)的拷貝會(huì)被放到輸出引腳上,但是對(duì)應(yīng)的結(jié)構(gòu)特征被修改該過了。因?yàn)閿?shù)據(jù)值沒有獨(dú)立的識(shí)別信息,獲得修改后數(shù)據(jù)的唯一方法就是通過使用result輸出引腳。

16.8.3.2 Read Structural Feature Actions(讀結(jié)構(gòu)特征動(dòng)作)


A ReadStructuralFeatureAction is a StructuralFeatureAction that retrieves the values of a StructuralFeature and places them on its result OutputPin. If the StructuralFeature is ordered, then the values are placed on the OutputPin in order. If the StructuralFeature is an Association end, the semantics are the same as a ReadLinkAction with the StructuralFeature as the open end (see sub clause 16.6). If there are no retrieved values (that is, the StructuralFeature is empty), then a ReadStructuralFeatureAction produces a single null token on its result OutputPin.

讀結(jié)構(gòu)特征動(dòng)作讀取結(jié)構(gòu)特征的值并將它們放到result輸出引腳上。如果結(jié)構(gòu)特征是有序的,那么放到輸出引腳上的值也是有序的。如果結(jié)構(gòu)特征是一個(gè)關(guān)聯(lián)端,那么它的語義和讀鏈接動(dòng)作在以結(jié)構(gòu)特征為開放端(參見16.6小節(jié))時(shí)一樣。如果沒有取到值(也就是說結(jié)構(gòu)特征為空),讀結(jié)構(gòu)特征動(dòng)作會(huì)在result輸出引腳上生成一個(gè)空令牌。

The type and ordering of the result OutputPin are the same as those of the StructuralFeature. The multiplicity of the StructuralFeature must be compatible with the multiplicity of the result OutputPin, but does not have to be the same. For example, the modeler can set the multiplicity of this OutputPin to support multiple values even when the StructuralFeature only allows a single value (this way, the ReadStructuralFeatureAction as modeled will be unaffected by changes in the multiplicity of the StructuralFeature).

result輸出引腳的類型和有序性和結(jié)構(gòu)特征保持一致。結(jié)構(gòu)特征的多重度必須和result輸出引腳的多重度兼容。例如,建模者可以設(shè)定輸出引腳的多重度以支持多值,即使結(jié)構(gòu)特征只支持單值(這樣建模得到的讀結(jié)構(gòu)特征動(dòng)作就不會(huì)受到結(jié)構(gòu)特征多重度變化的影響)

16.8.3.3 Add Structural Feature Value Actions(增加結(jié)構(gòu)特征值動(dòng)作)

An AddStructuralFeatureValueAction is a StructuralFeatureAction for adding a value to a StructuralFeature of an object. The value to be added is given on the value InputPin, which is required. This InputPin has the same type as the
StructuralFeature and a multiplicity of 1..1 (that is, a single value is added). If the StructuralFeature is an Association end, the semantics are the same as for a CreateLinkAction (see sub clause 16.6), where the participants in the link are the object being acted on and the new value.

增加結(jié)構(gòu)特征值動(dòng)作向一個(gè)對(duì)象的結(jié)構(gòu)特征增加一個(gè)值。增加的值通過value輸入引腳傳遞,而這個(gè)引腳是必需的。這個(gè)輸入引腳和結(jié)構(gòu)特征具有相同的類型,多重都為1..1(也就是說增加的是單值)。如果結(jié)構(gòu)特征是一個(gè)關(guān)聯(lián)端,增加結(jié)構(gòu)特征值的語義和生成鏈接動(dòng)作(參見16.6小節(jié))相同。這里鏈接的參與者是操作的目的對(duì)象和新值。

If isReplaceAll is true, then the existing values of the StructuralFeature are removed before the new value is added, except if the StructuralFeature already contains the new value, in which case it is not removed under this option. The
StructuralFeature always has a single value when the Action completes, even if the lower multiplicity of the StructuralFeature is greater than 1. If isReplaceAll is false and the StructuralFeature is unordered and unique, then adding a value that is already contained in the StructuralFeature has no effect.

如果isRelaceAll為真,在新值被增加到結(jié)構(gòu)特征之前,已經(jīng)存在的值會(huì)被移除。除非結(jié)構(gòu)特征已經(jīng)包含這個(gè)新值,在這種情況下它不會(huì)受這個(gè)選項(xiàng)的影響而被移除。當(dāng)動(dòng)作結(jié)束時(shí),結(jié)構(gòu)特征總是保有一個(gè)唯一的值,哪怕結(jié)構(gòu)特征的多重度大于1。如果isReplace為假且結(jié)構(gòu)特征是無序和不允許重復(fù)的,增加一個(gè)已經(jīng)存在的值對(duì)結(jié)構(gòu)特征沒有影響。

Adding a value to an ordered StructuralFeature requires an insertion point for the new value given in the insertAt InputPin, which is required for ordered StructuralFeatures when isReplaceAll is false and omitted for unordered
StructuralFeatures.

向一個(gè)有序的結(jié)構(gòu)特征增加一個(gè)值需要通過insertAt輸入引腳提供插入點(diǎn)。這個(gè)輸入引腳在結(jié)構(gòu)特征有序而且isReplaceAll為假時(shí)有效,在結(jié)構(gòu)特征無序時(shí)被忽略。

NOTE. Values of StructuralFeatures may be ordered even if the upper multiplicity is 1.

注意:結(jié)構(gòu)特征的值在多重度上限為1時(shí)也可能是有序的。

If the insertAt InputPin is present, it has type UnlimitedNatural and multiplicity 1..1. An insertion point that is a positive integer less than or equal to the current number of values means to insert the new value at that position in the sequence of existing values, with the integer 1 meaning the new value will be first in the sequence. A value of unlimited (“*”) for the insertion point means to insert the new value at the end of the sequence. The semantics are undefined for a value of 0 or an integer greater than the number of existing values. Reinserting an existing value at a new position in an ordered, unique StructuralFeature moves the value to that position (this works because such StructuralFeature values are ordered sets). The insertion point is ignored if it is used when isReplaceAll=true.

如果存在insertAt輸入引腳,那么它的類型為無限自然數(shù),多重度為1..1。一個(gè)小于或等于值數(shù)目的正整數(shù)插入點(diǎn)意味著在已存在的值序列中插入值,而整數(shù)1意味著在序列的第一個(gè)位置插入。插入點(diǎn)為無限(”*“)意味著在序列的結(jié)尾插入值。0或者大于值數(shù)目的插入點(diǎn)值沒有定義。向一個(gè)有序的,不允許重復(fù)的結(jié)構(gòu)特征的新位置重新插入一個(gè)已有值的結(jié)果是將該值移動(dòng)到新位置(產(chǎn)生這個(gè)結(jié)果是因?yàn)榻Y(jié)構(gòu)特征的值是有序集合)。當(dāng)isReplaceAll為真時(shí),插入點(diǎn)會(huì)被忽略。

The semantics are undefined for adding a value that violates the upper multiplicity of the StructuralFeature, and for adding a new value to a StructuralFeature with isReadonly=true after initialization of the object that would have the
value.

超過結(jié)構(gòu)特征多重度的上限增加一個(gè)值或者對(duì)象初始化以后向它的只讀結(jié)構(gòu)特征增加值的語義都是無定義的。

16.8.3.4 Remove Structural Feature Value Actions(移除結(jié)構(gòu)功能值動(dòng)作)


A RemoveStructuralFeatureValueAction is a StructuralFeatureAction for removing a value from a StructuralFeature of an object. If the feature is an Association end, the semantics are the same as for DestroyLinkAction, where the participants in the link are the object and the value being removed.

移除結(jié)構(gòu)特征值動(dòng)作移除一個(gè)對(duì)象的結(jié)構(gòu)特征值。如果特征是一個(gè)關(guān)聯(lián)端,那么它的語義和鏈接的參與者為對(duì)象和移除目標(biāo)值時(shí)的銷毀鏈接動(dòng)作一樣。

Except as given below, the value to be removed is given on the value InputPin, which has the same type as the StructuralFeature and a multiplicity of 1..1. The value is removed even when this results in a violation of the lower
multiplicity of the StructuralFeature. Removing a value that is not contained in the StructuralFeature has no effect. The isRemoveDuplicates option indicates whether to remove all duplicates of the specified value in non-unique StructuralFeatures.

除了后面給出的情況,移除目標(biāo)值都是通過value輸入引腳給定的。它的類型和結(jié)構(gòu)特征相同,多重度為1..1。即使結(jié)果會(huì)導(dǎo)致違反結(jié)果特征的多重度下限要求,值還是會(huì)被移除。移除一個(gè)沒有包含在結(jié)構(gòu)特征中的值不會(huì)造成影響。isRemoveDulicates選項(xiàng)表明是否移除允許重復(fù)的結(jié)構(gòu)特征中所有的重復(fù)值。

If isRemoveDuplicates is false and the StructuralFeature is ordered and non-unique, then there is no value InputPin, and the value to be removed is instead specified by giving its position on the removeAt InputPin, which has type
UnlimitedNatural and a multiplicity of 1..1. A removal position that is a positive integer less than or equal to the current number of values means to remove the value at that position in the sequence of existing values, with the integer 1
meaning the first value in the sequence. The semantics are undefined for 0, an integer greater than the number of existing values, and unlimited (“*”).

如果isRemoveDuplicates為假,結(jié)構(gòu)特征有序且允許重復(fù)值,那么就不需要value輸入引腳,作為代替手段,移除對(duì)象是通過removeAt輸入引腳傳遞的位置決定的。removeAt引腳的類型為無限自然數(shù),多重度為1..1。小于或等于當(dāng)前值數(shù)目的移除點(diǎn)意味著從已有值系列中移除值,這里整數(shù)1的意義是序列的第一個(gè)位置。0,大于已有值數(shù)目的整數(shù)和無限(“*”)的語義無定義。

The semantics are undefined for removing an existing value of a StructuralFeature with readOnly=true after initialization of the owning object.

當(dāng)擁有它的對(duì)象初始化以后,從一個(gè)readOnly為true的結(jié)構(gòu)特種移除已有值的語義無定義。

16.8.3.5 Clear Structural Feature Actions(清除結(jié)構(gòu)特征動(dòng)作)


A ClearStructuralFeatureAction is a StructuralFeatureAction that removes all values of a StructuralFeature, even if lower multiplicity of the StructuralFeature is greater than 0. The action has no effect if the StructuralFeature has no
values. If the StructuralFeature is an Association end, the semantics are the same as for a ClearAssociationAction on the given object.

清除結(jié)構(gòu)特征動(dòng)作移除結(jié)構(gòu)特征的全部的值,哪怕結(jié)構(gòu)特征的下限大于0。當(dāng)結(jié)構(gòu)特征不包含值時(shí),動(dòng)作不產(chǎn)生影響。如果結(jié)構(gòu)特征是一個(gè)關(guān)聯(lián)端,清除結(jié)構(gòu)特征動(dòng)作的語義和對(duì)給定對(duì)象調(diào)用清除關(guān)聯(lián)動(dòng)作相同。

The semantics are undefined for a StructuralFeature with isReadOnly = true after initialization of the object owning the StructuralFeature, unless the StructuralFeature has no values.

當(dāng)擁有結(jié)構(gòu)特征的對(duì)象被初始化以后,對(duì)isReadOnly為true的結(jié)構(gòu)特征調(diào)用清除結(jié)構(gòu)特征動(dòng)作的語義無定義,除非這個(gè)結(jié)構(gòu)特征不包含值。

以上是“EA畫UML活動(dòng)圖中Structural Feature Actions的示例分析”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI