h-ubu - an industrial-strength service-oriented component model for javascript applications
DESCRIPTION
In the last years, we developed web applications requiring a large amount of JavaScript code. These web applications present adaptation requirements. In addition to platform-centric adaptation, applications have to dynamically react to external events like connectivity disruptions. Building such applications is complex and we faced sharp maintainability challenges. This paper presents h-ubu, a service-oriented component framework for JavaScript allowing building adaptive applications. h-ubu is used in industrial web applications and mobile applications. h-ubu is available in open source, as part of the OW2 Nanoko project.TRANSCRIPT
h-ubu Service-Orientation in
JavaScript
Clement Escoffier
Philippe Lalanda
Nicolas Rempulski
JavaScript coding => or explosions ?
var foo; alert(foo == null); // true alert(foo == undefined); // true alert(foo === null); // false alert(foo === undefined); // true
a = 1; (function(){ b=2; alert(a); })(); // 1 alert(b); //2 -> b is global
alert(1+"10"); // 110 alert(1+”1"+1); // 111
What would be nice ?
C omponents
Interfaces
Required
Provided
Dependency Injection
Events Received
Sent
Would it be enough ?
Traditional C omponent model
Variability
Dynamic
Bootstrap
Packaging
P latform-based variability
Dynamic adaptability
Dynamic adaptability
X X
Do we need this dynamism ?
C onnectivity
Device features
Sensors
User actions
Neighbors
Failures
Ok, but what is h-ubu ?
h-ubu is a Service-oriented C omponent model
components
contracts (i.e. interfaces)
dynamic services
1 - Publication
2 – Lookup,
Notifications,
Selection
3 - Binding
dynamic services Registry
Programming model
Architectural shift
Issues
var provider = { configure : function(hub, conf) { hub.provideService({ component: this, contract: myService }); }, start : function() { }, stop : function() {}, doSomething : function() { … }
}
1 - Publication
Registry 2 – Lookup,
Notifications,
Selection
3 - Binding
var consumer = { configure : function(hub, conf) { hub.requireService({ component: this, contract: myService, field: "svc" }); }, // … work : function() { this.svc.doSomething(); }
}
1 - Publication
Registry 2 – Lookup,
Notifications,
Selection
3 - Binding
Easy adoption
Nb of components
Time
JavaEE
Mobile
Mobile Web Server
Web Desktop
h bu
h#p://nanoko-‐project.github.io/h-‐ubu/snapshot/
Thanks