简体   繁体   English

依赖隔离的意义

[英]Dependency Isolation meaning

I 'm reading the 12-factor-app manifesto and I'm at the dependencies section right now.我正在阅读12-factor-app 宣言,我现在在依赖项部分。 Dependency Isolation is something I cannot get my head around, though.不过,依赖隔离是我无法理解的东西。

Unfortunately no actual definition as to what that is is given, aside from that 12-factor-apps should "use a dependency isolation tool during execution to ensure that no implicit dependencies “leak in” from the surrounding system ".不幸的是,除了 12-factor-apps 应该“在执行过程中使用依赖隔离工具来确保没有隐式依赖从周围系统泄漏”之外,没有给出具体的定义

Searching for answers to that, I 'm only finding questions about how to achieve dependency isolation in a specific language/framework.在寻找答案时,我只是在寻找有关如何在特定语言/框架中实现依赖隔离的问题。

Maybe it is just a limitation in my understanding of english, but could someone enlighten me on this?也许这只是我对英语理解的一个限制,但有人可以启发我吗?

Application dependencies should be managed by application build itself, but not manage from outside or separately.应用程序依赖应该由应用程序构建本身管理,而不是从外部或单独管理。 Tools can be used like maven pom.xml or gradle.build or package.json or Gemfile etc可以使用 maven pom.xml 或 gradle.build 或 package.json 或 Gemfile 等工具

Lets assume you are building an app with Python.假设您正在使用 Python 构建应用程序。 You decide to use Django web-framework.您决定使用 Django 网络框架。 As you are starting you install Django using pip install django .开始时,您使用pip install django Django 3.1 is installed on your local system. Django 3.1 安装在您的本地系统上。

After two months you decide to host the Django project on server.两个月后,您决定在服务器上托管 Django 项目。 You install django by pip install django .您通过pip install django This time Django 3.3 is installed.这次安装了Django 3.3。 Because of version upgrade your code might break.由于版本升级,您的代码可能会中断。

To avoid such scenarios it is recommended to note the version of Django and Python.为了避免这种情况,建议注意 Django 和 Python 的版本。 You can add the Django version in requirement.txt or piplock file.您可以在requirements.txt 或piplock 文件中添加Django 版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM