SlideShare a Scribd company logo
1 of 80
Download to read offline
Services-First
                          Migration to OSGi
                               BJ Hargrave (IBM)
                              Peter Kriens (aQute)




woensdag 16 november 11
Agenda
                  •       Modularity Maturity Model
                  •       The Brick Wall
                  •       Couplings
                  •       µServices
                  •       What Broker?
                  •       Example
                  •       Conclusion


woensdag 16 november 11
Modularity Maturity
                               Model
                  •       1 Ad Hoc

                  •       2 Managed

                  •       3 Contracts

                  •       4 Fences             Page 2   OSGi Alliance Marketing © 2008-2011 . All Rights Reserved,
                                                        © IBM Corp. 2011
                                                                                                                     21.09.2011




                  •
                                        Inspired by Graham Charters’ excellent OSGi Community Event 2011
                          5 Optimize    presentation @ http://slidesha.re/q8EHFp




woensdag 16 november 11
Modularity Maturity
                               Model




woensdag 16 november 11
1. Ad Hoc
                  •       Flat, manual class path

                  •       Single name space

                  •       Full visibility and normal
                          accessibility

                  •       Monolithic

                  •       Highly coupled

                  •       Split Packages

                  •       Add/Shuffle JARs until it works




woensdag 16 november 11
1. Ad Hoc
                  •       Flat, manual class path

                  •       Single name space



                                                                 e l l
                                                                H
                  •       Full visibility and normal
                          accessibility

                  •       Monolithic


                                                             AR
                  •
                  •
                          Highly coupled

                          Split Packages                   J
                  •       Add/Shuffle JARs until it works




woensdag 16 november 11
2. Managed
                  •       Treat JARs as a module

                  •       JAR Identity

                          •   Naming

                          •   Versioning

                  •       Dependencies

                  •       Repositories



woensdag 16 november 11
2. Managed
                                                            a d
                  •       Treat JARs as a module


                                                       n l o
                                                      w he t
                  •       JAR Identity

                          •   Naming

                                                   D o t
                          •   Versioning

                                                               r n e
                  •       Dependencies


                                                         n t e
                  •       Repositories
                                                       i
woensdag 16 november 11
3. Contracts
                  •       Interface based design,
                          POJOs

                  •       Provide contracts for
                          each connection
                          between JARs

                  •       Implementation details
                          inside the JAR

                  •       Versioning on contracts



woensdag 16 november 11
3. Contracts
                  •
                                                           d e r
                                                            a
                          Interface based design,


                                                           o
                          POJOs

                  •       Provide contracts for
                                                          l s
                                                         s k
                                                        s c
                                                       a a
                          each connection


                                                      l h
                          between JARs

                  •       Implementation details
                          inside the JAR            c
                  •       Versioning on contracts



woensdag 16 november 11
4. Fences
                  •       Explicitly Import/Export
                          packages

                  •       Explicitly specify
                          requirements and capabilities

                  •       Enforce the module
                          boundaries

                  •       Semantic Versioning

                  •       Side-by-side versioning
                          supported




woensdag 16 november 11
4. Fences
                  •       Explicitly Import/Export
                          packages

                  •       Explicitly specify
                          requirements and capabilities

                                                             o d!
                  •

                  •
                          Enforce the module
                          boundaries

                          Semantic Versioning
                                                          Go
                  •       Side-by-side versioning
                          supported




woensdag 16 november 11
5. Optimize
                  •       Exploit concepts for
                          modules and contracts

                  •       Delegated Control

                  •       Optimize the code base to
                          leverage new patterns:

                          •   Extender

                          •   Whiteboard

                  •       Repeat



woensdag 16 november 11
5. Optimize
                  •       Exploit concepts for
                          modules and contracts

                  •       Delegated Control

                  •       Optimize the code base to
                          leverage new patterns:

                          •   Extender

                          •   Whiteboard

                  •       Repeat



