实体控制边界模式

时间:2019-01-07 06:55:50

标签: uml class-diagram ecb-pattern

我正在研究Query Editor模式,并尝试制作在线学习平台站点的类图。 This问题的答案对我很有帮助。在设计Entity-Control-Boundary类时,我遇到了一个设计问题。我没有找到使用继承的BoundaryBoundary类的任何示例。但是在我的设计中,我试图带来继承。
enter image description here
我已将其转换为以下内容:
enter image description here


因此,部分设计如下所示:
enter image description here
我的问题:

  1. 在接口中写入Control是强制性还是惯例,以表明它是<<Boundary>>类的接口?我刚刚写了Boundary
  2. 我应该在<<interface>>类中使用参数吗?我知道主要的逻辑工作是由Boundary类完成的。但是用户直接与Control类进行交互,然后Boundary类将信息传递给Boundary类。
  3. 如果我选择Control的selectTutorial操作,则用户的Boundary类将更改为TutorialListUI。我是否应该在这两个IndividualTutorialUI类之间画一条线以显示过渡?
  4. 除了这些,请提及可以进行的任何改进。

1 个答案:

答案 0 :(得分:0)

  1. Writing just <<interface>> is correct.
  2. The boundary class usually just holds attributes which usually correspond to screen fields and operations corresponding buttons.
  3. No. This is behavior and does not fit in a (static) class diagram.
  4. see below

    • Your boundaries rather look like being controllers.
    • You write "But In my design I'm trying to bring inheritance." but you rather (correctly) use a realization in your diagram
    • There should be tons of examples out there. Also look for MVC which is almost the same with other words (I said almost!).