框架和库有什么区别 [英] What is the difference between a framework and a library

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

问题描述

我知道一个库包含可容纳一个certian区域的函数,但是框架与库有何不同?

I know that a library contains functions to accomodate a certian area but how does a framework differ from a library?

推荐答案

引用: ^ ]


报价:

框架包含与众不同的关键区别功能,这些特征将它们与普通库分开:

控制反转:在框架中,与库或普通用户应用程序不同,整个程序的控制流不是由调用者决定,而是由框架决定.
默认行为:框架具有默认行为.此默认行为必须是一些有用的行为,而不是一系列的无操作.
可扩展性:用户通常可以通过选择性覆盖来扩展框架,也可以通过用户代码对其进行专门化以提供特定功能.
不可修改的框架代码:通常,在接受用户实现的扩展时,不应修改框架代码.换句话说,用户可以扩展框架,但不应修改其代码.

Frameworks contain key distinguishing features that separate them from normal libraries:

inversion of control: In a framework, unlike in libraries or normal user applications, the overall program''s flow of control is not dictated by the caller, but by the framework.
default behavior: A framework has a default behavior. This default behavior must be some useful behavior and not a series of no-ops.
extensibility: A framework can be extended by the user usually by selective overriding or specialized by user code to provide specific functionality.
non-modifiable framework code: The framework code, in general, is not supposed to be modified, while accepting user-implemented extensions. In other words, users can extend the framework, but should not modify its code.


请参阅软件框架 [库与框架? [ ^ ]
还有


refer Software framework[^]
Library vs. Framework?[^]
And Many More Resource from Here [^]


这篇关于框架和库有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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