函数式编程的分析与设计 [英] Analysis and Design for Functional Programming

查看:161
本文介绍了函数式编程的分析与设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的背景是命令式/对象式的,面向对象的编程语言,因此,我习惯于使用案例分析和使用UML来记录程序的设计。但问题在于UML本质上与面向对象的软件开发方式有关。



我对开发文档和定义最好的方法感兴趣用于使用函数式编程开发的系统的软件设计。


  • 您是否仍然使用使用案例分析还是结构化分析和设计而不是?

  • 怎么做软件架构师定义了系统的高级设计,以便开发人员遵循它?

  • 当您应该展示解决方案的设计时,您向客户或新开发人员展示什么? ?

  • 有没有什么比得上 UML 在功能世界?


解决方案

我不是专业人士,但我会尽力回答这些问题中的一部分。
$ b


你还会使用用例分析[?]


我不明白为什么不。收集用例,并设计一个您希望公开的满足用例的模块API。确定用例是否需要类型类型或仅用于普通函数。


或者可能是结构化分析和设计?


我对这种方法并不熟悉,但从我从wiki文章中收集的内容看来,它看起来很好。


软件架构师如何定义系统的高级设计,以便开发人员遵循它?

我假设他们指定了一个模块和模块的每个部分应该具有的类型。再次,我不是专业人士,所以我不确定在实践中做了什么。


您向客户展示什么或者当你应该展示解决方案的设计时向新的开发人员提供一个解决方案?

你向客户展示一些对他们有意义的东西。如果你的客户足够精明,只需向他们展示类型签名并解释重要功能。如果他们不那么聪明,那么就画出漂亮的照片,或者你必须做的任何事情。面向对象与现实世界对象进行比较,而FP则与...良好...功能进行比较。向新手演示函数的典型方法是将它描述为一台机器,在其中放入某些东西,然后出现其他东西。


<如何在没有写完全部文件的情况下记录整张照片?

图片?只需为重要函数定义类型签名,然后将实现保留为 undefined 。在那里有一个软件包可以为你提供更好的存根,在编译时会提醒你还需要实现哪些部分。


在功能世界中与UML相媲美的东西?


嗯...不是?


How do you deal with analysis and design phases when you plan to develop a system using a functional programming language like Haskell?

My background is in imperative/object-oriented programming languages, and therefore, I am used to use case analysis and the use of UML to document the design of program. But the thing is that UML is inherently related to the object-oriented way of doing software.

And I am intrigued about what would be the best way to develop documentation and define software designs for a system that is going to be developed using functional programming.

  • Would you still use use case analysis or perhaps structured analysis and design instead?
  • How do software architects define the high-level design of the system so that developers follow it?
  • What do you show to you clients or to new developers when you are supposed to present a design of the solution?
  • How do you document a picture of the whole thing without having first to write it all?
  • Is there anything comparable to UML in the functional world?

解决方案

I'm no professional but I'll try my hand at answering some of these questions.

Would you still use use case analysis [?]

I don't see why not. Gather use cases, and design a module API that you wish to expose that satisfies the use cases. Determine whether the use cases call for a typeclass, or for just plain functions.

or perhaps structured analysis and design instead?

I'm unfamiliar with that approach, but from what I gather from the wiki article, it looks like it would work just fine.

How do software architects define the high-level design of the system so that developers follow it?

I would assume that they specify a module and the types that each part of the module should have. Again, I am not a professional, so I'm not really sure what is done in practice.

What do you show to you clients or to new developers when you are supposed to present a design of the solution?

You show the clients something that will make sense to them. If your client is savvy enough, just show them the type signatures and explain the important functions. If they are less savvy, then draw pretty pictures, or whatever you have to do. OOP makes comparisons with real world objects, while FP makes comparisons with...well...functions. The typical way to illustrate a function to newbies is to portray it as a machine where you put certain things in, and then other things come out.

How do you document a picture of the whole thing without having first to write it all?

A "picture"? Just defining the type signature for the important functions, and then leave the implementation as undefined. There's a package out there somewhere that gives you better stubs that will remind you at compile time which parts you still need to implement.

Is there anything comparable to UML in the functional world?

Um...no?

这篇关于函数式编程的分析与设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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