OSGi Community Event 2010 - Automated Semantic Versioning for OSGi Bundles
PojoSR or OSGi (µ)Services For the Rest of Us
-
Upload
osgiusers -
Category
Technology
-
view
1.631 -
download
2
description
Transcript of PojoSR or OSGi (µ)Services For the Rest of Us
PojoSRor(OSGi)µServicesfortherestofus
KarlPauls
!"#$%&'&()"*Dienstag, 25. Oktober 2011
Karl
• MemberApacheSo?wareFoundaDon
• PMC:Felix,Sling,Incubator
• PPMC:Ace,Clerezza,Celix
• FellowatLuminis
• ProjectOwnerPojoSR
• Co‐Authorof„OSGiinAcDon“
Hallet al.
OSGiIN ACTION
M A N N I N G
Richard S. HallKarl Pauls
Stuart McCullochDavid Savage
FOREWORD BY PETER KRIENS
Creating Modular Applications in Java
Dienstag, 25. Oktober 2011
ServiceOrientaDon
Dienstag, 25. Oktober 2011
PromoDngaservice‐orientedinteracDonpaSern
!"#$%&"'(#)$%*"#
!"#$%&"'+",-"./"#
!"#$%&"'+"0%./#1
2-34%.5
%6/"#7&/
86*
Dienstag, 25. Oktober 2011
µServices
Dienstag, 25. Oktober 2011
µServices
• Interface‐basedprogramming,butmore
• ServiceRegistry
• Centrallyaccessible
• Browsable
• NoDficaDons
• ServiceRegistryBenefits
• ConsumingcodeisincontrolofproviderselecDon
• ButnotproviderinstanDaDonandconfiguraDon
• Providercodeisincontrolofwhentoprovide
• Promotesveryloosecouplingandlatebinding
Dienstag, 25. Oktober 2011
OSGi(µ)Services
Dienstag, 25. Oktober 2011
OSGiservices
• OSGiframeworkprovidestheconceptsweneed
• Centralizedserviceregistry
• ConsumerhascontroloverselecDon
• Providerhascontroloverwhentoprovide
• Plusfull‐blowndeploymentandpackagingmodularitywithrun‐Dmedynamism
Dienstag, 25. Oktober 2011
OSGi
Dienstag, 25. Oktober 2011
OSGi
• ThedownsidetoOSGiisthatitrequiresaboSom‐upcommitment
• Youneedtoconvertallofyourcodeintopropermodulestotakeadvantageofservices
• Atop‐downapproachofadopDngservicescanhelpeasemigraDontomoremodularcode
Dienstag, 25. Oktober 2011
OSGiframework
Dienstag, 25. Oktober 2011
PojoSR
Dienstag, 25. Oktober 2011
WhatisPojoSR?
• ItlargelyremovesthemodularitylayerfromtheOSGiframework
• Provides
• AcentralizedserviceregistrybasedonOSGiAPI
• LifecyclehooksforJARfiles
• A“light”OSGiframeworkfortheclasspath
Dienstag, 25. Oktober 2011
Whythisapproach?
• OSGiAPIisastandardwithyearsofexperiencebehindit
• Canre‐useOSGimodules(a.k.a.bundles)and/ortechnology
• Canleverageserviceswithouthavingtocompletelymodularizefirst(i.e.,top‐down)
• Providesapathtofull‐blownmodularity
Dienstag, 25. Oktober 2011
UseCases
Dienstag, 25. Oktober 2011
MigraDon
Dienstag, 25. Oktober 2011
MigraDon
• WithoutPojoSR
• TurnapplicaDonintoonebigbundle(jar)
• Splitintoseveralbundles
• Fixproblems
• Splitintoevenmorebundles(etc.)
• Eventually,startusingservices
• Allowsyoutoremoveuglyhacksneededtofixproblems
• WithPojoSR
• Startusingservices
• SplitintobundlesDienstag, 25. Oktober 2011
UseOSGiwhereyoucan‘t
• OSGi(lite)onGoogleAppEngineusingPojoSR
Dienstag, 25. Oktober 2011
UseOSGiwhereyoucan‘t
• hSp://vimeo.com/22571224
Dienstag, 25. Oktober 2011
Android
Dienstag, 25. Oktober 2011
Commondiscovery(SPI)
Dienstag, 25. Oktober 2011
Commondiscovery(SPI)
Dienstag, 25. Oktober 2011
ServicesanddependencyinjecDon
• AdvantageswhencombinedwithserviceorientaDon
• DependencyinjecDonnolongerneedsglobalview
• InformaDonlocalizedtojusttheprovider/consumer
• NolongerrestrictedtoasingleDIframework
• DifferentDIframeworkscanplaytogetherviatheserviceregistry
Dienstag, 25. Oktober 2011
Usage
Dienstag, 25. Oktober 2011
AsaServiceRegistry
Dienstag, 25. Oktober 2011
AsanOSGi„light“framework
Dienstag, 25. Oktober 2011
Standalone
Dienstag, 25. Oktober 2011
Demo
Dienstag, 25. Oktober 2011
ClosingRemarks
Dienstag, 25. Oktober 2011
BenefitsandDrawbacks
• PojoSRprovidespartofthepowerofOSGi
• inanon‐intrusiveway.
• allowstoincreasemodularityanduseµServices
• withoutfirstriddinganexisDngcodebaseofclassloaderhacks
• CanrunOSGibundleswhereyoucan‘t
• Thedrawbacksare
• doesnotenforcesmoduleboundaries
• doesnotallowmulDpleversionsofthesamepackage;doesnotsupporttheBundle‐ClassPath.
• ButyoucanusetheµServicemodeltogetridoftheclassloadinghacksoverDme,a?erwhichitwillbeeasiertomovetoOSGiandgetsidebysideversioningandrealmoduleboundaries.
Dienstag, 25. Oktober 2011
QuesDons?
http://pojosr.googlecode.com
Dienstag, 25. Oktober 2011