• <legend id='rcwjo'><style id='rcwjo'><dir id='rcwjo'><q id='rcwjo'></q></dir></style></legend>

    1. <i id='rcwjo'><tr id='rcwjo'><dt id='rcwjo'><q id='rcwjo'><span id='rcwjo'><b id='rcwjo'><form id='rcwjo'><ins id='rcwjo'></ins><ul id='rcwjo'></ul><sub id='rcwjo'></sub></form><legend id='rcwjo'></legend><bdo id='rcwjo'><pre id='rcwjo'><center id='rcwjo'></center></pre></bdo></b><th id='rcwjo'></th></span></q></dt></tr></i><div id='rcwjo'><tfoot id='rcwjo'></tfoot><dl id='rcwjo'><fieldset id='rcwjo'></fieldset></dl></div>

      <small id='rcwjo'></small><noframes id='rcwjo'>

      1. <tfoot id='rcwjo'></tfoot>

          <bdo id='rcwjo'></bdo><ul id='rcwjo'></ul>

        当我们在 Eclipse 插件依赖项中有 `Required Plug-ins` 时,为什么我们需要 `Imported

        时间:2023-07-13

            <small id='hjC1r'></small><noframes id='hjC1r'>

            • <legend id='hjC1r'><style id='hjC1r'><dir id='hjC1r'><q id='hjC1r'></q></dir></style></legend>
              <tfoot id='hjC1r'></tfoot>
                <tbody id='hjC1r'></tbody>

                <i id='hjC1r'><tr id='hjC1r'><dt id='hjC1r'><q id='hjC1r'><span id='hjC1r'><b id='hjC1r'><form id='hjC1r'><ins id='hjC1r'></ins><ul id='hjC1r'></ul><sub id='hjC1r'></sub></form><legend id='hjC1r'></legend><bdo id='hjC1r'><pre id='hjC1r'><center id='hjC1r'></center></pre></bdo></b><th id='hjC1r'></th></span></q></dt></tr></i><div id='hjC1r'><tfoot id='hjC1r'></tfoot><dl id='hjC1r'><fieldset id='hjC1r'></fieldset></dl></div>

                  <bdo id='hjC1r'></bdo><ul id='hjC1r'></ul>

                • 本文介绍了当我们在 Eclipse 插件依赖项中有 `Required Plug-ins` 时,为什么我们需要 `Imported Packages`?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在开发 Eclipse 应用程序时,MANIFEST.MF 中的依赖项选项卡有两列.

                  In developing Eclipse application, the dependencies tab in MANIFEST.MF has two columns.

                  一个是Required Plug-ins,另一个是Imported Packages.

                  当我们有必需的插件时,为什么还需要Imported Packages?

                  Why do we need Imported Packages when we have Required Plug-ins?

                  评论说这个插件依赖于没有明确标识他们的原始插件",但我不确定在什么情况下不想明确标识他们的原创插件,有什么好处?

                  The comment has it that "this plug-in depends without explicitly identifying their originating plug-in", but I'm not sure in what case one doesn't want to explicitly identify their originating plug-in, and what's the advantage of it?

                  相关问题 - Eclipse 包和插件有什么区别?

                  推荐答案

                  导入包提供了额外的间接级别,而不是需要包.

                  Importing a package provides an extra level of indirection over requiring a bundle.

                  考虑一些标准 API 的情况... org.standard.framework.假设有两家公司实现了这个 API,也许你有包 com.abc.frameworkcom.xyz.framework.这两个实现包都会导出 org.standard.framework 包.

                  Consider the case of some standard API... org.standard.framework. Suppose two companies implement this API, maybe you have bundles com.abc.framework and com.xyz.framework. Both of these implementation bundles would export org.standard.framework package.

                  现在假设,您需要一个 org.standard.framework 实现,但您并不特别关心是哪一个.如果您需要 com.abc.frameworkcom.xyz.framework 捆绑包,那么您将自己绑定到特定的实现.使用 import-package 指令,您可以让 OSGi 充当间接层.

                  Now suppose, you need an org.standard.framework implementation, but you don't particularly care which one. If you require either com.abc.framework or com.xyz.framework bundle, you are tying yourself to a particular implementation. With an import-package directive, you are letting OSGi serve as an indirection layer.

                  import-package 的另一个优点是,如果将一个包移动到另一个包,您的依赖项不需要更改.当捆绑包被分解或组合时,在重构期间可能会出现这种情况.

                  Another advantage of import-package is that your dependencies do not need to change if a package is moved to another bundle. This situation can arise during refactoring when bundles are broken up or combined.

                  由于这些原因,OSGi 规范编写者现在通常建议使用相对较新的 import-package 指令而不是 require-bundle.问题是并非所有的捆绑包都为此做好了准备.许多人在导出包时还没有指定版本.这使得 import-package 在许多情况下变得不切实际.

                  For these reasons, OSGi spec writers now generally recommend using the relatively newer import-package directive over require-bundle. The problem is that not all of the bundles are ready for this. Many do not yet specify a version when exporting a package. This makes import-package impractical in many cases.

                  这篇关于当我们在 Eclipse 插件依赖项中有 `Required Plug-ins` 时,为什么我们需要 `Imported Packages`?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Intellij Java 2016 &amp;Maven:如何在 JAR 中嵌入依赖项? 下一篇:多个 SLF4J 绑定会导致错误?

                  相关文章

                  <small id='EP8bN'></small><noframes id='EP8bN'>

                  <tfoot id='EP8bN'></tfoot>
                • <i id='EP8bN'><tr id='EP8bN'><dt id='EP8bN'><q id='EP8bN'><span id='EP8bN'><b id='EP8bN'><form id='EP8bN'><ins id='EP8bN'></ins><ul id='EP8bN'></ul><sub id='EP8bN'></sub></form><legend id='EP8bN'></legend><bdo id='EP8bN'><pre id='EP8bN'><center id='EP8bN'></center></pre></bdo></b><th id='EP8bN'></th></span></q></dt></tr></i><div id='EP8bN'><tfoot id='EP8bN'></tfoot><dl id='EP8bN'><fieldset id='EP8bN'></fieldset></dl></div>

                  <legend id='EP8bN'><style id='EP8bN'><dir id='EP8bN'><q id='EP8bN'></q></dir></style></legend>
                        <bdo id='EP8bN'></bdo><ul id='EP8bN'></ul>