加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

用于Scala的任何UML工具

发布时间:2020-12-16 09:23:37 所属栏目:安全 来源:网络整理
导读:是否有可用于Scala的UML工具.我的问题的原因是它的功能和OO概念的混合,因此我想知道这些工具如何表示UML图中的功能. 解决方法 这个 thread总结了任何想要表示Scala类的UML工具所面临的障碍: there is no official representation of mixins in UML it is di
是否有可用于Scala的UML工具.我的问题的原因是它的功能和OO概念的混合,因此我想知道这些工具如何表示UML图中的功能.

解决方法

这个 thread总结了任何想要表示Scala类的UML工具所面临的障碍:

  • there is no official representation of mixins in UML
  • it is difficult to represent:
    • closures
    • Scala type members
    • class constructor parameter bounds (a.k.a. “template
      type” bounds/constraints)
    • covariant and contravariant class constructor inheritance
    • the relationship between a class or trait and the
      companion object

本论文(“Evaluierung des Einsatzes von Scala bei der Entwicklung für die Android-Plattform”,pdf,德语)确实添加了特征混合和其他scala特定元素的定型(第146页).

2009年由Meiko Rachimow补充的内容:

属性,getter和setter

For all published attributes exist implicit getter (attribute1 and attribute2),except the visibility was declared as private (attribute3). If published attributes are tagged with a stereotype Var,they are variables,for which there exist implicit setter (attribute2). The stereotype lazy marks instance variables as lazy (attribute4).

类和仿制药

Like in UML,generic classes are marked with an abstract type. By using the Scala language syntax,upper and lower bounds can be declared for this type (EineKlasse). It is possible to use structured types as bounds,which attributes and methods are embraced by curly braces (EineKlasse2). Generic type parameters of methods are embraced by square brackets (operation).

性状

Traits are displayed like abstract classes and tagged with the stereotype trait. Abstract attributes and methods are displayed in italics (attribute2,operation2). For abstract attributes the dependency arrow can be tagged with the stereotype requires (Trait3,attribute3). On the other hand,the stereotype self is used for self referencing types (Trait4). If a trait inherits another trait,the inheritance is displayed with an inheritance arrow (Trait2). This arrow type is used too,if a class extends a trait (Klasse). To emphasis the “mix in” of traits,the inheritance arrow can be tagged with the stereotype mixin (Klasse).

单身对象

Singleton objects are displayed like classes and tagged with the stereotype singleton. It is possible,that there exist two class elements with the same name. In fact it is a singleton object with the belonging companion class. In this case the dependency arrow is tagged with the stereotype hasA.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读