woensdag 16 november 11
Today
                                       1.
                                     Ad Hoc




                            2.                     3.
                          Managed               Contracts



                                        4.
                                      Fences



                                        5.
                                     Optimize


woensdag 16 november 11
Today
                                                 1.
                                               Ad Hoc            Enterprise

                                                                              DI
                             vn                                            ,C
                           m                                            ice ing
                                      2.                     3.
                              Ivy   Managed               Contracts
                                                                      gu r
                              saw                                       sp
                          jig
                                                  4.
                                                Fences



                                                  5.
                                               Optimize


woensdag 16 november 11
Today
                                                 1.
                                               Ad Hoc            Enterprise

                                                                              DI
                             vn                                             ,C
                           m                                            ice ing
                                      2.                     3.
                              Ivy   Managed               Contracts
                                                                      gu r       OSGi
                              saw                                       s p
                          jig
                                                  4.
                                                Fences



                                                  5.
                                               Optimize


woensdag 16 november 11
Today
                                                 1.
                                               Ad Hoc            Enterprise

                                                                              DI
                             vn                                             ,C
                           m                                            ice ing
                                      2.                     3.
                              Ivy   Managed               Contracts
                                                                      gu r       OSGi
                              saw                                       s p
                          jig
                                                  4.
                                                Fences



                                                  5.
                                               Optimize


woensdag 16 november 11
woensdag 16 november 11
woensdag 16 november 11
Class.forName(String)




woensdag 16 november 11
Class Space
                     package

                     class




woensdag 16 november 11
Class Space
                     package

                     class




woensdag 16 november 11
Class Space
                     package

                     class




woensdag 16 november 11
Class Space


                                V1      V2




woensdag 16 november 11
Class Space


                                V1      V2




woensdag 16 november 11
Class Space


                                          V1   V2




                          Class.forName


woensdag 16 november 11
Class Space


                                                  V1   V2




                          x                   x
                              Class.forName


woensdag 16 november 11
Class Space


                                                  V1   V2




                          x                   x
                              Class.forName


woensdag 16 november 11
Why Class.forName?




woensdag 16 november 11
Why Class.forName?
                                                               ! ! !
                                                       ! ! !
                                               ! ! !
                                       ! ! !
                                N G!
                           P LI
                     C O  U
woensdag 16 november 11
How to get an Instance?
                  That is the Question!



woensdag 16 november 11
Couplings

                                 modular    not Example
                                           modular

                          type                   FooImpl foo;


                                                 Foo foo = (Foo)
                 instance                          Class.forName(“FooImpl”)
                                                      .newInstance();




woensdag 16 november 11
Type Coupling
                          class Client {}   class FooImpl{}




woensdag 16 november 11
Type Coupling
                          class Client {}   class FooImpl{}




woensdag 16 november 11
Type Coupling
                          class Client {}                     class FooImpl{}




                                            interface Foo{}




woensdag 16 november 11
Type Coupling
                          class Client {}                     class FooImpl{}




                                            interface Foo{}

                                     uses              implements




woensdag 16 november 11
Type Coupling
                          class Client {}                     class FooImpl{}




                                            interface Foo{}

                                     uses              implements



                                              get instance




woensdag 16 november 11
Type Coupling
                          class Client {}                     class FooImpl{}




                                             o
                                            r ?l
                                        o ut s
                                         n einterface Foo{}



                                       C s
                                     uses              implements




                                         Is   get instance




woensdag 16 november 11
Instance Coupling

                  •       New

                  •       Factory

                  •       Inversion of Control

                  •       Broker




woensdag 16 november 11
Instance Coupling
                                                 client   container   impl

                  •       New

                  •       Factory

                  •       Inversion of Control

                  •       Broker




woensdag 16 november 11
Instance Coupling
                                                 client   container   impl

                  •       New

                  •       Factory

                  •       Inversion of Control

                  •       Broker




