UML 可以用于建模函数式程序吗? [英] Can UML be used to model a Functional program?

查看:38
本文介绍了UML 可以用于建模函数式程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更具体地说,您如何使用图表而不是文本表示对功能程序或使用功能样式(没有类)开发的程序进行建模.

More specifically, how do you model a functional program, or one developed using the Functional Style (without classes) using a diagram, and not textual representation.

推荐答案

函数式程序员通常不太会使用图表.许多函数式程序员(但不是全部)发现写下类型是封装面向对象程序员放入 UML 图中的设计关系的好方法.

Functional programmers generally don't have a lot of use for diagrams. Many functional programmers (but not all) find that writing down types is a good way to encapsulate the design relationships that OO programmers put into UML diagrams.

因为可变状态在函数式程序中很少见,所以没有可变的对象",所以通常不需要或不需要绘制它们之间的关系图.虽然一个函数可能会调用另一个函数,但这个属性通常对系统的整体设计并不重要,而只对调用函数的实现很重要.

Because mutable state is rare in functional programs, there are no mutable "objects", so it is not usually useful or necessary to diagram relationships among them. And while one function might call another, this property is usually not important to the overall design of a system but only to the implementation of the function doing the calling.

如果我强烈需要绘制功能性程序图,我可能会使用概念图 在哪些类型或函数中扮演概念的角色.

If I were feeling a strong need to diagram a functional program I might use a concept map in which types or functions play the role of concepts.

这篇关于UML 可以用于建模函数式程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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