SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
OSGi DevCon US 2013

DS, BP, EJB, CDI, WTF!?
Graham Charters, IBM

1

© 2013 IBM Corporation
Agenda

 Background
 Criteria
 Component models

 How to choose

2

© 2013 IBM Corporation
Why?

4

© 2013 IBM Corporation
Approach
 Provide some criteria to consider when making a component model choice
 Explain a little bit about the technologies
My beans are
dynamic and use
annotations.

 Describe how each rates against the criteria

Your beans smell!!
 Reasons aren’t always technical
 We probably won’t always agree

5

© 2013 IBM Corporation
Technical Criteria

 Extra-bean definition (e.g. XML-based
declarative model)
 Intra-bean definition (e.g. bean annotationbased declarative model)
 Extensibility

 Enterprise Qualities of Service
 Quality of Integration with OSGi

6

© 2013 IBM Corporation
Non-technical criteria

 Open Standards

 Open Source implementations
 Choice of implementations
 Availability of tools
 Existing assets
 Existing skills

7

© 2013 IBM Corporation
The technologies: DS, BP, EJB, CDI, WTF

 Declaratives Services (DS)
 Blueprint (not commonly known as BP)
 Enterprise JavaBeans (EJB)

 Contexts and Dependency Injection (CDI)
 World Taekwondo Federation (WTF)

Now with
added demos!

There are a number of other component models, but I’ve focused on the ones I heard
discussed most often. They’re also all based on open standards

8

© 2013 IBM Corporation
The demo

Http Service
Whiteboard

Http Service
alias=/xyz

9

Component
Servlet
Service

Time
Service

© 2013 IBM Corporation
Declarative Services
Criterion

DS

Inspiration

Popularity if DI frameworks, but
designed for OSGi

Approach

Extra-bean definition (XML-based
declarative model)
Build-time intra-bean definition
(annotations compiled to XML)

@Component
public class DiscountCalculatorImpl implements
DiscountCalculator {
private Logger logger;
@Reference(policy=DYNAMIC,
policyOption=GREEDY,
cardinality=MANDATORY)
void setLog( LogService log) { ... }
void unsetLog( LogService log) { ... }
void updatedLog( Map<String,?> ref ) { ... }
}

Extensibility

Schema extensibility

Enterprise QoS

No

OSGi Integration

Designed by OSGi for OSGi.
Includes Configuration
<component name=“DiscountCalculator“ …>
Admin

Open Standards

OSGi Alliance

Implementations

Eclipse Equinox &
Apache Felix

Tools

BND & BNDTools

10

<implementation
class="com.acme.utils.impl.DiscountCalculatorImpl"/>
<service>
<provide
interface="com.acme.utils.DiscountCalculator"/>
</service>
<reference name=“log"
interface="org.osgi.service.log.LogService"
bind="setLog" unbind="unsetLog"
updated=“updateLog" />
</component>
© 2013 IBM Corporation
Blueprint

Criterion

Blueprint

Inspiration

Spring & Spring DM (standardized by
SpringSource)

Approach

Extra-bean definition (XML-based
declarative model, includes bean-tobean wiring)
Intra-bean definition (Annotations –
Apache Aries Open Source only)

Extensibility

Through XML namespaces
– no runtime standard

Enterprise QoS

Transactions and
Persistence (Apache
Aries), Security (WebSphere
Application Server), Bus
(CXF), Camel, etc…

OSGi Integration

Some life-cycle compromises
Config Admin (open source)

Open Standards

OSGi Alliance
Updates in pipeline

Implementations

Eclipse Gemini &
Apache Aries

Tools

WebSphere Developer Tools (no
charge), Rational Application Developer

11

<?xml version="1.0" encoding="UTF-8"?>
<blueprint …>
<service id="DiscountCalculatorBeanService"
ref="DiscountCalculatorBean"
interface="com.acme.utils.DiscountCalculator" />
<bean id="DiscountCalculatorBean"
class="com.acme.utils.impl.DiscountCalculatorImpl">
<property name="logger" ref="loggerService" />
</bean>
<reference id="loggerService"
interface="com.acme.utils.Logger" />
</blueprint>

© 2013 IBM Corporation
Enterprise JavaBeans
Criterion

EJB

Inspiration

Version 1.0 - 15 years old

Approach

Inheritance & XML bindings (pre-3.0).
Intra-bean definition (bean annotationbased declarative model) (3.0 or later)

Extensibility

Nothing formal (defer to CDI)

