简体   繁体   English

如何将分析模式中的动作解释为序列图?

[英]How can I interpret to a sequence diagram an action from an Analysis Pattern?

Based on the Accountability Analysis Pattern:基于责任分析模式:

在此处输入图像描述

The concept is that we have a class diagram following the logic of the Accountability Analysis Pattern.这个概念是我们有一个遵循责任分析模式逻辑的 class 图。 How can I use the given function assignStaffContact() to assign contact?如何使用给定的 function assignStaffContact()分配联系人?

I have undrerstood that StaffContact class is a control class and the Client , StaffMember are entity classes (we don't care about the TimePeriod class).我知道StaffContact class 是一个控件 class 和ClientStaffMember是实体类(我们不关心TimePeriod类)。

I cannot figure out which classes are gonna play a part in the procedure of assigning staff contact in order to create the proper sequence diagram (UML) of this action.我无法弄清楚哪些类将在分配人员联系人的过程中发挥作用,以便创建此操作的正确序列图 (UML)。 Arbitrarily there must be a boundary class providing the wanted interface.任意必须有一个边界 class 提供想要的接口。 The actor is gonna pick the case of assigning staff contact, which will trigger the method assignStaffContact() of the control class StaffContact but with which entity classes this will communicate and finally assign the staff?演员将选择分配员工联系人的情况,这将触发控件 class StaffContactassignStaffContact()方法,但这将与哪些实体类进行通信并最终分配员工?

I am getting confused with class ContactForCampaign and the logic behind it being connecte to the classes Client and StaffMember .我对 class ContactForCampaign及其背后连接到类ClientStaffMember的逻辑感到困惑。 I hope I explained well enough my problem and my thought process.我希望我能很好地解释我的问题和我的思考过程。

This diagram says that:这张图说:

  • A StaffContact instance can be associated to several ContactForCampaign instances一个StaffContact实例可以关联到多个ContactForCampaign实例
  • Each instance of ContactForCampaign is associated with exactly one instance of a Campaign , and defines exactly one StaffMember object as responsible, and. ContactForCampaign的每个实例都与Campaign的一个实例关联,并且将一个StaffMember object 定义为负责人,并且。 one Client object as commissioner (probably for the campaign).一位Client object 作为专员(可能是为了竞选)。

As a consequence, we can only guess that StaffContact::assignContact() requires to know which StaffMember to add (should be an argument of the operation).因此,我们只能猜测StaffContact::assignContact()需要知道要添加哪个 StaffMember(应该是操作的参数)。 Since several ContactForCampaign instances can be considered, the ooeration would probably also need to know which ContactForCampaign is relevant for the assignment.由于可以考虑多个ContactForCampaign实例,因此操作可能还需要知道哪个ContactForCampaign与分配相关。 Probably this can be determined with the help of a Campaign parameter.可能这可以借助Campaign参数来确定。 Two cases must then be considered: replacing a staff member of an existing ContactForCampaign or create a new one if no assignment exist for a campaign.然后必须考虑两种情况:替换现有ContactForCampaign的工作人员,或者如果活动不存在分配,则创建新的工作人员。 You have now all the ingredients for your sequence diagram.您现在已经具备了序列图的所有要素。 Note also that the operation would need to know which client is to be assigned as commissioner if a new ContactForCampaign os created.另请注意,如果创建了新的ContactForCampaign操作系统,该操作将需要知道要将哪个客户端指定为委托人。

Note that StaffContact::removeStaffContact() does not seem relevant, in view of the multiplicity 1 for the StaffMember , unless you condider removing as well the ContactForCampaign, which would then cause to lose the information regarding the commissioner.请注意,鉴于 StaffMember 的多重性 1, StaffMember StaffContact::removeStaffContact()似乎不相关,除非您考虑同时删除 ContactForCampaign,这将导致丢失有关专员的信息。

Last but not least, in view of the 1 multiplicity on the side of StaffContact, it would not be a control class, since the control is in princple existing for the time of the use case execution only, and should not have a permanent semantic link to the objects that it controls.最后但并非最不重要的一点是,鉴于 StaffContact 一侧的 1 多重性,它不会是控件 class,因为该控件原则上仅在用例执行时存在,并且不应具有永久语义链接到它所控制的对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM