SlideShare a Scribd company logo
Dynamic modular Web applications
    with Equinox and Vaadin
               Kai Tödter
         Siemens Corporate Technology
Who am I?
 Software Architect/Engineer at Siemens
  Corporate Technology
 Eclipse RCP expert and OSGi enthusiast
 Open Source advocate
 Committer at e4 and Platform UI
 E-mail: kai.toedter@siemens.com
 Twitter: twitter.com/kaitoedter
 Blog: toedter.com/blog

5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   2
Outline
    Demo
    Server-side OSGi
    Vaadin
    Whiteboard Pattern
    OSGi Declarative Services (DS)
    Code deep dive
    Discussion



5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   3
Demo




5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   4
Download & Blog
 You can download the demo projects (6,8 MB,
  including the target platform) at
  http://www.toedter.com/download/vaadin/os
  gi-vaadin-demo.zip
 See also my blog “Dynamic modular Web
  Applications with Vaadin and OSGi”
  http://www.toedter.com/blog/?p=412




5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   5
Server-side OSGi




Picture from
http://www.sxc.hu/photo/1043923
5/9/2011     © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   6
Server-side OSGi
 For this demo I use Equinox as OSGi container
 To run server-side Equinox there’s 2 choices:
        Embed Equinox in a servlet container
        Embed a HTTP server in Equinox




5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   7
Embed Equinox in a Servlet Container
 Needed bundles:
          org.eclipse.equinox.servletbridge
          org.eclipse.equinox.servletbridge.http
          org.eclipse.equinox.http.servlet
          [optional] org.eclipse.equinox.http.registry


 See http://www.eclipse.org/equinox/server/
  http_in_container.php


5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   8
Embed Jetty in Equinox
 Needed bundles:
          org.eclipse.equinox.http.jetty
          org.eclipse.equinox.http.servlet
          org.mortbay.jetty
          org.apache.commons.logging
          javax.servlet
          [optional] org.eclipse.equinox.http.registry


 See http://www.eclipse.org/equinox/server/
  http_in_equinox.php
5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   9
Hello, JAX! OSGi Servlet Demo




Picture by Office Online, iStockPhoto
http://office.microsoft.com/en-us/images/results.aspx?qu=world#ai:MP900444203|
5/9/2011      © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   10
5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   11
What is Vaadin?
 Server-based RIA Framework
 Uses Google Web Toolkit (GWT) as rendering
  engine
 Pure Java, no JavaScript, no configuration
 Rich widget set
 Out of the box OSGi support
        Only one JAR file, already an OSGi bundle




5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   12
Demo

5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   13
The Whiteboard Pattern
 Problem: Often a service provides an
  implementation of the publisher/subscriber
  design pattern and provides methods to
  register listeners for notifications
 The OSGi service model provides a service
  registry with these notification mechanisms
  already!
 So:
   Don’t get a service and register as listener
   Be a service yourself and register with the OSGi
    service registry!
                                                       14
Example: The Listener Pattern
 Clients use ApplicationService to register view and
  action contributions
 Client is responsible for handling dynamic behavior




                                                        15
Example: The Whiteboard Pattern
 Clients register view and action contributions as services
 Application manager is responsible for handling dynamic
  behavior




                                                               16
Whiteboard Pattern in Vaadin Demo
 The Action and View contribution managers
  are NOT services
      Instead, they are wrapped in a OSGi Declarative
       Services (DS) component
 All action and view contributions are OSGi
  services and implement
      IActionContribution
      IViewContribution



17
OSGi Declarative Services


      Active Bundle                                                                                  Active Bundle

           Component                                                                                   Component
                                                             Service
           Component                                                                                     Component
            Instance                           reference                                                  Instance

                                                                         provide
           Component                                                                                      Component
           Description                                                                                    Description



5/9/2011    © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   18
Life Cycle



           DS-powered Bundle                                                      Service Component
                                                                                    Runtime (SCR)

                 Component
                Component
               Component                                                          create




