More Related Content
Similar to h-ubu - CDI in JavaScript
Similar to h-ubu - CDI in JavaScript (20)
More from Clément Escoffier
More from Clément Escoffier (13)
h-ubu - CDI in JavaScript
- 11. Module loaders
+ -
Avoid <script> Hard-coded
Transitive dependencies
Reuse
- 12. MVC / MVVM
+ -
Code
Pushing
organization
the limits
UI Bindings
- 17. var component = {
configure : function(hub, conf) { },
getComponentName : function() { },
start : function() { },
stop : function() {}
};
hub
.registerComponent(component)
.start()
- 21. services
Service
Registry
2 – Lookup, 1 - Publication
Service Listener 3 - Binding
- 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) { }
}
- 30. h bu
Stop hacking,
Start composing
http://nanoko-project.github.com/h-ubu/snapshot/