SlideShare a Scribd company logo
1 of 30
Group




      h-ubu
 CDI in JavaScript
        Clement Escoffier
How do we do that
    in Java ?
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://nano-project.github.com/h-ubu/snapshot/

More Related Content

What's hot

Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
偉格 高
 
Introduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDBIntroduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDB
Adrien Joly
 
Ring: Web Apps in Idiomatic Clojure
Ring: Web Apps in Idiomatic ClojureRing: Web Apps in Idiomatic Clojure
Ring: Web Apps in Idiomatic Clojure
Mark McGranaghan
 

What's hot (15)

Map kit light
Map kit lightMap kit light
Map kit light
 
Javascript this keyword
Javascript this keywordJavascript this keyword
Javascript this keyword
 
SignalR
SignalRSignalR
SignalR
 
Partial Application in Javascript (and why I like it)
Partial Application in Javascript (and why I like it)Partial Application in Javascript (and why I like it)
Partial Application in Javascript (and why I like it)
 
this
thisthis
this
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
Js hacks
Js hacksJs hacks
Js hacks
 
Introduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDBIntroduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDB
 
Talk KVO with rac by Philippe Converset
Talk KVO with rac by Philippe ConversetTalk KVO with rac by Philippe Converset
Talk KVO with rac by Philippe Converset
 
Javascript essential-pattern
Javascript essential-patternJavascript essential-pattern
Javascript essential-pattern
 
Ring: Web Apps in Idiomatic Clojure
Ring: Web Apps in Idiomatic ClojureRing: Web Apps in Idiomatic Clojure
Ring: Web Apps in Idiomatic Clojure
 
Clojure Workshop: Web development
Clojure Workshop: Web developmentClojure Workshop: Web development
Clojure Workshop: Web development
 
Douglas Crockford: Serversideness
Douglas Crockford: ServersidenessDouglas Crockford: Serversideness
Douglas Crockford: Serversideness
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with Express
 
Some geospatial ruby libraries
Some geospatial ruby librariesSome geospatial ruby libraries
Some geospatial ruby libraries
 

Viewers also liked

Oracle 11i OID AD Integration
Oracle 11i OID AD IntegrationOracle 11i OID AD Integration
Oracle 11i OID AD Integration
Mahesh Vallampati
 
Hohmann liber2006text
Hohmann liber2006textHohmann liber2006text
Hohmann liber2006text
Tina Hohmann
 

Viewers also liked (20)

300 - Multiplatform Apps on Google Cloud Platform
300 - Multiplatform Apps on Google Cloud Platform300 - Multiplatform Apps on Google Cloud Platform
300 - Multiplatform Apps on Google Cloud Platform
 
Persdev asr
Persdev asrPersdev asr
Persdev asr
 
Br10 ombygning
Br10 ombygningBr10 ombygning
Br10 ombygning
 
Arbitrator Subpoenas: Are They Worth The Paper They Are Printed On?
Arbitrator Subpoenas: Are They Worth The Paper They Are Printed On?Arbitrator Subpoenas: Are They Worth The Paper They Are Printed On?
Arbitrator Subpoenas: Are They Worth The Paper They Are Printed On?
 
Br10 tekniske installationer
Br10 tekniske installationerBr10 tekniske installationer
Br10 tekniske installationer
 
Oracle 11i OID AD Integration
Oracle 11i OID AD IntegrationOracle 11i OID AD Integration
Oracle 11i OID AD Integration
 
Why PhoneGap, a different perception ?
Why PhoneGap, a different perception ?Why PhoneGap, a different perception ?
Why PhoneGap, a different perception ?
 
Seniors u00 e9lu00e9ment_u00e9conomique_indispensable11-1
Seniors u00 e9lu00e9ment_u00e9conomique_indispensable11-1Seniors u00 e9lu00e9ment_u00e9conomique_indispensable11-1
Seniors u00 e9lu00e9ment_u00e9conomique_indispensable11-1
 
