Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

OSGi Contracts: For Devs Who Think the Package Version Model is Too Much Work

DZone's Guide to

OSGi Contracts: For Devs Who Think the Package Version Model is Too Much Work

Free Resource

The Integration Zone is brought to you in partnership with Cloud Elements. What's below the surface of an API integration? Download The Definitive Guide to API Integrations to start building an API strategy.

An experimental release of bnd(tools) 2.2 has a new feature called contracts.  A recent blog post on OSGi.org explains who these contracts are for:

Though the OSGi has a very elegant package version model there are still many that think this is too much work. They do not want to be bothered by the niceties of semantic versions and just want to use, let's say, Servlet 3.0. For those people (seemingly not interested in minimizing dependencies) the OSGi Alliance came up with contracts in OSGi Core, Release 5.0.0. A contract allows you to:

   1.   Declare that a bundle provides the API of the given specification
   2.   Require that the API comes from a bundle that made the declaration


-- Peter Kriens


Read the rest of the article to get an idea of why these contracts work, even though they're seem strange to the experienced OSGi user.

Your API is not enough. Learn why (and how) leading SaaS providers are turning their products into platforms with API integration in the ebook, Build Platforms, Not Products from Cloud Elements.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}