OSGi at eBay: JavaOne 2010

15
Justin Early, Sangjin Lee, & Debashis Saha eBay Inc.

Transcript of OSGi at eBay: JavaOne 2010

Page 1: OSGi at eBay: JavaOne 2010

Justin Early, Sangjin Lee, & Debashis Saha eBay Inc.

Page 2: OSGi at eBay: JavaOne 2010

Agenda   Case for enterprise OSGi

  Speaking of scale...

  Migration challenges & observations

  IDE & build

  Tooling benefits

  Closing

2

Page 3: OSGi at eBay: JavaOne 2010

Case for enterprise OSGi   For all its virtues, OSGi is still a hard sell in (large scale)

enterprises

  Why?

3

Page 4: OSGi at eBay: JavaOne 2010

Case for enterprise OSGi   Modularity: warm

  Runtime dynamism: not so much   Operations needs predictability

  JavaEE containers are becoming OSGi ready: warm

4

Page 5: OSGi at eBay: JavaOne 2010

Modularity   Modularity is perhaps the best driver for OSGi in the

enterprise   Reduce surface areas   Reduce coupling and increase cohesion

  However, modularity benefits are hard to quantify   What is a PRACTICAL metric that demonstrates the

compelling value of a modular architecture?   Reduced coupling? Reduced build time?

5

Page 6: OSGi at eBay: JavaOne 2010

Cost-benefit analysis   Modularity benefits are long term, but the migration pain is

immediate

  The very SCALE which necessitates the modularity discussion also makes migration very expensive

6

Page 7: OSGi at eBay: JavaOne 2010

It feels like...

7

Page 8: OSGi at eBay: JavaOne 2010

Speaking of scale...   eBay’s code base has

  Thousands of jars   Tens of thousands of packages   Hundreds of thousands of classes   Tens of millions of lines of code

  Even the simplest refactoring can become very expensive

8

Page 9: OSGi at eBay: JavaOne 2010

Migration observations   Everything needs to be in a bundle

  We’re finding a lot of existing problems to clean up

  Starting from a “super” bundle

9

Page 10: OSGi at eBay: JavaOne 2010

Migration challenges   What should be my module granularity?

  Package control policy

  Import-Package v. Require-Bundle (ala split packages)

  Dynamic classloading and resource loading

10

Page 11: OSGi at eBay: JavaOne 2010

Migration challenges   Limiting use of OSGi services

  Scale of development teams: training and support

11

Page 12: OSGi at eBay: JavaOne 2010

Eclipse and OSGi

Java Jars

Page 13: OSGi at eBay: JavaOne 2010

Evolution

•  Each tool adds required libraries as Bundle-Classpath entries •  Convert Jars to Bundles using aQute's BND tool •  Convert Library Projects into one plugin project using PDE

tooling and use use it for build and compile time.

Page 14: OSGi at eBay: JavaOne 2010

Closing   It’s important to articulate WHY we need/want OSGi in

the enterprise

  Less appetite for runtime dynamism than expected

  Start simple without advanced OSGi features

  Do not underestimate the refactoring/migration costs

  Putting the best and scalable IDE/build in place is supremely important

14

Page 15: OSGi at eBay: JavaOne 2010

Thank you!   Questions?

15