woensdag 16 november 11
Instance Coupling
                                                 client   container   impl

                  •       New

                  •       Factory

                  •       Inversion of Control

                  •       Broker




woensdag 16 november 11
Instance Coupling
                                                 client   container   impl

                  •       New

                  •       Factory

                  •       Inversion of Control

                  •       Broker




woensdag 16 november 11
Instance Coupling
                                                 client   container   impl

                  •       New

                  •       Factory

                  •       Inversion of Control

                  •       Broker




woensdag 16 november 11
µServices Primitive
                  •       Broker Pattern

                  •       Direction

                  •       Contract

                  •       Publish

                  •       Find

                  •       Bind

                  •       Who’s Listening?

                  •       Cardinality



woensdag 16 november 11
µServices Primitive
                  •       Broker Pattern

                  •       Direction

                  •       Contract

                  •       Publish            A   S   B
                  •       Find

                  •       Bind

                  •       Who’s listening?

                  •       Cardinality



woensdag 16 november 11
Patterns

                  •       Factory

                  •       Listener

                  •       Discovery

                  •       Distribution




woensdag 16 november 11
5. Optimize


                               E




woensdag 16 november 11
5. Optimize
                          A    B   C




                          D    E   F




                          G    H   I




woensdag 16 november 11
Back to the Brick Wall




woensdag 16 november 11
Migration
                          A   B   C




                          D   E   F




                          G   H   I




woensdag 16 november 11
Migration
                          A   B   C




                          D   E   F




                          G   H   I




woensdag 16 november 11
Migration
                          A   B   C




                          D   E   F




                          G   H   I




woensdag 16 november 11
Migration
                          A   B   C




                          D   E   F




                          G   H   I




woensdag 16 november 11
Migration
                          A   B   C




                          D   E   F




                          G   H   I




woensdag 16 november 11
So we need a broker
                           that runs without
                                fences...

woensdag 16 november 11
So we need a Broker
                           that runs without
                                Fences...SR
                                   o j o
                                 P
woensdag 16 november 11
POJOSR

                  • Developed by Karl Pauls
                  • JavaOne presentation 24811
                  • http://pojosr.googlecode.com
                  • Based on Apache Felix

woensdag 16 november 11
Gain
                  •       Existing libraries and many bundles work without
                          modification
                  •       Bundle (JAR) activation (have their own local main)
                  •       µServices
                  •       Dynamicity (in µServices)
                  •       Extender pattern (react on JAR content)
                  •       Migration path to Fences (OSGi)
                  •       Existing OSGi and non-OSGi tooling can be used


woensdag 16 november 11
Loss
                  •       No dynamic install/uninstall/update
                  •       No side-by-side versioning
                  •       No module privacy
                  •       No explicit dependencies
                  •       No Lazy activation
                  •       No Bundle classpath
                  •       No Native Code support


woensdag 16 november 11
Migrating


                  • Example: extend ant … the tool we all
                          (sometimes) love and (sometimes) hate
                  • We make different <helloXXX/> tasks


woensdag 16 november 11
Ant Your Service

                  •       Base ant

                  •       Activator

                  •       Extender
                                       ant


                                          ...
                                       ...




woensdag 16 november 11
Ant Your Service

                  •       Base ant     pojosr
                                        ant

                  •       Activator

                  •       Extender
                                       ant


                                           ...
                                        ...




woensdag 16 november 11
Ant Your Service

                  •       Base ant     pojosr
                                        ant

                  •       Activator

                  •       Extender
                                       ant


                                           ...
                                        ...




woensdag 16 november 11
Ant Your Service
                                                 Class<Task>




                  •       Base ant     pojosr
                                        ant

                  •       Activator

                  •       Extender
                                       ant


                                           ...
                                        ...




