Java API 与框架?

Java API vs Frameworks?

Collections Framework 和 Collections 之间有什么区别 API?我听说"API is a subset of a framework"。框架提供更具体的功能,而接口更广泛和抽象,难道不是相反吗?我还听说一个框架可以包含多个 API。这是否意味着框架也是定制的?

首先,API的定义是什么?根据 Beal (n.d.),API "is a set of routines, protocols, and tools for building software applications. The API specifies how software components should interact and APIs are used when programming graphical user interface (GUI) components."

其次,什么是框架?根据 Rouse (205),"a framework is often a layered structure indicating what kind of programs can or should be built and how they would interrelate."

因此,框架决定了可以或应该构建什么样的程序。同时,API 指定软件组件应如何交互。从定义上可以看出,框架是程序的骨架,而API是程序的器官系统该程序。此外,一个框架由多个 API 组成。比如Microsoft .NET Framework,它提供了几个API如System.IO、System.Data等

参考资料

比尔 V. (n.d)。 API - 应用程序界面。网络百科。从 http://www.webopedia.com/TERM/A/API.html.

中检索到 07-17-2015

Rouse, M.(2015 年 2 月)。框架。什么是。从 http://whatis.techtarget.com/definition/framework.

中检索到 07-17-2015