CodeCamp Iasi 10 march 2012 - SolvingThePuzzle

635 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
635
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CodeCamp Iasi 10 march 2012 - SolvingThePuzzle

  1. 1. Solving the Puzzle Java ModularityGeorge Alin CosteaSynygyMarch 10th, 2012
  2. 2. ComplexityOne of the most difficultchallenges to overcome in anylarge engineering project
  3. 3. The Boeing 747-400 “Jumbo Jet” has 6 million parts Linux kernel 2.6.35 has13.5 millions lines of code
  4. 4. Medium size Java Application
  5. 5. The Problem● No way to specify jar versions● No way to specify dependencies● Multiple versions of the same jar cannot co-exist peacefully● No runtime and life-cycle control
  6. 6. The ProblemThe Java Platform does not (yet)provide a standard module andservice system
  7. 7. The Problem Jar Hell
  8. 8. OSGi – A simple ideaThe module system for Java.It defines a way to create modulesand how those modules interact atruntime.
  9. 9. BundlesOSGi modules are called Bundles,they are nothing more than plainold Jar files with additional meta-data.The OSGi runtime handles theirlifecycle, dependencies andservices.
  10. 10. Bundle Anatomy
  11. 11. Bundle Anatomy - ManifestBundle-Name: Hello WorldBundle-SymbolicName: ro.codecamp.helloworldBundle-Description: A Hello World bundleBundle-Version: 1.0.0Bundle-Activator: ro.codecamp.helloworld.ActivatorExport-Package:ro.codecamp.helloworld;version="1.0.0"Import-Package: org.osgi.framework;version="1.3.0"
  12. 12. Bundle Anatomy - Activator
  13. 13. DemoModular application with dynamicbehaviour – plug-in system
  14. 14. Drawbacks● OSGi is not a panacea● Shift in application design● Learning curve● Not all applications require dynamic loading of modules● Bad code becomes modular bad code
  15. 15. Successful projects
  16. 16. Future: Project Jigsaw● Standard module system● Planned for inclusion in Java 8● Subject of flaming discussions● Should be inter-operable with OSGi
  17. 17. Questions?
  18. 18. Thank you!Please fill out the evaluation forms!

×