服务和库之间有什么区别? [英] What is the difference between a service and a library?

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

问题描述

也就是说,在一般的编程意义上.

That is, in the general programming sense of the words.

根据我的理解,两者似乎都是导入的代码的外部集合,这些代码可在项目中使用以抽象化程序并使其变得更容易.您不能像在库中那样在服务中调用方法吗?我还看到了一些有关面向服务的编程的知识,这使我有些困惑.

From my understanding, both appear to be an outside collection of code imported to use in projects to abstract programming and make it easier. Can you not call methods in services like you can in libraries? I also saw some stuff on service-orientated programming that confused me a bit.

推荐答案

服务通常在单独的服务器上运行,并且您可以通过与协议(例如协议)进行通信来使用服务的功能.Web服务的HTTP请求.

A service is typically running on a separate server and you use a service's functionality by communicating with it with a protocol, e.g. a HTTP request for a webservice.

是直接集成到您自己的代码中的代码.

A library on the other hand is code that is directly integrated into your own code.

但是,库和服务都应该为您提供一个稳定的,有据可查的界面,并且在这种意义上它们是相似的.

However, both a library and a service should provide you a stable, well-documented interface and they are similar in that sense.

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

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