woensdag 16 november 11
Ant Your Service
                                                 Class<Task>
                                                                 hello
                                                               activator



                  •       Base ant     pojosr
                                        ant

                  •       Activator

                  •       Extender
                                       ant


                                           ...
                                        ...




woensdag 16 november 11
Ant Your Service
                                                 Class<Task>
                                                                 hello
                                                               activator



                  •       Base ant     pojosr
                                        ant

                  •       Activator

                  •       Extender
                                       ant


                                           ...
                                        ...




woensdag 16 november 11
Ant Your Service
               <project name="master">

               	    <path id="bundles">
               	    	 <fileset dir="bundles">
               	    	 	 <include name="*.jar" />
               	    	 </fileset>
               	    </path>

               	    <taskdef name="auto"
                       classname="aQute.ant.connect.AutoTask" classpathref="bundles" />
               	    <auto />

               	    <helloActivator />

               </project>




woensdag 16 november 11
Ant Your Service
               public class Activator implements BundleActivator {

               	    public void start(BundleContext context) throws Exception {
               	    	 Properties props = new Properties();
               	    	 props.put("ant", "helloActivator");
               	    	 context.registerService(Class.class.getName(),
                            HelloTask.class, props);
               	    }

               	 public void stop(BundleContext context) throws Exception {
               	 }
               }
               public class HelloTask extends Task {
               	 String message = "Hello Activator";
               	
               	 public void execute() { System.out.println(message); }
               	 public void setMessage(String m) { this.message = m; }
               }




woensdag 16 november 11
Ant Your Service
               public class Activator implements BundleActivator {




                                               t
               	    public void start(BundleContext context) throws Exception {




                                             f
               	    	 Properties props = new Properties();




                                           u
               	    	 props.put("ant", "helloActivator");




                                    r
               	    	 context.registerService(Class.class.getName(),




                                   c
                            HelloTask.class, props);
               	    }

               	 public void stop(BundleContext context) throws Exception {
               	 }
               }
               public class HelloTask extends Task {
               	 String message = "Hello Activator";
               	
               	 public void execute() { System.out.println(message); }
               	 public void setMessage(String m) { this.message = m; }
               }




woensdag 16 november 11
Ant Your Service
                                                 Class<Task>
                                                                 hello
                                                               activator



                  •       Base ant     pojosr
                                        pojo
                                        ant

                  •       Activator

                  •       Extender
                                       ant


                                           ...
                                        ...




woensdag 16 november 11
Ant Your Service
                                                 Class<Task>
                                                                 hello
                                                               activator



                  •       Base ant     pojosr
                                        pojo
                                        ant
                                                                 hello
                                                               extendee

                  •       Activator

                  •       Extender
                                       ant


                                           ...
                                        ...




woensdag 16 november 11
Ant Your Service
                                                 Class<Task>
                                                                      hello
                                                                    activator



                  •       Base ant     pojosr
                                        pojo
                                        ant
                                                                      hello
                                                                    extendee

                  •       Activator
                                                   Manifest-Version: 1.0


                  •                    ant         Ant-Task: helloExtender=HelloTask
                          Extender
                                           ...
                                        ...




woensdag 16 november 11
Ant Your Service
                public class HelloTask extends Task {
                	 String message = "Hello Extender";
                	
                	 public void execute() { System.out.println(message); }
                	 public void setMessage(String m) { this.message = m; }
                }




woensdag 16 november 11
Ant Your Service
                public class HelloTask extends Task {
                	 String message = "Hello Extender";
                	
                	 public void execute() { System.out.println(message); }
                	 public void setMessage(String m) { this.message = m; }
                }




                                                    u ft
                                            c r
                                N O
woensdag 16 november 11
Conclusion
                  • Moving to Fences is hard because popular
                          instance creation patterns are
                          fundamentally not modular
                  • Services-First approach works without
                          Fences
                  • After completion, moving to Fences is
                          much easier


woensdag 16 november 11
Good Fences
                    Make Good Neighbors




