库和API之间仍然有区别吗? [英] Is there still a difference between a library and an API?

查看:675
本文介绍了库和API之间仍然有区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我问人们有关API和库之间的区别时,我都会有不同的看法.有些人给出这种定义,称API是一种spec和一个库是一个实现...

Whenever I ask people about the difference between an API and a library, I get different opinions. Some give this kind of definition, saying that an API is a spec and a library is an implementation...

有人会告诉您这种定义,API是一堆映射出来的函数,而库只是编译形式的发行版.

Some will tell you this type of definition, that an API is a bunch of mapped out functions, and a Library is just the distribution in compiled form.

所有这些使我感到奇怪,在一个Web代码,框架和开源世界中,真的还有实际的区别吗?像jQuery或cURL之类的库能否过渡到API的定义中?

All this makes me wonder, in a world of web code, frameworks and open-source, is there really a practical difference anymore? Could a library like jQuery or cURL crossover into the definition of an API?

此外,框架是否完全属于这一类? Rails或Zend是否有一部分可能更像"API风格"或库式风格"?

Also, do frameworks cross over into this category at all? Is there part of Rails or Zend that could be more "API-like," or "libraryesque"?

真的期待一些启发性的想法:)

Really looking forward to some enlightening thoughts :)

推荐答案

我的观点是,当我谈到API时,它意味着仅向程序员公开的部分.如果我说的是图书馆",那我也指所有在幕后工作的东西,尽管它仍然是图书馆的一部分.

My view is that when I speak of an API, it means only the parts that are exposed to the programmer. If I speak of a 'library' then I also mean everything that is working "under the hood", though part of the library nevertheless.

这篇关于库和API之间仍然有区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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