Enterprise QoS

Transaction, Security, Remoting,
Persistence, Messaging

OSGi Integration

Core capabilities (proprietary)

Open Standards

JCP, OSGi specification in progress

Implementations

All JavaEE App Servers support EJB.
OSGi integration in WebSphere
Application Server, GlassFish, Apache
Aries, Apache OpenEJB

Tools

12

@Stateless
@Local(DiscountCalculator.class)
public class DiscountCalculatorImpl
implements DiscountCalculator {
@Resource(lookup="osgi:service/Logger")
private Logger logger;

public double discount() {
…
}
…
}

WebSphere Developer Tools (no
charge), Rational Application
Developer, Eclipse WTP

© 2013 IBM Corporation
Contexts and Dependency Injection
Criterion

CDI

Inspiration

JBoss Seam, Google Guice & Spring

Approach

Intra-bean definition (annotation-based
life-cycle and DI model), Extra-bean
opt-in beans.xml with additional config
(e.g. extensibility)

Extensibility

Interceptors, Decorators & Portable
Extensions

Enterprise QoS

@Inject @Service
StaticLogger logger;

None. Leverage CDI in other
component models (e.g. EJB)

OSGi Integration

@Named
@RequestScoped
@Component
public class DiscountCalculatorImpl
implements DiscountCalculator {

Core capabilities (Open Source)

public double dicount() {...}
...

Open Standards

JCP, OSGi Alliance in progress

Implementations

Weld-OSGi, Pax-CDI, Fighterfish

Tools

EE Vendors tools

13

}

© 2013 IBM Corporation
Some questions to ask when choosing

No one component model to rule them all

 What existing skills does my team have?
– Choose the closest match (e.g. Spring? Consider Blueprint)
 What existing assets do I have available?
– Choose the closest match
 Do I need Enterprise capabilities?
– If “yes”, consider Blueprint or EJB, if “no”, consider DS
 Do I want something based on a standard?
– If “yes”, familarize yourself with the scope and direction of existing standards
 Do I need something based on open source?
– Apache Felix, Eclipse Equinox, Apache Karaf, Eclipse Gemini, Apache Aries, Eclipse
Virgo, ….the list goes on…..
 What are the capabilities of my target runtime?
– If a component model isn’t supported, there’s little point choosing it
 What are the capabilities of my tool chain?
– If a component model isn’t supported, you’re asking for pain
 What if I use more than one component model?
– Leverage OSGi services as the common integration point
14

© 2013 IBM Corporation

Mais conteúdo relacionado

Mais procurados

EclipseCon 2011-Gemini Intro
EclipseCon 2011-Gemini IntroEclipseCon 2011-Gemini Intro
EclipseCon 2011-Gemini Intro
Shaun Smith
 
Oracle Ravello Presentation 7Dec16 v1
Oracle Ravello Presentation 7Dec16 v1Oracle Ravello Presentation 7Dec16 v1
Oracle Ravello Presentation 7Dec16 v1
Kurt Liu
 

Mais procurados (20)

Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGi
 
Remote Access and Monitoring of Connected IoT Assets
Remote Access and Monitoring of Connected IoT AssetsRemote Access and Monitoring of Connected IoT Assets
Remote Access and Monitoring of Connected IoT Assets
 
EclipseCon 2011-Gemini Intro
EclipseCon 2011-Gemini IntroEclipseCon 2011-Gemini Intro
EclipseCon 2011-Gemini Intro
 
Oracle Ravello Presentation 7Dec16 v1
Oracle Ravello Presentation 7Dec16 v1Oracle Ravello Presentation 7Dec16 v1
Oracle Ravello Presentation 7Dec16 v1
 
MySQL
MySQLMySQL
MySQL
 
Lightweight Java in the Cloud
Lightweight Java in the CloudLightweight Java in the Cloud
Lightweight Java in the Cloud
 
Osgi platform
Osgi platformOsgi platform
Osgi platform
 
JBoss Architect Forum London - October 2013 - Platform as a What?
JBoss Architect Forum London - October 2013 - Platform as a What?JBoss Architect Forum London - October 2013 - Platform as a What?
JBoss Architect Forum London - October 2013 - Platform as a What?
 
JBoss Architect Meetup - November 2013 - 'Play By The Rules'
JBoss Architect Meetup - November 2013 - 'Play By The Rules'JBoss Architect Meetup - November 2013 - 'Play By The Rules'
JBoss Architect Meetup - November 2013 - 'Play By The Rules'
 