woensdag 16 november 11
Good Fences
                                od ul es
                    Make Good Neighbors
                              m



woensdag 16 november 11
Q&A




woensdag 16 november 11

More Related Content

Similar to Services first migration to osgi - osgi users forum uk 16-nov2011

MiningTheSocialWeb.Ch2.Microformat
MiningTheSocialWeb.Ch2.MicroformatMiningTheSocialWeb.Ch2.Microformat
MiningTheSocialWeb.Ch2.MicroformatHyeonSeok Choi
 
Databases -- Have it Your Way (Frederick Cheung)
Databases -- Have it Your Way (Frederick Cheung)Databases -- Have it Your Way (Frederick Cheung)
Databases -- Have it Your Way (Frederick Cheung)Skills Matter
 
New functionalities in gvsig mobile 1.0
New functionalities in gvsig mobile 1.0New functionalities in gvsig mobile 1.0
New functionalities in gvsig mobile 1.0jacarma
 
Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011Charles Nutter
 
Scaling the Brandwatch Search Index - A History (Tim Owen at Big Data Brighton)
Scaling the Brandwatch Search Index - A History (Tim Owen at Big Data Brighton)Scaling the Brandwatch Search Index - A History (Tim Owen at Big Data Brighton)
Scaling the Brandwatch Search Index - A History (Tim Owen at Big Data Brighton)Brandwatch
 
Building Scale Free Applications with Hadoop and Cascading
Building Scale Free Applications with Hadoop and CascadingBuilding Scale Free Applications with Hadoop and Cascading
Building Scale Free Applications with Hadoop and Cascadingcwensel
 
Hadoop: A Hands-on Introduction
Hadoop: A Hands-on IntroductionHadoop: A Hands-on Introduction
Hadoop: A Hands-on IntroductionClaudio Martella
 
Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Leonardo Borges
 

Similar to Services first migration to osgi - osgi users forum uk 16-nov2011 (10)

Stardog talk-dc-march-17
Stardog talk-dc-march-17Stardog talk-dc-march-17
Stardog talk-dc-march-17
 
MiningTheSocialWeb.Ch2.Microformat
MiningTheSocialWeb.Ch2.MicroformatMiningTheSocialWeb.Ch2.Microformat
MiningTheSocialWeb.Ch2.Microformat
 
Databases -- Have it Your Way (Frederick Cheung)
Databases -- Have it Your Way (Frederick Cheung)Databases -- Have it Your Way (Frederick Cheung)
Databases -- Have it Your Way (Frederick Cheung)
 
New functionalities in gvsig mobile 1.0
New functionalities in gvsig mobile 1.0New functionalities in gvsig mobile 1.0
New functionalities in gvsig mobile 1.0
 
Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011Building Languages for the JVM - StarTechConf 2011
Building Languages for the JVM - StarTechConf 2011
 
Infinispan for Dummies
Infinispan for DummiesInfinispan for Dummies
Infinispan for Dummies
 
Scaling the Brandwatch Search Index - A History (Tim Owen at Big Data Brighton)
Scaling the Brandwatch Search Index - A History (Tim Owen at Big Data Brighton)Scaling the Brandwatch Search Index - A History (Tim Owen at Big Data Brighton)
Scaling the Brandwatch Search Index - A History (Tim Owen at Big Data Brighton)
 
Building Scale Free Applications with Hadoop and Cascading
Building Scale Free Applications with Hadoop and CascadingBuilding Scale Free Applications with Hadoop and Cascading
Building Scale Free Applications with Hadoop and Cascading
 
Hadoop: A Hands-on Introduction
Hadoop: A Hands-on IntroductionHadoop: A Hands-on Introduction
Hadoop: A Hands-on Introduction
 
Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011)
 

