Can UML be used to model a Functional program? [cl

2019-01-16 09:39发布

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, is it at all possible and could someone please direct me towards the nearest application that would do this (open source, of free as in beer, if you please)

9条回答
Viruses.
2楼-- · 2019-01-16 10:40

I guess you could create a class called noclass and put in functions as methods. Also, you might want to split noclass into multiple categories of functions.

查看更多
三岁会撩人
3楼-- · 2019-01-16 10:43

To model a functional program, using a diagram, and not textual representation, you can use notation like the one used to program in Viskell or Luna

enter image description here

查看更多
劫难
4楼-- · 2019-01-16 10:46

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.

查看更多
登录 后发表回答