SYSML中的多态性
目前,我正在尝试设计可执行活动的活动,其中逻辑组件将请求发送给其他几个逻辑组件以开始初始化。活动图的通常方法是为每个街区创建一个游泳线。但是,由于LC的数量很高,在这种情况下,该图将非常大,后来其修改将是一个障碍。
在编程中,解决此问题的解决方案是多态性,其中将对象施放为母班并将其推入向量,然后在循环中,称为母类的抽象功能。
我想知道SYSML中是否有类似的解决方案?
我试图将一个游泳线分配给收到请求的所有LCS,但似乎每个游泳线只能分配给一个块。
currently i am trying to design an executable activity where a logical component send a request to several other logical components to start initialization. The usual way in activity diagram is to create for each block a swimline. But, as the number of LCs are high in this case the diagram will be extremely big and also later its modification will be a hurdle.
In programming, the solution to this problem is polymorphism where the objects are casted as the mother class and pushed into a vector and then within the loop the abstract function of the mother class is called.
I wonder if there is any similar solution to this problem in sysml or not?
I tried to assign one swimline to the all the LCs which recevie the request but it seems each swimline can only be assigned to a block.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,也有类似的解决方案。实际上,这甚至更容易。只需让ActivTypartition代表具有大于1的属性即可。该分区中的任何InvocationAction都意味着对本属性中所有实例的同时调用。
UML规范对此说:
典型的调用actactions是呼叫和发送标志性。因此,您可以在代表属性
mylogicalComponents的分区中调用
。initialize()
操作:lc [1 ..*]如果您尚未定义此类属性,则可以通过使其成为派生的联合来得出它,然后将所有现有属性定义为以其为子集初始化的组件的所有现有属性:
当然,假设您所有的逻辑组件都正在专门化
lc
,以便它们都继承并重新定义initialize()
操作。在SYSML中,您还具有分配分区。没有描述清晰的语义,因此我认为您最好与UML Activity分区一起使用,这些活动也包含在SYSML中。
Yes, there is a similar solution. Actually, it is even easier. Just let the ActivtyPartition represent a property with a multiplicity greater than 1. Any InvocationAction in this partition will then mean a concurrent invocation on all instances held in this property.
The UML specification says about this:
Typical InvocationActions are CallActions and SendSignalActions. So, you could call the
initialize()
operation in a partition representing the propertymyLogicalComponents:LC[1..*]
.If you don't already have defined such a property, you can derive it, by making it a derived union and then define all existing properties with components to be initialized as subsets of it:
Of course, this assumes, that all your logical components are specializing
LC
, so that they all inherit and redefine theinitialize()
operation.In SysML you also have AllocateActivityPartitions. No clear semantics is described for it, so I think you are better served with the UML ActivityPartitions, which are also included in SysML.