SlideShare a Scribd company logo
Dynamis
Technologies




       h-ubu
  CDI in JavaScript
               Clement Escoffier
h-ubu - CDI in JavaScript
h-ubu - CDI in JavaScript
How do we do that
    in Java ?
h-ubu - CDI in JavaScript
Components
Interfaces
Dependency
 Injection
What do we have
 in JavaScript ?
Module Patterns

      +               -
Fix visibility   A bit complex
                 No interfaces
Module loaders

     +                -
Avoid <script>    Hard-coded
  Transitive     dependencies
   Reuse
MVC / MVVM

    +              -
   Code
                Pushing
organization
               the limits
UI Bindings
Well, so what’s
   h-ubu ?
Service-based
  Injection
 Framework
hub
components
var component = {
    configure : function(hub, conf) { },
    getComponentName : function() { },
    start : function() { },
    stop : function() {}
};



hub
      .registerComponent(component)
      .start()
contracts
var myService= {
    doSomething : function() {}
}
services
services
                      Service
                      Registry
  2 – Lookup,                      1 - Publication
Service Listener     3 - Binding
Substitutability
                   Loose-coupling



   Why services ?
                    Testable
Dynamic
var provider = {
    configure : function(hub, conf) {
        hub.provideService({
            component: this,
            contract: myService
        });
    },
    getComponentName : function() { },
    start : function() { },
    stop : function() {},
    doSomething : function() { … }
}
var consumer = {
    configure : function(hub, conf) {
        hub.requireService({
            component: this,
            contract: myService,
            field: "svc"
        });
    },
    getComponentName : function() { },
    start : function() {},
    stop : function() {},
    work : function() {
        this.svc.doSomething();
    }
}
var consumer = {
    configure : function(hub, conf) {
        hub.requireService({
            component: this,
            contract: myService,
            field: "svc"
        });
    },
    getComponentName : function() { },
    start : function() {},
    stop : function() {},
    work : function() {

    }
        this.svc.doSomething();          Proxy
}
events
var publisher = {
    configure : function(hub, conf) {}
    getComponentName : function() { },
    start : function() {},
    stop : function() {},
    work : function() {
        this.hub.publish(this, "my/topic",
        event);
    }
}
var receiver = {
    configure : function(hub, conf) {
        hub.subscribe(this, "my/(.)*?",
        this.receive);
    },
    getComponentName : function() { },
    start : function() {},
    stop : function() {},
    receive: function(event) { }
}
require.js/node.js
                     Composition


  Modularize your
    JavaScript
                      Standalone
Configurability
h bu
          Stop hacking,
         Start composing


http://nanoko-project.github.com/h-ubu/snapshot/

More Related Content

PPTX
h-ubu : CDI in JavaScript
PPT
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
PDF
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
PDF
Distributed work with Gearman
PDF
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
PPTX
ECMAScript 6 and the Node Driver
PPT
Function
PDF
Partial Application in Javascript (and why I like it)
h-ubu : CDI in JavaScript
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Distributed work with Gearman
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
ECMAScript 6 and the Node Driver
Function
Partial Application in Javascript (and why I like it)

What's hot (9)

PDF
Porting legacy apps to Griffon
PDF
Otimizando Aplicações em Rails
PPTX
SignalR
PDF
Introduction to asynchronous DB access using Node.js and MongoDB
PDF
Map kit light
PPTX
Javascript this keyword
PPTX
Hooking with WordPress by Rahul Prajapati - COEP FOSSMeet March 2019
PPTX
Mage Titans - Workshop - UI Components
PDF
Promises & limbo
Porting legacy apps to Griffon
Otimizando Aplicações em Rails
SignalR
Introduction to asynchronous DB access using Node.js and MongoDB
Map kit light
Javascript this keyword
Hooking with WordPress by Rahul Prajapati - COEP FOSSMeet March 2019
Mage Titans - Workshop - UI Components
Promises & limbo
Ad

Viewers also liked (20)

PPTX
Var Marketing Programs1 Rev 060909
PPTX
Circles of San Antonio Community Coalition and Bexar County DWI Task Force Ho...
PDF
Undangan (Kak Melly n Kak Dicky)
PPS
Nice weekend with music
PDF
How to do windows movie maker?
PDF
Extra Credit: Eye Tracking Finance Websites
DOCX
Evaluaciones de jheickson noguera ingenieria economica
ODP
Tecno1r Eso
PPT
Oracle 11i OID AD Integration
PPT
Menuju Koperasi Rspp Yang Mandiri &Modern
DOC
Information Skills - Targeting untapped user groups - text
PDF
Nilai un dan_us_2010_ips
PDF
Your Guide to Business + Legal Success in Latin America
PPT
Br10 ombygning
PDF
PPP Project Development Fund Initiative-PbyR
PPTX
2013 talk at TGAC, November 4
PPTX
Bethany Home What's New (June 2013)
PPS
There is always_a_better_way
PPT
Mn1 sec 1 - les 3 - (shirk)
PPTX
2012 XLDB talk
Var Marketing Programs1 Rev 060909
Circles of San Antonio Community Coalition and Bexar County DWI Task Force Ho...
Undangan (Kak Melly n Kak Dicky)
Nice weekend with music
How to do windows movie maker?
Extra Credit: Eye Tracking Finance Websites
Evaluaciones de jheickson noguera ingenieria economica
Tecno1r Eso
Oracle 11i OID AD Integration
Menuju Koperasi Rspp Yang Mandiri &Modern
Information Skills - Targeting untapped user groups - text
Nilai un dan_us_2010_ips
Your Guide to Business + Legal Success in Latin America
Br10 ombygning
PPP Project Development Fund Initiative-PbyR
2013 talk at TGAC, November 4
Bethany Home What's New (June 2013)
There is always_a_better_way
Mn1 sec 1 - les 3 - (shirk)
2012 XLDB talk
Ad