More from mfrancis

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...mfrancis
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)mfrancis
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)mfrancis
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruumfrancis
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...mfrancis
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...mfrancis
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...mfrancis
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)mfrancis
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...mfrancis
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...mfrancis
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...mfrancis
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)mfrancis
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)mfrancis
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)mfrancis
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...mfrancis
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...mfrancis
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)mfrancis
 

More from mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 

Recently uploaded

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Recently uploaded (20)

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

Services first migration to osgi - osgi users forum uk 16-nov2011

  • 1. Services-First Migration to OSGi BJ Hargrave (IBM) Peter Kriens (aQute) woensdag 16 november 11
  • 2. Agenda • Modularity Maturity Model • The Brick Wall • Couplings • µServices • What Broker? • Example • Conclusion woensdag 16 november 11
  • 3. Modularity Maturity Model • 1 Ad Hoc • 2 Managed • 3 Contracts • 4 Fences Page 2 OSGi Alliance Marketing © 2008-2011 . All Rights Reserved, © IBM Corp. 2011 21.09.2011 • Inspired by Graham Charters’ excellent OSGi Community Event 2011 5 Optimize presentation @ http://slidesha.re/q8EHFp woensdag 16 november 11
  • 4. Modularity Maturity Model woensdag 16 november 11
  • 5. 1. Ad Hoc • Flat, manual class path • Single name space • Full visibility and normal accessibility • Monolithic • Highly coupled • Split Packages • Add/Shuffle JARs until it works woensdag 16 november 11
  • 6. 1. Ad Hoc • Flat, manual class path • Single name space e l l H • Full visibility and normal accessibility • Monolithic AR • • Highly coupled Split Packages J • Add/Shuffle JARs until it works woensdag 16 november 11
  • 7. 2. Managed • Treat JARs as a module • JAR Identity • Naming • Versioning • Dependencies • Repositories woensdag 16 november 11
  • 8. 2. Managed a d • Treat JARs as a module n l o w he t • JAR Identity • Naming D o t • Versioning r n e • Dependencies n t e • Repositories i woensdag 16 november 11
  • 9. 3. Contracts • Interface based design, POJOs • Provide contracts for each connection between JARs • Implementation details inside the JAR • Versioning on contracts woensdag 16 november 11
  • 10. 3. Contracts • d e r a Interface based design, o POJOs • Provide contracts for l s s k s c a a each connection l h between JARs • Implementation details inside the JAR c • Versioning on contracts woensdag 16 november 11
  • 11. 4. Fences • Explicitly Import/Export packages • Explicitly specify requirements and capabilities • Enforce the module boundaries • Semantic Versioning • Side-by-side versioning supported woensdag 16 november 11
  • 12. 4. Fences • Explicitly Import/Export packages • Explicitly specify requirements and capabilities o d! • • Enforce the module boundaries Semantic Versioning Go • Side-by-side versioning supported woensdag 16 november 11
  • 13. 5. Optimize • Exploit concepts for modules and contracts • Delegated Control • Optimize the code base to leverage new patterns: • Extender • Whiteboard • Repeat woensdag 16 november 11
  • 14. 5. Optimize • Exploit concepts for modules and contracts • Delegated Control • Optimize the code base to leverage new patterns: • Extender • Whiteboard • Repeat woensdag 16 november 11
  • 15. Today 1. Ad Hoc 2. 3. Managed Contracts 4. Fences 5. Optimize woensdag 16 november 11
  • 16. Today 1. Ad Hoc Enterprise DI vn ,C m ice ing 2. 3. Ivy Managed Contracts gu r saw sp jig 4. Fences 5. Optimize woensdag 16 november 11
  • 17. Today 1. Ad Hoc Enterprise DI vn ,C m ice ing 2. 3. Ivy Managed Contracts gu r OSGi saw s p jig 4. Fences 5. Optimize woensdag 16 november 11
  • 18. Today 1. Ad Hoc Enterprise DI vn ,C m ice ing 2. 3. Ivy Managed Contracts gu r OSGi saw s p jig 4. Fences 5. Optimize woensdag 16 november 11
  • 22. Class Space package class woensdag 16 november 11
  • 23. Class Space package class woensdag 16 november 11
  • 24. Class Space package class woensdag 16 november 11
  • 25. Class Space V1 V2 woensdag 16 november 11
  • 26. Class Space V1 V2 woensdag 16 november 11
  • 27. Class Space V1 V2 Class.forName woensdag 16 november 11
  • 28. Class Space V1 V2 x x Class.forName woensdag 16 november 11
  • 29. Class Space V1 V2 x x Class.forName woensdag 16 november 11
  • 31. Why Class.forName? ! ! ! ! ! ! ! ! ! ! ! ! N G! P LI C O U woensdag 16 november 11
  • 32. How to get an Instance? That is the Question! woensdag 16 november 11
  • 33. Couplings modular not Example modular type FooImpl foo; Foo foo = (Foo) instance Class.forName(“FooImpl”) .newInstance(); woensdag 16 november 11
  • 34. Type Coupling class Client {} class FooImpl{} woensdag 16 november 11
  • 35. Type Coupling class Client {} class FooImpl{} woensdag 16 november 11
  • 36. Type Coupling class Client {} class FooImpl{} interface Foo{} woensdag 16 november 11
  • 37. Type Coupling class Client {} class FooImpl{} interface Foo{} uses implements woensdag 16 november 11
  • 38. Type Coupling class Client {} class FooImpl{} interface Foo{} uses implements get instance woensdag 16 november 11
  • 39. Type Coupling class Client {} class FooImpl{} o r ?l o ut s n einterface Foo{} C s uses implements Is get instance woensdag 16 november 11
  • 40. Instance Coupling • New • Factory • Inversion of Control • Broker woensdag 16 november 11
  • 41. Instance Coupling client container impl • New • Factory • Inversion of Control • Broker woensdag 16 november 11
  • 42. Instance Coupling client container impl • New • Factory • Inversion of Control • Broker woensdag 16 november 11
  • 43. Instance Coupling client container impl • New • Factory • Inversion of Control • Broker woensdag 16 november 11
  • 44. Instance Coupling client container impl • New • Factory • Inversion of Control • Broker woensdag 16 november 11
  • 45. Instance Coupling client container impl • New • Factory • Inversion of Control • Broker woensdag 16 november 11
  • 46. µServices Primitive • Broker Pattern • Direction • Contract • Publish • Find • Bind • Who’s Listening? • Cardinality woensdag 16 november 11
  • 47. µServices Primitive • Broker Pattern • Direction • Contract • Publish A S B • Find • Bind • Who’s listening? • Cardinality woensdag 16 november 11
  • 48. Patterns • Factory • Listener • Discovery • Distribution woensdag 16 november 11
  • 49. 5. Optimize E woensdag 16 november 11
  • 50. 5. Optimize A B C D E F G H I woensdag 16 november 11
  • 51. Back to the Brick Wall woensdag 16 november 11
  • 52. Migration A B C D E F G H I woensdag 16 november 11
  • 53. Migration A B C D E F G H I woensdag 16 november 11
  • 54. Migration A B C D E F G H I woensdag 16 november 11
  • 55. Migration A B C D E F G H I woensdag 16 november 11
  • 56. Migration A B C D E F G H I woensdag 16 november 11
  • 57. So we need a broker that runs without fences... woensdag 16 november 11
  • 58. So we need a Broker that runs without Fences...SR o j o P woensdag 16 november 11
  • 59. POJOSR • Developed by Karl Pauls • JavaOne presentation 24811 • http://pojosr.googlecode.com • Based on Apache Felix woensdag 16 november 11
  • 60. Gain • Existing libraries and many bundles work without modification • Bundle (JAR) activation (have their own local main) • µServices • Dynamicity (in µServices) • Extender pattern (react on JAR content) • Migration path to Fences (OSGi) • Existing OSGi and non-OSGi tooling can be used woensdag 16 november 11
  • 61. Loss • No dynamic install/uninstall/update • No side-by-side versioning • No module privacy • No explicit dependencies • No Lazy activation • No Bundle classpath • No Native Code support woensdag 16 november 11
  • 62. Migrating • Example: extend ant … the tool we all (sometimes) love and (sometimes) hate • We make different <helloXXX/> tasks woensdag 16 november 11
  • 63. Ant Your Service • Base ant • Activator • Extender ant ... ... woensdag 16 november 11
  • 64. Ant Your Service • Base ant pojosr ant • Activator • Extender ant ... ... woensdag 16 november 11
  • 65. Ant Your Service • Base ant pojosr ant • Activator • Extender ant ... ... woensdag 16 november 11
  • 66. Ant Your Service Class<Task> • Base ant pojosr ant • Activator • Extender ant ... ... woensdag 16 november 11
  • 67. Ant Your Service Class<Task> hello activator • Base ant pojosr ant • Activator • Extender ant ... ... woensdag 16 november 11
  • 68. Ant Your Service Class<Task> hello activator • Base ant pojosr ant • Activator • Extender ant ... ... woensdag 16 november 11
  • 69. Ant Your Service <project name="master"> <path id="bundles"> <fileset dir="bundles"> <include name="*.jar" /> </fileset> </path> <taskdef name="auto" classname="aQute.ant.connect.AutoTask" classpathref="bundles" /> <auto /> <helloActivator /> </project> woensdag 16 november 11
  • 70. Ant Your Service public class Activator implements BundleActivator { public void start(BundleContext context) throws Exception { Properties props = new Properties(); props.put("ant", "helloActivator"); context.registerService(Class.class.getName(), HelloTask.class, props); } public void stop(BundleContext context) throws Exception { } } public class HelloTask extends Task { String message = "Hello Activator"; public void execute() { System.out.println(message); } public void setMessage(String m) { this.message = m; } } woensdag 16 november 11
  • 71. Ant Your Service public class Activator implements BundleActivator { t public void start(BundleContext context) throws Exception { f Properties props = new Properties(); u props.put("ant", "helloActivator"); r context.registerService(Class.class.getName(), c HelloTask.class, props); } public void stop(BundleContext context) throws Exception { } } public class HelloTask extends Task { String message = "Hello Activator"; public void execute() { System.out.println(message); } public void setMessage(String m) { this.message = m; } } woensdag 16 november 11
  • 72. Ant Your Service Class<Task> hello activator • Base ant pojosr pojo ant • Activator • Extender ant ... ... woensdag 16 november 11
  • 73. Ant Your Service Class<Task> hello activator • Base ant pojosr pojo ant hello extendee • Activator • Extender ant ... ... woensdag 16 november 11
  • 74. Ant Your Service Class<Task> hello activator • Base ant pojosr pojo ant hello extendee • Activator Manifest-Version: 1.0 • ant Ant-Task: helloExtender=HelloTask Extender ... ... woensdag 16 november 11
  • 75. Ant Your Service public class HelloTask extends Task { String message = "Hello Extender"; public void execute() { System.out.println(message); } public void setMessage(String m) { this.message = m; } } woensdag 16 november 11
  • 76. Ant Your Service public class HelloTask extends Task { String message = "Hello Extender"; public void execute() { System.out.println(message); } public void setMessage(String m) { this.message = m; } } u ft c r N O woensdag 16 november 11
  • 77. Conclusion • Moving to Fences is hard because popular instance creation patterns are fundamentally not modular • Services-First approach works without Fences • After completion, moving to Fences is much easier woensdag 16 november 11
  • 78. Good Fences Make Good Neighbors woensdag 16 november 11
  • 79. Good Fences od ul es Make Good Neighbors m woensdag 16 november 11