5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   19
Declaring a Component
 Specify component description(s) via
  Service-Component manifest header
      Service-Component: OSGI-INF/treeView.xml



 Specify the implementation class
      <component xmlns="http://www.osgi.org/xmlns/scr/v1.1.0">
         <implementation class="...TreeView"/>
      </component>




5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   20
Providing a Service
 Specify each service interface
 By default components providing a service are
  created on demand (lazy)
           <service>
              <provide interface="...IViewContribution"/>
              <provide interface="...IActionContribution"/>
           </service>




5/9/2011     © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   21
Referencing Services
 Specify the service interface
 Specify bind and unbind methods
 Specify the cardinality
           <reference interface="...IPersonManager"
                  bind="setPersonManager"
                  unbind="removePersonManager"
                  cardinality="1..1"/>




5/9/2011     © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   22
Further Reading
 Chris Brind:
        In Bed with Vaadin and OSGi
        http://www.perplentropy.com/2010/02/in-bed-with-
         vaadin-and-osgi.html
        I use Chris’ bundles in this demo
 Neil Bartlett:
        Vaadin OSGi bridge at GitHub
        https://github.com/njbartlett/VaadinOSGi
 Petter Holmström:
        Creating a Modular Vaadin Application with OSGi
        http://vaadin.com/wiki/-
         /wiki/Main/Creating%20a%20Modular%20Vaadin%20
         Application%20with%20OSGi
5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   23
Putting it all together…
 Main demo application is a DS component
        factory='vaadin.app' => used Chris Brind’s
         implementation
        0..n service references to
             IViewContribution
             IActionContribution


 Source code will be shown soon… 



5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   24
Resources, Images and Themes
 Resources (e.g. images) have to be put in a
  fragment with the com.vaadin bundle as host
 See project
  com.siemens.ct.osgi.vaadin.pm.theme




5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   25
Code Deep Dive




Picture from
http://www.sxc.hu/photo/1159613
5/9/2011     © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   26
Picture from
http://www.sxc.hu/photo/922004
5/9/2011     © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   27
License
 This work is licensed under the Creative Commons
  Attribution-Noncommercial-No Derivative Works 3.0
  Germany License
        See http://creativecommons.org/licenses/by-nc-
         nd/3.0/de/deed.en_US




5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   28
Picture Index
Many thanks to the authors of the following pictures:
 Slide „Server-side OSGi“: http://www.sxc.hu/photo/1043923
 Slide „Hello JAX!“: http://office.microsoft.com/en-
  us/images/results.aspx?qu=world#ai:MP900444203|
 Slide „Reindeer“ Animation:
  http://www.sxc.hu/photo/1138596
 Slide „Code Browsing“: http://www.sxc.hu/photo/1159613
 Slide “Discussion”: http://www.sxc.hu/photo/922004




5/9/2011   © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License.   29

More Related Content

What's hot

2013.devcon3 liferay and google authenticator integration rafik_harabi
2013.devcon3 liferay and google authenticator integration rafik_harabi2013.devcon3 liferay and google authenticator integration rafik_harabi
2013.devcon3 liferay and google authenticator integration rafik_harabi
Rafik HARABI
 
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloakDevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
Hitachi, Ltd. OSS Solution Center.
 
JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1
SFI
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator Titanium
Aaron Saunders
 
Extending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native ModulesExtending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native Modules
omorandi
 
P to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to ContainersP to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to Containers
VMware Tanzu
 
Beyond OSGi Software Architecture
Beyond OSGi Software ArchitectureBeyond OSGi Software Architecture
Beyond OSGi Software Architecture
Jeroen van Grondelle
 
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
Rafik HARABI
 

What's hot (8)

2013.devcon3 liferay and google authenticator integration rafik_harabi
2013.devcon3 liferay and google authenticator integration rafik_harabi2013.devcon3 liferay and google authenticator integration rafik_harabi
2013.devcon3 liferay and google authenticator integration rafik_harabi
 
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloakDevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
DevConf.CZ 2020 @ Brno, Czech Republic : WebAuthn support for keycloak
 
JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator Titanium
 
Extending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native ModulesExtending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native Modules
 
P to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to ContainersP to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to Containers
 
