什么是功能分解? [英] What is Functional Decomposition?

查看:633
本文介绍了什么是功能分解?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

功能分解,它的优点和缺点是什么?哪里有一些如何使用的例子?

解决方案

功能分解是一个复杂过程的过程,将其分解成更小,更简单的部分。

例如,考虑使用ATM。您可以将过程分解为:


  1. 走到ATM


  2. 插入您的银行卡


  3. 输入您的PIN


好吧,你得到点。



你可以想像编程一样。想想运行该ATM的软件:


  1. 读卡的代码


  2. 验证码


  3. 转移处理


每个都可以进一步细分。一旦达到子系统中分解最多的部分,就可以考虑如何开始对这些部分进行编码。然后你将这些小部分组成更大的整体。查看维基百科文章:



分解(编程)



功能分解的好处是,一旦你开始编码,你正在研究可以用于应用程序的最简单的组件。因此,开发和测试这些组件变得容易得多(更不用说,您可以更好地构建您的代码和项目以满足您的需求)。



明显的缺点是时间投资。在复杂系统中执行功能分解在编码开始之前需要更多的时间。



我个人认为,这段时间是非常值得的。 p>

Functional Decomposition, what is it useful for and what are its pros/cons? Where are there some worked examples of how it is used?

解决方案

Functional Decomposition is the process of taking a complex process and breaking it down into its smaller, simpler parts.

For instance, think about using an ATM. You could decompose the process into:

  1. Walk up to the ATM

  2. Insert your bank card

  3. Enter your pin

well...you get the point.

You can think of programming the same way. Think of the software running that ATM:

  1. Code for reading the card

  2. PIN verification

  3. Transfer Processing

Each of which can be broken down further. Once you've reached the most decomposed pieces of a subsystem, you can think about how to start coding those pieces. You then compose those small parts into the greater whole. Check out this Wikipedia Article:

Decomposition (programming)

The benefit of functional decomposition is that once you start coding, you are working on the simplest components you can possibly work with for your application. Therefore developing and testing those components becomes much easier (not to mention you are better able to architect your code and project to fit your needs).

The obvious downside is the time investment. To perform functional decomposition on a complex system takes more than a trivial amount of time BEFORE coding begins.

Personally, I think that amount of time is well worth it.

这篇关于什么是功能分解?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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