用于OCaml直接对象的UML [英] UML for OCaml immediate objects

查看:70
本文介绍了用于OCaml直接对象的UML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OCaml中创建了一个直接对象.

I have created an immediate object in OCaml.

let x = 
object (self)
val dataMember = 3
method aMethod = print_endline "Called a method"
end;;

由于该对象没有名称(被认为是匿名的?),如何在UML中正确表示该对象?

As the object doesn't have a name (is it considered anonymous?), how can it be correctly represented in UML?

谢谢.

推荐答案

您可以为它指定一个现时名称或其他一些公式值.在这种情况下,正确"实际上只是意味着一些显而易见的东西.国际UML标准机构或其他任何机构都没有提供正确答案".

You could give it a nonce-name, or some other formulaic value. "Correctly" in this context really just means something that will be clear. There is no "right answer" handed down from the International UML Standards Body or anything.

如果您想获得更具体的答案,为什么不使用类似Anonymous_foo_mungler的名称,如果不是匿名,则将其替换为描述性名称,例如foo_mungler

If you want a more concrete answer, why not call it something like Anonymous_foo_mungler where "foo_mungler" is replaced with the descriptive name you would have given it if it weren't anonymous.

这篇关于用于OCaml直接对象的UML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