33 Lead Generation Tips in 33 Minutes
33 Lead Generation Tips in 33 Minutes33 Lead Generation Tips in 33 Minutes
33 Lead Generation Tips in 33 Minutes
 
Orange Israel iPhone startAPP contest winners at MoMoTLV
Orange Israel iPhone startAPP contest winners at MoMoTLVOrange Israel iPhone startAPP contest winners at MoMoTLV
Orange Israel iPhone startAPP contest winners at MoMoTLV
 
Wordshop Web Evolution (by Morozov Andrey)
Wordshop Web Evolution (by Morozov Andrey)Wordshop Web Evolution (by Morozov Andrey)
Wordshop Web Evolution (by Morozov Andrey)
 
Presentation Teknisa
Presentation TeknisaPresentation Teknisa
Presentation Teknisa
 
Improving line management capability the Grimsby Institute story by Peter J B...
Improving line management capability the Grimsby Institute story by Peter J B...Improving line management capability the Grimsby Institute story by Peter J B...
Improving line management capability the Grimsby Institute story by Peter J B...
 
Hohmann liber2006text
Hohmann liber2006textHohmann liber2006text
Hohmann liber2006text
 
Legal Issues Important for Doing Business in the U.S. | Martijn Steger
Legal Issues Important for Doing Business in the U.S. | Martijn StegerLegal Issues Important for Doing Business in the U.S. | Martijn Steger
Legal Issues Important for Doing Business in the U.S. | Martijn Steger
 
There is always_a_better_way
There is always_a_better_wayThere is always_a_better_way
There is always_a_better_way
 
3 Hr. Workbook - S1031 For Professionals
3 Hr.  Workbook - S1031 For Professionals3 Hr.  Workbook - S1031 For Professionals
3 Hr. Workbook - S1031 For Professionals
 
2015 pag-chicken
2015 pag-chicken2015 pag-chicken
2015 pag-chicken
 
Educational Opportunities in Cuba
Educational Opportunities in CubaEducational Opportunities in Cuba
Educational Opportunities in Cuba
 
2015 ohsu-metagenome
2015 ohsu-metagenome2015 ohsu-metagenome
2015 ohsu-metagenome
 

Similar to h-ubu : CDI in JavaScript

Jasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-casJasigsakai12 columbia-customizes-cas
Jasigsakai12 columbia-customizes-cas
ellentuck
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
Tom Croucher
 

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

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

More from Clément Escoffier

iPOJO 2.x - a tale about dynamism
iPOJO 2.x - a tale about dynamismiPOJO 2.x - a tale about dynamism
iPOJO 2.x - a tale about dynamism
Clément Escoffier
 
Everest - Everything is a resource
Everest - Everything is a resourceEverest - Everything is a resource
Everest - Everything is a resource
Clément Escoffier
 
Linuxtag 2012 - continuous delivery - dream to reality
Linuxtag 2012  - continuous delivery - dream to realityLinuxtag 2012  - continuous delivery - dream to reality
Linuxtag 2012 - continuous delivery - dream to reality
Clément Escoffier
 
Android : a linux-based mobile operating system
Android : a linux-based mobile operating systemAndroid : a linux-based mobile operating system
Android : a linux-based mobile operating system
Clément Escoffier
 
Experimenting with the OSGi platform in the Aspire RFID middleware
Experimenting with the OSGi platform in the Aspire RFID middlewareExperimenting with the OSGi platform in the Aspire RFID middleware
Experimenting with the OSGi platform in the Aspire RFID middleware
Clément Escoffier
 

More from Clément Escoffier (13)

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

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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...
 
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...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
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...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

h-ubu : CDI in JavaScript

  • 1. Group h-ubu CDI in JavaScript Clement Escoffier
  • 2.
  • 3.
  • 4. How do we do that in Java ?
  • 5.
  • 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://nano-project.github.com/h-ubu/snapshot/