h-ubu : CDI in JavaScript
Upcoming SlideShare
Loading in...5
×
 

h-ubu : CDI in JavaScript

on

  • 1,432 views

h-ubu is a service-based injection framework.

h-ubu is a service-based injection framework.

Statistics

Views

Total Views
1,432
Views on SlideShare
1,368
Embed Views
64

Actions

Likes
0
Downloads
10
Comments
0

2 Embeds 64

http://humantalks.com 63
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

h-ubu : CDI in JavaScript h-ubu : CDI in JavaScript Presentation Transcript

  • Group h-ubu CDI in JavaScript Clement Escoffier
  • How do we do that in Java ?
  • Components View slide
  • Interfaces View slide
  • 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 Pushingorganization the limitsUI 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 - PublicationService Listener 3 - Binding
  • Substitutability Loose-coupling Why services ? TestableDynamic
  • 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 StandaloneConfigurability
  • h bu Stop hacking, Start composinghttp://nano-project.github.com/h-ubu/snapshot/