在计算机科学中,依赖的反义词是什么?

In Computer Science, what's the opposite of a dependency?

更具体地说,在编程中,我们使用术语 dependency 来指代 运行 的另一段代码所需的软件组件。

需要依赖 运行 的那段代码叫什么?我不认为我知道这个词代表了相反的关系。

来自您的问题正文:

What do you call that piece of code that requires the dependency

依赖者

示例:

depender对dependee产生了依赖,这就是问题的开始。

来源:

我自己需要这些信息并找到了这个:https://en.wiktionary.org/wiki/dependee#:~:text=Noun,used%20in%20agent-oriented%20programming)

依赖的相反是独立

依赖的反向依赖。该术语特别适用于编程,指代需要依赖 运行.

的代码段

这个词被广泛使用。支持这一说法的一些引述:

  • 在书Dependency Injection: Design patterns using Spring and Guice(所以这本书主要是关于编程上下文中的依赖关系) :

    Dependency — A specific service that is required by another object to fulfill its function.
    Dependent — A client object that needs a dependency (or dependencies) in order to perform its function.

  • 在 Booch、Rumbaugh 和 Jacobson 的 The Unified Modeling Language Reference Manual,第二版一书中:

    Dependency: A relationship between two elements in which a change to one element (the supplier) may affect or supply information needed by the other element (the client). (...) the dependent elements are called clients.

  • semantic versioning 宣言中,他们解释了 semver 如何允许在不中断依赖软件或包的情况下发布新版本的依赖项。

  • 在 Maven 的 documentation 中:

    Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.

  • 最后但同样重要的是,linguist 也确认了该术语适用于非常相似的依赖管理需求。

依赖是被依赖的事物和它所依赖的事物之间的一种关系,在所指的方向上存在一些残留的歧义。无论使用什么术语,都建议提供定义。 Supplier/Client 是恕我直言的替代方案,虽然不是普遍适用,但更容易理解。