Beyond OSGi Software Architecture
Beyond OSGi Software ArchitectureBeyond OSGi Software Architecture
Beyond OSGi Software Architecture
 
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik HarabiEclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
EclipseCon Europe 2015 - liferay modularity patterns using OSGi -Rafik Harabi
 

Similar to Dynamic and modular Web Applications with Equinox and Vaadin

Service oriented component model
Service oriented component modelService oriented component model
Service oriented component model
ravindrareddy
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGi
Paul Bakker
 
Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?
Phil Estes
 
Exploring the GitHub Service Universe
Exploring the GitHub Service UniverseExploring the GitHub Service Universe
Exploring the GitHub Service Universe
Björn Kimminich
 
Liberty Buildpack: Designed for Extension - Integrating your services in Blue...
Liberty Buildpack: Designed for Extension - Integrating your services in Blue...Liberty Buildpack: Designed for Extension - Integrating your services in Blue...
Liberty Buildpack: Designed for Extension - Integrating your services in Blue...
Rohit Kelapure
 
.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps
VMware Tanzu
 
Background Tasks with Worker Service
Background Tasks with Worker ServiceBackground Tasks with Worker Service
Background Tasks with Worker Service
ssusere19c741
 
.NET Intro & Dependency Injection Workshop
.NET Intro & Dependency Injection Workshop.NET Intro & Dependency Injection Workshop
.NET Intro & Dependency Injection Workshop
Serhii Kokhan
 
Simple, battle proven microservices strategy
Simple, battle proven microservices strategySimple, battle proven microservices strategy
Simple, battle proven microservices strategy
Erez Lotan
 
IBM Z for the Digital Enterprise 2018 - Offering API channel to application a...
IBM Z for the Digital Enterprise 2018 - Offering API channel to application a...IBM Z for the Digital Enterprise 2018 - Offering API channel to application a...
IBM Z for the Digital Enterprise 2018 - Offering API channel to application a...
DevOps for Enterprise Systems
 
Serverless Spring 오충현
Serverless Spring 오충현Serverless Spring 오충현
Serverless Spring 오충현
VMware Tanzu Korea
 
.NET and Kubernetes: Bringing Legacy .NET Into the Modern World with Pivotal ...
.NET and Kubernetes: Bringing Legacy .NET Into the Modern World with Pivotal ....NET and Kubernetes: Bringing Legacy .NET Into the Modern World with Pivotal ...
.NET and Kubernetes: Bringing Legacy .NET Into the Modern World with Pivotal ...
VMware Tanzu
 
Zero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessZero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or less
Davalen LLC
 
Stateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsStateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystems
Nuno Caneco
 
An architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbencyAn architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbency
Michael Elder
 
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with KubernetesSumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic
 
SynapseIndia mobile apps architecture
SynapseIndia mobile apps architectureSynapseIndia mobile apps architecture
SynapseIndia mobile apps architecture
Synapseindiappsdevelopment
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
Marcin Grzejszczak
 
Flex for enterprise applications
Flex for enterprise applicationsFlex for enterprise applications
Flex for enterprise applications
darshanvartak
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
Oracle Korea
 

Similar to Dynamic and modular Web Applications with Equinox and Vaadin (20)

Service oriented component model
Service oriented component modelService oriented component model
Service oriented component model
 
Moduarlity patterns with OSGi
Moduarlity patterns with OSGiModuarlity patterns with OSGi
Moduarlity patterns with OSGi
 
Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?
 
Exploring the GitHub Service Universe
Exploring the GitHub Service UniverseExploring the GitHub Service Universe
Exploring the GitHub Service Universe
 
Liberty Buildpack: Designed for Extension - Integrating your services in Blue...
Liberty Buildpack: Designed for Extension - Integrating your services in Blue...Liberty Buildpack: Designed for Extension - Integrating your services in Blue...
Liberty Buildpack: Designed for Extension - Integrating your services in Blue...
 
.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps
 
Background Tasks with Worker Service
Background Tasks with Worker ServiceBackground Tasks with Worker Service
Background Tasks with Worker Service
 
