Upload
mfrancis
View
5.723
Download
0
Embed Size (px)
DESCRIPTION
Developing OSGi bundles is just too hard! That gnarly old manifest; listing all the imported packages (again!); writing all those XML files... who needs that kind of hassle? My goal when I began development of Bndtools was to change this picture drastically: to make it actually _easier_ to develop and test OSGi applications, composed of high quality reusable bundles, than it is to develop "traditional" non-modular Java applications. Now with the help of a growing community of contributors and brave alpha testers, that vision is beginning to come true. Bndtools is an Eclipse IDE for OSGi development, based on bnd. In this talk I will demonstrate the features of Bndtools that help to make it fun and easy to build bundles. I will also talk about: Declarative Services with Java annotations; OBR for release management and provisioning; and integration testing strategies.
Citation preview
COPYRIGHT © 2008-2011 OSGi Alliance. All Rights Reserved
Easy-peasy OSGi Development with Bndtools
Neil Bartlett
Paremus Ltd
21 September 2011
OSGi Alliance Marketing © 2008-2010 . All Rights Reserved
Page 1
Good News Everyone!
Hardly any slides!
My Mission
• To mercilessly destroy sources of OSGi pain and bafflement.
• Make it easy to do the right thing, and hard to do the wrong thing.
• Don’t just talk Best Practices... create them.
Make OSGi Fun!
“OSGi development cannot be made [...] easy or productive”
– Rod Johnson
(emphasis added for comic effect)
Bugbear #1
• Require-Bundle is evil
• Import-Package is a nightmare to maintain
But... The Packages are RIGHT THERE!!!
package org.example.auction.basic;
import org.example.auction.AuctionService;import org.osgi.framework.Constants;import org.osgi.service.event.Event;import org.osgi.service.event.EventAdmin;
D.R.Y.
Bugbear #2
• The rules of versioning are not hard to understand, but...
• Managing thousands of versioned packages is impossible
• Therefore version only bundles, or ignore versioning entirely
Bugbear #2
• Managing thousands of versioned packages is impossible... FOR HUMANS
• Use the machine!
Pure API Bundle
api 1.0.0
Service Provider
api 1.0.0api [1.0,1.1)
Service Consumer
api
Without API Bundle
api 1.0.0api [1.0,1.1) api
With API Bundle
api 1.0.1
api 1.0.0api [1.0,1.1) api
Oops!
api 1.0.1
api 1.0.0 api
In-Container Testing
AuctionServer
EventAdmin ...
TestBundle 1
TestBundle 2 ...
Bundles Under Test
Test Bundles
OSGi Framework
JUnit Runner
But I Use Maven!
• Maven and Bndtools, sitting in a tree, k.i.s.s.i.n.g.
Bndtools:
• Designing Bundles
• Instant Build/Run
• Bundle Analysis
Maven:
• Build dependencies
• Repeatable offline builds
• Reports