groke

12
REST Inspired Code Partitioning with a JavaScript Middleware Janne Kuuskeri, Tommi Mikkonen Tampere University of Technology Monday, April 11, 2011

Upload: janne-kuuskeri

Post on 05-Dec-2014

924 views

Category:

Documents


1 download

DESCRIPTION

The Groke server experiment

TRANSCRIPT

Page 1: Groke

REST Inspired Code Partitioning with a JavaScript Middleware

Janne Kuuskeri, Tommi Mikkonen

Tampere University of Technology

Monday, April 11, 2011

Page 2: Groke

Motivation

Web pages are now web applications

Web application are too complex to build

How to make it easier?

Monday, April 11, 2011

Page 3: Groke

Current State

View

Model

Controller

Browser Server

JavaScript, CSS, HTML, JSP, Kid,

eRuby Java, Python, RubyAjax, XML, JSON

Monday, April 11, 2011

Page 4: Groke

Problems

Applications are fragmented over many different technologies

Responsibilities are difficult to assign

Traditional software engineering principles are difficult to apply

Monday, April 11, 2011

Page 5: Groke

How to Make It Easier?

One language to rule them all

Fat client

Automatic and more importantly dynamic code partitioning

Monday, April 11, 2011

Page 6: Groke

Groke

Web Application Web Application

Groke Client Groke Server

Web ServerBrowser

Internet

Monday, April 11, 2011

Page 7: Groke

Implementation

Groke Client Groke Server

JavaScript

Ajax

CommonJS

Narwhal

JSGI

Jack

Middleware

Monday, April 11, 2011

Page 8: Groke

Implementation

Expose interface in terms of resources

Modules : /groke/module/[module]

Functions : /groke/module/[module]/[function]

Constructors : /groke/ctor/[module]/[function]

Objects : /groke/obj/[obj-id]/[property]

Anonymous functions : /groke/func/[func-id]

Groke Server

Monday, April 11, 2011

Page 9: Groke

Demo

Monday, April 11, 2011

Page 10: Groke

REST?

Functions as resources

RESTful interface is data (resource) driven

Parameters are always POSTed to resources

The platform cannot have any understanding about the semantics of the resources (possibly functions) it exposes

Monday, April 11, 2011

Page 11: Groke

Future Work

Make Groke symmetric by utilizing Comet or WebSockets

Make client side wrapper cacheable

Garbage collection

Monday, April 11, 2011

Page 12: Groke

Questions?

http://github.com/wuher/groke

Monday, April 11, 2011