Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
JavaScript Micro Services
Simon Kaegi
27 March 2012
What are Micro Services?
• OSGi minus the modularity
… about software development in a browser
Orion and OSGi Modularity
• e4 – OSGi style modularity in JavaScript
{ "Bundle-SymbolicName":"sample.jsbundle",
"Bundle-Ve...
Orion Plugins
• Orion applications are NOT made up of plugins
• Orion pages are designed to be 'extended' with plugins
• O...
7
Web Application
Front-endWeb Client
Web Application
Front-endWeb Server
Web Application
Front-endPluginWeb Application
F...
Web Application
Front-endWeb Client
Web Application
Front-endWeb Server
Orion way / Client-side Extension
Web Application
...
Eclipse IDE Extensibility
Orion Extensibility
registerService(INTERFACE_NAME, IMPLEMENTATION, PROPERTIES)
In-page
Plugin
Comparing OSGi and Orion Service APIs
• Orion provides a nearly complete implementation of the Service API from
OSGi Bundl...
What’s next
• Declarative Services
• wire.js – extends Asynchronous Module Definition
define([“wire!aService", “wire!anoth...
14
http://eclipse.org/orion/
Micro Services in JavaScript - Simon Kaegi
Micro Services in JavaScript - Simon Kaegi
Upcoming SlideShare
Loading in …5
×

Micro Services in JavaScript - Simon Kaegi

411 views

Published on

OSGi DevCon 2012

Although modularity concepts from OSGi might not map cleanly to programming languages other than Java, the ideas around OSGi Micro Services might be universally applicable. In this talk we will examine the JavaScript-based Micro Service implementation used at the core of the Eclipse Orion project. After several iterations and more than a couple of failed attempts to improve on OSGi, our implementation is now essentially aligned with OSGi Micro Services. We will discuss lessons learned and show how our implementation can be used stand-alone in arbitrary web pages as well as in Node.js

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Micro Services in JavaScript - Simon Kaegi

  1. 1. JavaScript Micro Services Simon Kaegi 27 March 2012
  2. 2. What are Micro Services? • OSGi minus the modularity
  3. 3. … about software development in a browser
  4. 4. Orion and OSGi Modularity • e4 – OSGi style modularity in JavaScript { "Bundle-SymbolicName":"sample.jsbundle", "Bundle-Version":"1.0", "Bundle-ScriptPath":"script.js", "Import-Package":"a.resource;version=[1.0.0,2.0.0)", "Export-Package":"sample.resource;version=1.0.0", "Require-Bundle:"some.other.bundle“ } • AMD – RequireJS define(["dojo", "orion/serviceregistry", "dojo/DeferredList"], function(dojo, mServiceregistry){… return exports});
  5. 5. Orion Plugins • Orion applications are NOT made up of plugins • Orion pages are designed to be 'extended' with plugins • Orion plugins are 'separate' HTML pages hosted in non-visible IFrames • Can be cross origin and communicate using HTML5 postMessage which is ASYNC • Plugins are isolated and secure against direct modification of the hosting page
  6. 6. 7 Web Application Front-endWeb Client Web Application Front-endWeb Server Web Application Front-endPluginWeb Application Front-endPluginWeb Application Front-endPlugin Web Application Front-endWeb Client Web Application Front-endWeb Server Web Application Front-endProxied Service Web Application Front-endProxied Service Java Web Application / OSGi Proxy Server / Portal
  7. 7. Web Application Front-endWeb Client Web Application Front-endWeb Server Orion way / Client-side Extension Web Application Front-endPlugin Web Application Front-endWeb Server Web Application Front-endPlugin Web Application Front-endWeb Server
  8. 8. Eclipse IDE Extensibility
  9. 9. Orion Extensibility registerService(INTERFACE_NAME, IMPLEMENTATION, PROPERTIES) In-page Plugin
  10. 10. Comparing OSGi and Orion Service APIs • Orion provides a nearly complete implementation of the Service API from OSGi BundleContext • ServiceReference, ServiceRegistration, … • service listeners, event types • Use Strings instead of java.lang.class when referencing Service interfaces • All Service calls return a “promise” – needed to abstract asynchronous service implementations • No ServiceTracker currently • originally built into getService but this was a mistake
  11. 11. What’s next • Declarative Services • wire.js – extends Asynchronous Module Definition define([“wire!aService", “wire!anotherService], function(aService, anotherService){…}); • Configuration Admin and Metatype Services • Permission Policy and Admin
  12. 12. 14 http://eclipse.org/orion/

×