.NET Intro & Dependency Injection Workshop
.NET Intro & Dependency Injection Workshop.NET Intro & Dependency Injection Workshop
.NET Intro & Dependency Injection Workshop
 
Simple, battle proven microservices strategy
Simple, battle proven microservices strategySimple, battle proven microservices strategy
Simple, battle proven microservices strategy
 
IBM Z for the Digital Enterprise 2018 - Offering API channel to application a...
IBM Z for the Digital Enterprise 2018 - Offering API channel to application a...IBM Z for the Digital Enterprise 2018 - Offering API channel to application a...
IBM Z for the Digital Enterprise 2018 - Offering API channel to application a...
 
Serverless Spring 오충현
Serverless Spring 오충현Serverless Spring 오충현
Serverless Spring 오충현
 
.NET and Kubernetes: Bringing Legacy .NET Into the Modern World with Pivotal ...
.NET and Kubernetes: Bringing Legacy .NET Into the Modern World with Pivotal ....NET and Kubernetes: Bringing Legacy .NET Into the Modern World with Pivotal ...
.NET and Kubernetes: Bringing Legacy .NET Into the Modern World with Pivotal ...
 
Zero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or lessZero to Portlet in 20 minutes or less
Zero to Portlet in 20 minutes or less
 
Stateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystemsStateful mock servers to the rescue on REST ecosystems
Stateful mock servers to the rescue on REST ecosystems
 
An architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbencyAn architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbency
 
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with KubernetesSumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
 
SynapseIndia mobile apps architecture
SynapseIndia mobile apps architectureSynapseIndia mobile apps architecture
SynapseIndia mobile apps architecture
 
Consumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice ArchitectureConsumer Driven Contracts and Your Microservice Architecture
Consumer Driven Contracts and Your Microservice Architecture
 
Flex for enterprise applications
Flex for enterprise applicationsFlex for enterprise applications
Flex for enterprise applications
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
 

Recently uploaded

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 

Recently uploaded (20)

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 

