OSGi and Java Modularity

930 views

Published on

A presentation about OSGi and Java modularity given on DevCon 2009. It lays out what is wrong with Java with respect to modularity and how OSGi fixes these flaws.

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
930
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
39
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

OSGi and Java Modularity

  1. 1. OSGi & Java Modularity Jazoon 2009, Zürich by Peter Kriens donderdag 25 juni 2009
  2. 2. donderdag 25 juni 2009
  3. 3. donderdag 25 juni 2009
  4. 4. donderdag 25 juni 2009
  5. 5. Productivity Application Complexity donderdag 25 juni 2009
  6. 6. Productivity Assembly Application Complexity donderdag 25 juni 2009
  7. 7. Productivity Structured Programming Assembly Application Complexity donderdag 25 juni 2009
  8. 8. Productivity Structured Object Oriented Programming Programming Assembly Application Complexity donderdag 25 juni 2009
  9. 9. Productivity Service Oriented Programming? Structured Object Oriented Programming Programming Assembly Application Complexity donderdag 25 juni 2009
  10. 10. donderdag 25 juni 2009
  11. 11. Application donderdag 25 juni 2009
  12. 12. Extensions Application Application Convenience Foundation Basic Something Core Java VM donderdag 25 juni 2009
  13. 13. minilang party pos. product workeffort workflow … accounting assetmaint content Extensionsbi ebay ecommerce googlebase guiapp hhfacility manufact. marketing minerva oagis order Application Application layer common catalina base datafile entity widget … Application Convenience resolver rome serializer servlets tomcat xalan bsf mail mx4j naming jetty poi wsdl4j bsh Foundation Basic Something jenks jpos18 jython looks lucene xerces velocity jakarta jcl json jdbm jdom xmlapis ws-commons Core log4j barcode4j axis batik commons xmlrpc geronimo httpunit freemarker ezmorph fop derby xmlgraphics Libs.. Java VM Java VM rt jce jsse plugin sunjce_prov. dnsns .. donderdag 25 juni 2009
  14. 14. minilang party pos. product workeffort workflow … accounting assetmaint content Extensionsbi ebay ecommerce googlebase guiapp hhfacility manufact. marketing minerva oagis order Application Application layer common catalina base datafile entity widget … Application Convenience resolver rome serializer servlets tomcat xalan bsf mail mx4j naming jetty poi wsdl4j bsh Foundation Basic Something jenks jpos18 jython looks lucene xerces velocity jakarta jcl json jdbm jdom xmlapis ws-commons Core log4j barcode4j axis batik commons xmlrpc geronimo httpunit freemarker ezmorph fop derby xmlgraphics Libs.. Java VM Java VM rt jce jsse plugin sunjce_prov. dnsns .. donderdag 25 juni 2009
  15. 15. by Damoiselle de Pique donderdag 25 juni 2009
  16. 16. Was Pollock an Early OO Programmer? by Damoiselle de Pique donderdag 25 juni 2009
  17. 17. donderdag 25 juni 2009
  18. 18. modularity donderdag 25 juni 2009
  19. 19. donderdag 25 juni 2009
  20. 20. donderdag 25 juni 2009
  21. 21. donderdag 25 juni 2009
  22. 22. donderdag 25 juni 2009
  23. 23. donderdag 25 juni 2009
  24. 24. low coupling, donderdag 25 juni 2009
  25. 25. low coupling, high cohesion & donderdag 25 juni 2009
  26. 26. low coupling, high cohesion & encapsulation donderdag 25 juni 2009
  27. 27. donderdag 25 juni 2009
  28. 28. How Do We Handle This Complexity in Java? donderdag 25 juni 2009
  29. 29. donderdag 25 juni 2009
  30. 30. Visibility vs Accessibility donderdag 25 juni 2009
  31. 31. Visibility Class Class S T donderdag 25 juni 2009
  32. 32. Visibility Class Class S T donderdag 25 juni 2009
  33. 33. Visibility Class Class S T donderdag 25 juni 2009
  34. 34. Visibility Class Class S T donderdag 25 juni 2009
  35. 35. Visibility Module System Class Class S T donderdag 25 juni 2009
  36. 36. Hierarchical Class Loaders boot ext app app cust donderdag 25 juni 2009
  37. 37. Hierarchical Class Loaders boot ext app app visibility cust donderdag 25 juni 2009
  38. 38. Context Class Loaders boot X {} ext app app Y {} cust donderdag 25 juni 2009
  39. 39. Context Class Loaders boot X {} ext Thread -> Context ClassLoader app app Y {} cust donderdag 25 juni 2009
  40. 40. Context Class Loaders boot X {} ext Thread -> Context ClassLoader app app Y {} cust donderdag 25 juni 2009
  41. 41. Accessibility public module package private donderdag 25 juni 2009
  42. 42. Accessibility Class module V Class Class Class W S T class Class U package donderdag 25 juni 2009
  43. 43. Java VM party common resolver axis xerces Begin rt assetmaint catalina mail ezmorph xmlapis jce hhfacility base jenks servlets xmlrpc Here jsse pos. datafile jakarta jetty xmlgraphics plugin content entity log4j looks sunjce_prov. manufact. widget httpunit jdbm dnsns product … mx4j bsf .. bi rome batik bsh marketing workflow jpos18 fop velocity workeffort ecommerce jcl tomcat ws-commons ebay oagis barcode4j poi geronimo minerva … freemarker lucene .. minilang googlebase serializer jdom json accounting order naming commons xalan guiapp ofbiz jython derby wsdl4j donderdag 25 juni 2009
  44. 44. Java VM party common resolver axis xerces Begin rt assetmaint catalina mail ezmorph xmlapis jce hhfacility base jenks servlets xmlrpc Here jsse pos. datafile jakarta jetty xmlgraphics plugin content entity log4j looks sunjce_prov. manufact. widget httpunit jdbm dnsns product … mx4j bsf .. bi rome batik bsh Class marketing workflow jpos18 fop velocity Not workeffort ecommerce jcl tomcat ws-commons Found ebay oagis barcode4j poi geronimo Exception minerva … freemarker lucene .. minilang googlebase serializer jdom json accounting order naming commons xalan guiapp ofbiz jython derby wsdl4j donderdag 25 juni 2009
  45. 45. Split Packages JARs A 2 B C import private export donderdag 25 juni 2009
  46. 46. Split Packages package com.foo: X, Y JARs A package com.foo: X, Y, Z 2 B package com.foo: X, Y, Z C import private export donderdag 25 juni 2009
  47. 47. Split Packages package com.foo: X, Y JARs A package com.foo: X, Y, Z 2 B package com.foo: X, Y, Z C import private export donderdag 25 juni 2009
  48. 48. Split Packages package com.foo: X, Y JARs A package com.foo: X, Y, Z 2 B package com.foo: X, Y, Z C import private export donderdag 25 juni 2009
  49. 49. Versioning JARs package com.foo: X, Y A package com.foo: X, Z 2 B package com.foo: X, Y, Z C import private export donderdag 25 juni 2009
  50. 50. Versioning JARs package com.foo: X, Y A package com.bar: A,B,C;1.0 package com.foo: X, Z 2 B package com.bar: A;2.0 package com.foo: X, Y, Z C package com.bar: A,B,C;2.0 import private export donderdag 25 juni 2009
  51. 51. Versioning JARs package com.foo: X, Y A package com.bar: A,B,C;1.0 package com.foo: X, Z 2 B package com.bar: A;2.0 package com.foo: X, Y, Z C package com.bar: A,B,C;2.0 import private export donderdag 25 juni 2009
  52. 52. Private Packages package com.foo: X, Y JARs A package com.bar: A,B,C;1.0 package com.foo: X, Z 2 B package com.bar: A;2.0 package com.foo: X, Y, Z C package com.bar: A,B,C;2.0 import private export donderdag 25 juni 2009
  53. 53. Private Packages package com.foo: X, Y JARs A package com.bar: A,B,C;1.0 package com.foo: X, Z 2 B package com.bar: A;2.0 package com.private: G package com.foo: X, Y, Z C package com.bar: A,B,C;2.0 package com.private: G,H,I import private export donderdag 25 juni 2009
  54. 54. Private Packages package com.foo: X, Y JARs A package com.bar: A,B,C;1.0 package com.foo: X, Z 2 B package com.bar: A;2.0 package com.private: G package com.foo: X, Y, Z C package com.bar: A,B,C;2.0 package com.private: G,H,I import private export donderdag 25 juni 2009
  55. 55. How Do We Handle This Complexity in Java? donderdag 25 juni 2009
  56. 56. We Don’t ... donderdag 25 juni 2009
  57. 57. donderdag 25 juni 2009
  58. 58. donderdag 25 juni 2009
  59. 59. Applications S (bundles) E Service C U Life Cycle R I Module T Y Execution Environment OS + Hardware donderdag 25 juni 2009
  60. 60. Execution Environment donderdag 25 juni 2009
  61. 61. donderdag 25 juni 2009
  62. 62. CLDC/ MIDP OSGi Min. J2SE 1.3, 1.4, 5, 6, ... CDC/FP donderdag 25 juni 2009
  63. 63. Kim Scarborough donderdag 25 juni 2009
  64. 64. Module Layer donderdag 25 juni 2009
  65. 65. Import, Export, Private Bundle A Bundle B p p q-1.4 q-[1.2,1.8) Bundle A r r . import private export donderdag 25 juni 2009
  66. 66. Import, Export, Private Bundle A Bundle B imports p p q-1.4 q-[1.2,1.8) Bundle A r r . import private export donderdag 25 juni 2009
  67. 67. Import, Export, Private Bundle A Bundle B imports p p exports q-1.4 q-[1.2,1.8) Bundle A r r . import private export donderdag 25 juni 2009
  68. 68. donderdag 25 juni 2009
  69. 69. donderdag 25 juni 2009
  70. 70. Uses Constraints Bundle A Bundle B r;1.0 r;2.0 p p q-1.4 q-[1.2,1.8) Bundle C Bundle D r;1.0 r;2.0 import private export donderdag 25 juni 2009
  71. 71. Uses Constraints Bundle A Bundle B r;1.0 r;2.0 imports p p q-1.4 q-[1.2,1.8) Bundle C Bundle D r;1.0 r;2.0 import private export donderdag 25 juni 2009
  72. 72. Uses Constraints Bundle A Bundle B r;1.0 r;2.0 imports p p exports q-1.4 q-[1.2,1.8) Bundle C Bundle D r;1.0 r;2.0 import private export donderdag 25 juni 2009
  73. 73. Uses Constraints Bundle A Bundle B r;1.0 r;2.0 imports p p exports q-1.4 q-[1.2,1.8) Bundle C Bundle D r;1.0 r;2.0 import private export donderdag 25 juni 2009
  74. 74. System Loader Extension Loader Application B Loader Custom Loader donderdag 25 juni 2009
  75. 75. System Loader Extension Loader Application B OSGi Loader Custom Loader donderdag 25 juni 2009
  76. 76. System Loader Bundle A Extension Bundle G Bundle B Loader OSGi Bundle C Application B Framework Loader Loader Bundle F Bundle D Custom Loader Bundle E donderdag 25 juni 2009
  77. 77. donderdag 25 juni 2009
  78. 78. Life Cycle Layer donderdag 25 juni 2009
  79. 79. INSTALLED STARTING RESOLVED ACTIVE UNINSTALLED STOPPING donderdag 25 juni 2009
  80. 80. MANAGE- System MENT bundle BUNDLE Bundle X-v2 X Bundle Bundle B A donderdag 25 juni 2009
  81. 81. Service Layer donderdag 25 juni 2009
  82. 82. donderdag 25 juni 2009
  83. 83. donderdag 25 juni 2009
  84. 84. donderdag 25 juni 2009
  85. 85. donderdag 25 juni 2009
  86. 86. Services defined in interface/class Bundle register get Bundle A B notify donderdag 25 juni 2009
  87. 87. Services interface Foo { void foo(); } void foo() { … … s.foo() } … donderdag 25 juni 2009
  88. 88. donderdag 25 juni 2009
  89. 89. donderdag 25 juni 2009
  90. 90. donderdag 25 juni 2009
  91. 91. donderdag 25 juni 2009
  92. 92. donderdag 25 juni 2009
  93. 93. Services Solve Class Loader Problems! donderdag 25 juni 2009
  94. 94. donderdag 25 juni 2009
  95. 95. Security donderdag 25 juni 2009
  96. 96. donderdag 25 juni 2009
  97. 97. Real Code! donderdag 25 juni 2009
  98. 98. donderdag 25 juni 2009
  99. 99. package com.acme; import org.osgi.framework.*; public class HelloWorld extends BundleActivator { public void start(BundleContext context) { System.out.println(“Hello World”); } public void stop(BundleContext context) { System.out.println(“Goodbye World”); } } --------------------------------------------- Manifest: 1.0 Bundle-Activator: com.acme.HelloWorld Import-Package: org.osgi.framework;version=1.3 donderdag 25 juni 2009
  100. 100. Bundles are active entities in runtime donderdag 25 juni 2009
  101. 101. donderdag 25 juni 2009
  102. 102. 294 donderdag 25 juni 2009
  103. 103. 294 7 donderdag 25 juni 2009
  104. 104. donderdag 25 juni 2009
  105. 105. donderdag 25 juni 2009
  106. 106. Is JSR 294 a Meta Module System? (Implemented by OSGi™, Jigsaw, Guice, …) donderdag 25 juni 2009
  107. 107. Is JSR 294 a Meta Module System? (Implemented by OSGi™, Jigsaw, Guice, …) No Java™ Standard for donderdag 25 juni 2009 Modules!
  108. 108. donderdag 25 juni 2009
  109. 109. donderdag 25 juni 2009
  110. 110. donderdag 25 juni 2009
  111. 111. Legacy donderdag 25 juni 2009
  112. 112. Class .forName donderdag 25 juni 2009
  113. 113. Class .forName donderdag 25 juni 2009
  114. 114. donderdag 25 juni 2009
  115. 115. Bloat? donderdag 25 juni 2009
  116. 116. Accidental Complexity donderdag 25 juni 2009
  117. 117. ‘97 ‘98 ‘99 ‘00 ‘01 ‘02 ‘03 ‘04 ‘05 ‘06 ‘07 ‘08 ‘09 ‘10 donderdag 25 juni 2009
  118. 118. ‘97 ‘98 ‘99 ‘00 ‘01 ‘02 ‘03 ‘04 ‘05 ‘06 ‘07 ‘08 ‘09 ‘10 donderdag 25 juni 2009
  119. 119. donderdag 25 juni 2009
  120. 120. donderdag 25 juni 2009
  121. 121. bundle A-1.2 c b bundle C-1.0 bundle a B-4.1 donderdag 25 juni 2009
  122. 122. donderdag 25 juni 2009
  123. 123. donderdag 25 juni 2009
  124. 124. The Component Framework donderdag 25 juni 2009
  125. 125. donderdag 25 juni 2009
  126. 126. Q&A donderdag 25 juni 2009
  127. 127. Thanks! donderdag 25 juni 2009

×