Package Manager vs Dependency Manager

此生再无相见时 提交于 2019-12-03 03:41:36

问题


What are the differences?

In many places they used interchangeably as synonyms but I think they are different. What is the key difference in short?


回答1:


TLTR: Package Manager is used for SYSTEM and Dependency Manager for PROJECT


Package Manager - is used to configure system, ie to setup your development environment and with these settings you can build many projects.

Dependency Manager - Is specific to project. You manage all dependencies for a single project and those dependencies are going to be saved on your project. When you start another project you should manage your dependencies again.


EXAMPLE: In PHP world there is COMPOSER as dependency manager and PEAR as package manager. When using composer all your settings and extensions are for single project where pear settings to setup new extension and library to php core.




回答2:


There is an excellent and simple explanation on Composer's website:

Composer is not a package manager in the same sense as Yum or Apt are. Yes, it deals with "packages" or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default it does not install anything globally. Thus, it is a dependency manager.



来源:https://stackoverflow.com/questions/27285783/package-manager-vs-dependency-manager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!