简体   繁体   中英

12 factor application - dependency leak in

Been going through the 12-factor application manifest, Under the section of "Dependencies" following is mentioned.

A twelve-factor app never relies on implicit existence of system-wide packages. It declares all dependencies, completely and exactly, via a dependency declaration manifest. Furthermore, it uses a dependency isolation tool during execution to ensure that no implicit dependencies “leak in” from the surrounding system. The full and explicit dependency specification is applied uniformly to both production and development.

In the context of Spring boot application, the following is my understanding.

  1. Using any build tool (such as maven/gradle)
  2. declare all dependencies in pom.xml or build.gradle.

Is this a correct understanding? I can't understand the part of "Leak In" from the surrounding system.

Does this mean that the JVM should also be within the application?

I am not a SpringBoot person.

Imagine that, a SpringBoot application requires n number of environment variables of which your application has set p number of variables. A 12 factor application should not assume that the remaining np environment variables are already set in the OS. In fact, if they were set at an OS level, then those environment variables leak in to your application which may have unexpected results. For example, heap memory was set at an OS level to a value that is not 'correct' for your application. So, rather than assume a 'generous' setting of heap memory at OS level, your application sets it up explicitly.

This is a good factor to consider, IMHO.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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