Eclipse plug-in dependencies-required bundle VRS. Import-Package

Source: Internet
Author: User

Source: Click to open the link

Eclipse allows to define dependencies between plug-ins Based on bundle or on package level. in the manifest. mf of the plugin. XML you can tell that your plug-in shocould either depend on another plug-in (and all its exported packages) or if your plug-in shocould
Only depend on the availability of certain packages no matter which plug-in is exporting this package.

The corresponding statements in manifest. MF are require-Bundle: or import-package:

Today I got the question what approach shoshould be preferred.

I believe the preferred way shocould be to use import-package because the coupling between the plug-ins is not that tight. as only as one plug-in exports this package the other plug-in will be fine. with this you can replaced a plug-in without changing the other
Plug-ins.

Of course if you have the same package in different plug-ins then you have to use the plug-in dependency.

The other advantage of plug-in dependencies is that the dependency is very clearly explicit, with the import-package it is not immediately obvious which plug-in is contributing this package.

But in total I wowould argue that loose coupling is always better so in general import-package shoshould be preferred.

There is also an article about osgi bundle dependency: osgi
Bundle dependency


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.