Similar to h-ubu - CDI in JavaScript (20)

PDF
Camunda BPM 7.2: Tasklist and Javascript Forms SDK (English)
PPTX
OW2 Nanoko
PDF
Azure Durable Functions (2019-04-27)
PDF
Writing Redis in Python with asyncio
PPTX
How to perform debounce in react
PDF
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
PDF
Job Queue in Golang
PDF
ngMess: AngularJS Dependency Injection
PDF
Jasigsakai12 columbia-customizes-cas
PPTX
Grails transactions
ODP
From object oriented to functional domain modeling
PDF
From object oriented to functional domain modeling
PDF
Advanced #2 networking
PPT
Google Web Toolkits
PDF
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
PDF
Finagle - an intro to rpc & a sync programming in jvm
PPTX
Building Progressive Web Apps for Windows devices
PPTX
AngularJs-training
KEY
Writing robust Node.js applications
PDF
Unit Testing Express Middleware
Camunda BPM 7.2: Tasklist and Javascript Forms SDK (English)
OW2 Nanoko
Azure Durable Functions (2019-04-27)
Writing Redis in Python with asyncio
How to perform debounce in react
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
Job Queue in Golang
ngMess: AngularJS Dependency Injection
Jasigsakai12 columbia-customizes-cas
Grails transactions
From object oriented to functional domain modeling
From object oriented to functional domain modeling
Advanced #2 networking
Google Web Toolkits
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
Finagle - an intro to rpc & a sync programming in jvm
Building Progressive Web Apps for Windows devices
AngularJs-training
Writing robust Node.js applications
Unit Testing Express Middleware

More from Clément Escoffier (13)

PDF
Devoxx France 2023 - 1,2,3 Quarkus.pdf
PDF
vert.x 3.1 - be reactive on the JVM but not only in Java
PDF
Modularity and Dynamism - The tale of two sisters
PDF
h-ubu - An industrial-strength service-oriented component model for JavaScrip...
PPTX
iPOJO 2.x - a tale about dynamism
PDF
Everest - Everything is a resource
PPTX
Linuxtag 2012 - continuous delivery - dream to reality
PDF
OSGi - beyond the myth
PDF
One year-with-chameleon
PDF
The OSGi Framework Multiplication
PPTX
Android : a linux-based mobile operating system
PPT
Experimenting with the OSGi platform in the Aspire RFID middleware
PPTX
Transactional OSGi Applications Done Right
Devoxx France 2023 - 1,2,3 Quarkus.pdf
vert.x 3.1 - be reactive on the JVM but not only in Java
Modularity and Dynamism - The tale of two sisters
h-ubu - An industrial-strength service-oriented component model for JavaScrip...
iPOJO 2.x - a tale about dynamism
Everest - Everything is a resource
Linuxtag 2012 - continuous delivery - dream to reality
OSGi - beyond the myth
One year-with-chameleon
The OSGi Framework Multiplication
Android : a linux-based mobile operating system
Experimenting with the OSGi platform in the Aspire RFID middleware
Transactional OSGi Applications Done Right

Recently uploaded (20)

PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Electronic commerce courselecture one. Pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Machine Learning_overview_presentation.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Dropbox Q2 2025 Financial Results & Investor Presentation
Machine Learning_overview_presentation.pptx
sap open course for s4hana steps from ECC to s4
Diabetes mellitus diagnosis method based random forest with bat algorithm
Per capita expenditure prediction using model stacking based on satellite ima...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...

h-ubu - CDI in JavaScript

  • 1. Dynamis Technologies h-ubu CDI in JavaScript Clement Escoffier
  • 4. How do we do that in Java ?
  • 9. What do we have in JavaScript ?
  • 10. Module Patterns + - Fix visibility A bit complex No interfaces
  • 11. Module loaders + - Avoid <script> Hard-coded Transitive dependencies Reuse
  • 12. MVC / MVVM + - Code Pushing organization the limits UI Bindings
  • 13. Well, so what’s h-ubu ?
  • 15. hub
  • 17. var component = { configure : function(hub, conf) { }, getComponentName : function() { }, start : function() { }, stop : function() {} }; hub .registerComponent(component) .start()
  • 19. var myService= { doSomething : function() {} }
  • 21. services Service Registry 2 – Lookup, 1 - Publication Service Listener 3 - Binding
  • 22. Substitutability Loose-coupling Why services ? Testable Dynamic
  • 23. var provider = { configure : function(hub, conf) { hub.provideService({ component: this, contract: myService }); }, getComponentName : function() { }, start : function() { }, stop : function() {}, doSomething : function() { … } }
  • 24. var consumer = { configure : function(hub, conf) { hub.requireService({ component: this, contract: myService, field: "svc" }); }, getComponentName : function() { }, start : function() {}, stop : function() {}, work : function() { this.svc.doSomething(); } }
  • 25. var consumer = { configure : function(hub, conf) { hub.requireService({ component: this, contract: myService, field: "svc" }); }, getComponentName : function() { }, start : function() {}, stop : function() {}, work : function() { } this.svc.doSomething(); Proxy }
  • 27. var publisher = { configure : function(hub, conf) {} getComponentName : function() { }, start : function() {}, stop : function() {}, work : function() { this.hub.publish(this, "my/topic", event); } }
  • 28. var receiver = { configure : function(hub, conf) { hub.subscribe(this, "my/(.)*?", this.receive); }, getComponentName : function() { }, start : function() {}, stop : function() {}, receive: function(event) { } }
  • 29. require.js/node.js Composition Modularize your JavaScript Standalone Configurability
  • 30. h bu Stop hacking, Start composing http://nanoko-project.github.com/h-ubu/snapshot/