Easy-peasy OSGi Development with Bndtools - Neil Bartlett
-
Upload
mfrancis -
Category
Technology
-
view
5.723 -
download
0
description
Transcript of Easy-peasy OSGi Development with Bndtools - Neil Bartlett
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