什么是分离问题? [英] What is separation of concerns?

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

问题描述



什么是担忧?

如何将一个应用程序分割成这些不同的问题?

解决方案

关注的是软件功能的不同方面。例如,软件的业务逻辑是一个问题,人们使用这个逻辑的接口是另一个。



分离问题是保留代码对于每个这些问题都是分开的。更改界面不应要求更改业务逻辑代码,反之亦然。



模型 - 视图 - 控制器(MVC)设计模式是将这些问题分开的一个很好的例子更好的软件可维护性。



有关详细信息:




What is separation of concerns?
What's a concern?
How might one partition an app into these "different concerns"?

解决方案

Concerns are the different aspects of software functionality. For instance, the "business logic" of software is a concern, and the interface through which a person uses this logic is another.

The separation of concerns is keeping the code for each of these concerns separate. Changing the interface should not require changing the business logic code, and vice versa.

Model-View-Controller (MVC) design pattern is an excellent example of separating these concerns for better software maintainability.

For more information:

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

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