PKS Networking with NSX-T: You Focus on your App, We'll Take Care of the Rest!
PKS Networking with NSX-T: You Focus on your App, We'll Take Care of the Rest!PKS Networking with NSX-T: You Focus on your App, We'll Take Care of the Rest!
PKS Networking with NSX-T: You Focus on your App, We'll Take Care of the Rest!
 
OSGi on Google Android using Apache Felix
OSGi on Google Android using Apache FelixOSGi on Google Android using Apache Felix
OSGi on Google Android using Apache Felix
 
OSGi on Android - Value Proposition
OSGi on Android - Value PropositionOSGi on Android - Value Proposition
OSGi on Android - Value Proposition
 
JavaCro'15 - Oracle Java Cloud Service Java PaaS - Duško Vukmanović
JavaCro'15 - Oracle Java Cloud Service  Java PaaS - Duško VukmanovićJavaCro'15 - Oracle Java Cloud Service  Java PaaS - Duško Vukmanović
JavaCro'15 - Oracle Java Cloud Service Java PaaS - Duško Vukmanović
 
Exploring the Functionality of the Rockwell Automation® Library of Process Ob...
Exploring the Functionality of the Rockwell Automation® Library of Process Ob...Exploring the Functionality of the Rockwell Automation® Library of Process Ob...
Exploring the Functionality of the Rockwell Automation® Library of Process Ob...
 
How Capgemini Built a Pan-European Tax Messaging System Using Oracle Fusion M...
How Capgemini Built a Pan-European Tax Messaging System Using Oracle Fusion M...How Capgemini Built a Pan-European Tax Messaging System Using Oracle Fusion M...
How Capgemini Built a Pan-European Tax Messaging System Using Oracle Fusion M...
 
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
JavaCro'15 - HTTP2 Comes to Java! - David DelabasseeJavaCro'15 - HTTP2 Comes to Java! - David Delabassee
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
 
Systems on the Edge—Your Stepping Stones into Oracle Public Cloud and the Paa...
Systems on the Edge—Your Stepping Stones into Oracle Public Cloud and the Paa...Systems on the Edge—Your Stepping Stones into Oracle Public Cloud and the Paa...
Systems on the Edge—Your Stepping Stones into Oracle Public Cloud and the Paa...
 