Dynamic and modular Web Applications with Equinox and Vaadin

  • 1. Dynamic modular Web applications with Equinox and Vaadin Kai Tödter Siemens Corporate Technology
  • 2. Who am I?  Software Architect/Engineer at Siemens Corporate Technology  Eclipse RCP expert and OSGi enthusiast  Open Source advocate  Committer at e4 and Platform UI  E-mail: kai.toedter@siemens.com  Twitter: twitter.com/kaitoedter  Blog: toedter.com/blog 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 2
  • 3. Outline  Demo  Server-side OSGi  Vaadin  Whiteboard Pattern  OSGi Declarative Services (DS)  Code deep dive  Discussion 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 3
  • 4. Demo 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 4
  • 5. Download & Blog  You can download the demo projects (6,8 MB, including the target platform) at http://www.toedter.com/download/vaadin/os gi-vaadin-demo.zip  See also my blog “Dynamic modular Web Applications with Vaadin and OSGi” http://www.toedter.com/blog/?p=412 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 5
  • 6. Server-side OSGi Picture from http://www.sxc.hu/photo/1043923 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 6
  • 7. Server-side OSGi  For this demo I use Equinox as OSGi container  To run server-side Equinox there’s 2 choices:  Embed Equinox in a servlet container  Embed a HTTP server in Equinox 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 7
  • 8. Embed Equinox in a Servlet Container  Needed bundles:  org.eclipse.equinox.servletbridge  org.eclipse.equinox.servletbridge.http  org.eclipse.equinox.http.servlet  [optional] org.eclipse.equinox.http.registry  See http://www.eclipse.org/equinox/server/ http_in_container.php 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 8
  • 9. Embed Jetty in Equinox  Needed bundles:  org.eclipse.equinox.http.jetty  org.eclipse.equinox.http.servlet  org.mortbay.jetty  org.apache.commons.logging  javax.servlet  [optional] org.eclipse.equinox.http.registry  See http://www.eclipse.org/equinox/server/ http_in_equinox.php 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 9
  • 10. Hello, JAX! OSGi Servlet Demo Picture by Office Online, iStockPhoto http://office.microsoft.com/en-us/images/results.aspx?qu=world#ai:MP900444203| 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 10
  • 11. 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 11
  • 12. What is Vaadin?  Server-based RIA Framework  Uses Google Web Toolkit (GWT) as rendering engine  Pure Java, no JavaScript, no configuration  Rich widget set  Out of the box OSGi support  Only one JAR file, already an OSGi bundle 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 12
  • 13. Demo 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 13
  • 14. The Whiteboard Pattern  Problem: Often a service provides an implementation of the publisher/subscriber design pattern and provides methods to register listeners for notifications  The OSGi service model provides a service registry with these notification mechanisms already!  So:  Don’t get a service and register as listener  Be a service yourself and register with the OSGi service registry! 14
  • 15. Example: The Listener Pattern  Clients use ApplicationService to register view and action contributions  Client is responsible for handling dynamic behavior 15
  • 16. Example: The Whiteboard Pattern  Clients register view and action contributions as services  Application manager is responsible for handling dynamic behavior 16
  • 17. Whiteboard Pattern in Vaadin Demo  The Action and View contribution managers are NOT services  Instead, they are wrapped in a OSGi Declarative Services (DS) component  All action and view contributions are OSGi services and implement  IActionContribution  IViewContribution 17
  • 18. OSGi Declarative Services Active Bundle Active Bundle Component Component Service Component Component Instance reference Instance provide Component Component Description Description 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 18
  • 19. Life Cycle DS-powered Bundle Service Component Runtime (SCR) Component Component Component create 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 19
  • 20. Declaring a Component  Specify component description(s) via Service-Component manifest header Service-Component: OSGI-INF/treeView.xml  Specify the implementation class <component xmlns="http://www.osgi.org/xmlns/scr/v1.1.0"> <implementation class="...TreeView"/> </component> 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 20
  • 21. Providing a Service  Specify each service interface  By default components providing a service are created on demand (lazy) <service> <provide interface="...IViewContribution"/> <provide interface="...IActionContribution"/> </service> 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 21
  • 22. Referencing Services  Specify the service interface  Specify bind and unbind methods  Specify the cardinality <reference interface="...IPersonManager" bind="setPersonManager" unbind="removePersonManager" cardinality="1..1"/> 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 22
  • 23. Further Reading  Chris Brind:  In Bed with Vaadin and OSGi  http://www.perplentropy.com/2010/02/in-bed-with- vaadin-and-osgi.html  I use Chris’ bundles in this demo  Neil Bartlett:  Vaadin OSGi bridge at GitHub  https://github.com/njbartlett/VaadinOSGi  Petter Holmström:  Creating a Modular Vaadin Application with OSGi  http://vaadin.com/wiki/- /wiki/Main/Creating%20a%20Modular%20Vaadin%20 Application%20with%20OSGi 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 23
  • 24. Putting it all together…  Main demo application is a DS component  factory='vaadin.app' => used Chris Brind’s implementation  0..n service references to  IViewContribution  IActionContribution  Source code will be shown soon…  5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 24
  • 25. Resources, Images and Themes  Resources (e.g. images) have to be put in a fragment with the com.vaadin bundle as host  See project com.siemens.ct.osgi.vaadin.pm.theme 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 25
  • 26. Code Deep Dive Picture from http://www.sxc.hu/photo/1159613 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 26
  • 27. Picture from http://www.sxc.hu/photo/922004 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 27
  • 28. License  This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License  See http://creativecommons.org/licenses/by-nc- nd/3.0/de/deed.en_US 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 28
  • 29. Picture Index Many thanks to the authors of the following pictures:  Slide „Server-side OSGi“: http://www.sxc.hu/photo/1043923  Slide „Hello JAX!“: http://office.microsoft.com/en- us/images/results.aspx?qu=world#ai:MP900444203|  Slide „Reindeer“ Animation: http://www.sxc.hu/photo/1138596  Slide „Code Browsing“: http://www.sxc.hu/photo/1159613  Slide “Discussion”: http://www.sxc.hu/photo/922004 5/9/2011 © Kai Tödter and others, Licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License. 29