[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...
[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...
[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...
 
Making Microservices Smarter with Istio, Envoy and Pivotal Ingress Router
Making Microservices Smarter with Istio, Envoy and Pivotal Ingress RouterMaking Microservices Smarter with Istio, Envoy and Pivotal Ingress Router
Making Microservices Smarter with Istio, Envoy and Pivotal Ingress Router
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015
 

Destaque

Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis NobelTesting OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
mfrancis
 
Smart and Highly Scalable Lifecycle Management for Embedded Devices - Thomas ...
Smart and Highly Scalable Lifecycle Management for Embedded Devices - Thomas ...Smart and Highly Scalable Lifecycle Management for Embedded Devices - Thomas ...
Smart and Highly Scalable Lifecycle Management for Embedded Devices - Thomas ...
mfrancis
 

Destaque (6)

Never a Wrong (Semantic) Version Again! - Ferry Huberts
Never a Wrong (Semantic) Version Again! - Ferry HubertsNever a Wrong (Semantic) Version Again! - Ferry Huberts
Never a Wrong (Semantic) Version Again! - Ferry Huberts
 
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis NobelTesting OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
Testing OSGi the "groovy" way - Lars Pfannenschmidt, Dennis Nobel
 
Powering Dynamic M2M Event Processing with OSGi - W Bowers
Powering Dynamic M2M Event Processing with OSGi - W BowersPowering Dynamic M2M Event Processing with OSGi - W Bowers
Powering Dynamic M2M Event Processing with OSGi - W Bowers
 
Smart and Highly Scalable Lifecycle Management for Embedded Devices - Thomas ...
Smart and Highly Scalable Lifecycle Management for Embedded Devices - Thomas ...Smart and Highly Scalable Lifecycle Management for Embedded Devices - Thomas ...
Smart and Highly Scalable Lifecycle Management for Embedded Devices - Thomas ...
 
OSGi in Telematics - Volker Braun
OSGi in Telematics - Volker BraunOSGi in Telematics - Volker Braun
OSGi in Telematics - Volker Braun
 
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho DelchevWebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
 

Semelhante a DS, BP, EJB, CDI, WTF!? - Graham Charters

Semelhante a DS, BP, EJB, CDI, WTF!? - Graham Charters (20)

DS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham ChartersDS, BP, EJB, CDI, WTF!? - Graham Charters
DS, BP, EJB, CDI, WTF!? - Graham Charters
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Review
 
Sightly_techInsight
Sightly_techInsightSightly_techInsight
Sightly_techInsight
 
CDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily JiangCDI Integration in OSGi - Emily Jiang
CDI Integration in OSGi - Emily Jiang
 
How to put 100k lines of code into the (Google) cloud: storms and rainbows
How to put 100k lines of code into the (Google) cloud: storms and rainbowsHow to put 100k lines of code into the (Google) cloud: storms and rainbows
How to put 100k lines of code into the (Google) cloud: storms and rainbows
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
RTC/CLM 5.0 Adoption Paths: Deploying in 16 Steps
 RTC/CLM 5.0 Adoption Paths: Deploying in 16 Steps RTC/CLM 5.0 Adoption Paths: Deploying in 16 Steps
RTC/CLM 5.0 Adoption Paths: Deploying in 16 Steps
 
Impact2014: Introduction to the IBM Java Tools
Impact2014: Introduction to the IBM Java ToolsImpact2014: Introduction to the IBM Java Tools
Impact2014: Introduction to the IBM Java Tools
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's How
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009
 
Grails 101
Grails 101Grails 101
Grails 101
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
SPCA2013 - Building a SharePoint Factory
SPCA2013 - Building a SharePoint FactorySPCA2013 - Building a SharePoint Factory
SPCA2013 - Building a SharePoint Factory
 
PAPI and Promotional Deployment
PAPI and Promotional DeploymentPAPI and Promotional Deployment
PAPI and Promotional Deployment
 
AEM Sightly Deep Dive
AEM Sightly Deep DiveAEM Sightly Deep Dive
AEM Sightly Deep Dive
 
Framework for Web Automation Testing
Framework for Web Automation TestingFramework for Web Automation Testing
Framework for Web Automation Testing
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patterns
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
Extending uBuild and uDeploy with Plugins
Extending uBuild and uDeploy with PluginsExtending uBuild and uDeploy with Plugins
Extending uBuild and uDeploy with Plugins
 

Mais de 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
 
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
 
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
 

Mais de 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)
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

DS, BP, EJB, CDI, WTF!? - Graham Charters

  • 1. OSGi DevCon US 2013 DS, BP, EJB, CDI, WTF!? Graham Charters, IBM 1 © 2013 IBM Corporation
  • 2. Agenda  Background  Criteria  Component models  How to choose 2 © 2013 IBM Corporation
  • 3. Why? 4 © 2013 IBM Corporation
  • 4. Approach  Provide some criteria to consider when making a component model choice  Explain a little bit about the technologies My beans are dynamic and use annotations.  Describe how each rates against the criteria Your beans smell!!  Reasons aren’t always technical  We probably won’t always agree 5 © 2013 IBM Corporation
  • 5. Technical Criteria  Extra-bean definition (e.g. XML-based declarative model)  Intra-bean definition (e.g. bean annotationbased declarative model)  Extensibility  Enterprise Qualities of Service  Quality of Integration with OSGi 6 © 2013 IBM Corporation
  • 6. Non-technical criteria  Open Standards  Open Source implementations  Choice of implementations  Availability of tools  Existing assets  Existing skills 7 © 2013 IBM Corporation
  • 7. The technologies: DS, BP, EJB, CDI, WTF  Declaratives Services (DS)  Blueprint (not commonly known as BP)  Enterprise JavaBeans (EJB)  Contexts and Dependency Injection (CDI)  World Taekwondo Federation (WTF) Now with added demos! There are a number of other component models, but I’ve focused on the ones I heard discussed most often. They’re also all based on open standards 8 © 2013 IBM Corporation
  • 8. The demo Http Service Whiteboard Http Service alias=/xyz 9 Component Servlet Service Time Service © 2013 IBM Corporation
  • 9. Declarative Services Criterion DS Inspiration Popularity if DI frameworks, but designed for OSGi Approach Extra-bean definition (XML-based declarative model) Build-time intra-bean definition (annotations compiled to XML) @Component public class DiscountCalculatorImpl implements DiscountCalculator { private Logger logger; @Reference(policy=DYNAMIC, policyOption=GREEDY, cardinality=MANDATORY) void setLog( LogService log) { ... } void unsetLog( LogService log) { ... } void updatedLog( Map<String,?> ref ) { ... } } Extensibility Schema extensibility Enterprise QoS No OSGi Integration Designed by OSGi for OSGi. Includes Configuration <component name=“DiscountCalculator“ …> Admin Open Standards OSGi Alliance Implementations Eclipse Equinox & Apache Felix Tools BND & BNDTools 10 <implementation class="com.acme.utils.impl.DiscountCalculatorImpl"/> <service> <provide interface="com.acme.utils.DiscountCalculator"/> </service> <reference name=“log" interface="org.osgi.service.log.LogService" bind="setLog" unbind="unsetLog" updated=“updateLog" /> </component> © 2013 IBM Corporation
  • 10. Blueprint Criterion Blueprint Inspiration Spring & Spring DM (standardized by SpringSource) Approach Extra-bean definition (XML-based declarative model, includes bean-tobean wiring) Intra-bean definition (Annotations – Apache Aries Open Source only) Extensibility Through XML namespaces – no runtime standard Enterprise QoS Transactions and Persistence (Apache Aries), Security (WebSphere Application Server), Bus (CXF), Camel, etc… OSGi Integration Some life-cycle compromises Config Admin (open source) Open Standards OSGi Alliance Updates in pipeline Implementations Eclipse Gemini & Apache Aries Tools WebSphere Developer Tools (no charge), Rational Application Developer 11 <?xml version="1.0" encoding="UTF-8"?> <blueprint …> <service id="DiscountCalculatorBeanService" ref="DiscountCalculatorBean" interface="com.acme.utils.DiscountCalculator" /> <bean id="DiscountCalculatorBean" class="com.acme.utils.impl.DiscountCalculatorImpl"> <property name="logger" ref="loggerService" /> </bean> <reference id="loggerService" interface="com.acme.utils.Logger" /> </blueprint> © 2013 IBM Corporation
  • 11. Enterprise JavaBeans Criterion EJB Inspiration Version 1.0 - 15 years old Approach Inheritance & XML bindings (pre-3.0). Intra-bean definition (bean annotationbased declarative model) (3.0 or later) Extensibility Nothing formal (defer to CDI) Enterprise QoS Transaction, Security, Remoting, Persistence, Messaging OSGi Integration Core capabilities (proprietary) Open Standards JCP, OSGi specification in progress Implementations All JavaEE App Servers support EJB. OSGi integration in WebSphere Application Server, GlassFish, Apache Aries, Apache OpenEJB Tools 12 @Stateless @Local(DiscountCalculator.class) public class DiscountCalculatorImpl implements DiscountCalculator { @Resource(lookup="osgi:service/Logger") private Logger logger; public double discount() { … } … } WebSphere Developer Tools (no charge), Rational Application Developer, Eclipse WTP © 2013 IBM Corporation
  • 12. Contexts and Dependency Injection Criterion CDI Inspiration JBoss Seam, Google Guice & Spring Approach Intra-bean definition (annotation-based life-cycle and DI model), Extra-bean opt-in beans.xml with additional config (e.g. extensibility) Extensibility Interceptors, Decorators & Portable Extensions Enterprise QoS @Inject @Service StaticLogger logger; None. Leverage CDI in other component models (e.g. EJB) OSGi Integration @Named @RequestScoped @Component public class DiscountCalculatorImpl implements DiscountCalculator { Core capabilities (Open Source) public double dicount() {...} ... Open Standards JCP, OSGi Alliance in progress Implementations Weld-OSGi, Pax-CDI, Fighterfish Tools EE Vendors tools 13 } © 2013 IBM Corporation
  • 13. Some questions to ask when choosing No one component model to rule them all  What existing skills does my team have? – Choose the closest match (e.g. Spring? Consider Blueprint)  What existing assets do I have available? – Choose the closest match  Do I need Enterprise capabilities? – If “yes”, consider Blueprint or EJB, if “no”, consider DS  Do I want something based on a standard? – If “yes”, familarize yourself with the scope and direction of existing standards  Do I need something based on open source? – Apache Felix, Eclipse Equinox, Apache Karaf, Eclipse Gemini, Apache Aries, Eclipse Virgo, ….the list goes on…..  What are the capabilities of my target runtime? – If a component model isn’t supported, there’s little point choosing it  What are the capabilities of my tool chain? – If a component model isn’t supported, you’re asking for pain  What if I use more than one component model? – Leverage OSGi services as the common integration point 14 © 2013 IBM Corporation