chame ria

61
ChameRIA Alice Murphy, Clément Escoffier akquinet AG Berlin, Germany Philippe Lalanda, Jonathan Bardin Université de Grenoble & LIG Grenoble, France Improving User Experience by Infusing Web Technologies into Desktops

Upload: osgi-user-group-france

Post on 27-Jun-2015

353 views

Category:

Technology


1 download

DESCRIPTION

Modern applications are able to adapt their architecture dynamically in order to tackle requirements, correctives and context changes. Such dynamism is often an echo of complexity and is not well supported by traditional client and user software stacks making complex the design, implementation and maintenance of the end user interface. Meanwhile, the web has seen the emergence of user interface technologies (e.g. HTML5, CSS3, JavaScript) widely adopted by developers to create highly flexible user interfaces. However, such clients are intrinsically bound to run on a web browser which is out of the control of the application.In this talk, we present ChameRIA, an application framework where a browser engine is reified as a component within the framework, thus allowing for better control over the rendering engine. We describe how we preserve a clear separation of concerns between the user interface and the application logic while maintaining coherence between them. We discuss how ChameRIA has been successfully used in two projects: a DRM document reader and a valve control application.Jonathan Bardin, Laboratoire d'Informatique de Grenoble

TRANSCRIPT

Page 1: Chame RIA

ChameRIA

Alice Murphy, Clément Escoffier

akquinet AGBerlin, Germany

Philippe Lalanda, Jonathan Bardin

Université de Grenoble & LIG Grenoble, France

Improving User Experience by InfusingWeb Technologies into Desktops

Page 2: Chame RIA

ChameRIA

Chameria is a term used today mostly by Albanians for parts of the coastal region of Epirus in southern Albania and northwestern Greece.

http://en.wikipedia.org/wiki/Chameria

Page 3: Chame RIA

ChameRIA

OW2 ChameleonRich Internet Application

+ =

Page 4: Chame RIA

Rich Internet ApplicationOW2 ameleon

Chame + RIA = ChameRIA

Page 5: Chame RIA

Chame + RIA

OW2 ameleon

Service Catalog

Frameworks

Core

Rich Internet Application

Une pile logiciel ?

Page 6: Chame RIA

Chame + RIA

OW2 ameleon

Service Catalog

Frameworks

Core

Rich Internet Application

OSGi runtimeiPOJOconfiguration support

Page 7: Chame RIA

Chame + RIA

OW2 ameleon

Service Catalog

Frameworks

Core

Rich Internet Application

RoSe VisualVm

OSGi runtimeiPOJOconfiguration support

Page 8: Chame RIA

Chame + RIA

OW2 ameleon

Service Catalog

Frameworks

Core

Rich Internet Application

JSON, Syndication, Chat, Twitter...

RoSe VisualVm

OSGi runtimeiPOJOconfiguration support

Page 9: Chame RIA

Chame + RIA

OW2 ameleon

Service Catalog

Frameworks

Core

Rich Internet Application

JSON, Syndication, Chat, Twitter...

RoSe VisualVm

OSGi runtimeiPOJOconfiguration support

Distributions !

Page 10: Chame RIA

Desktop apps

Chame + RIA

OW2 ameleon

Service Catalog

Frameworks

Core

Web apps

RIARIA

JavaScriptHTMLCSS...

Rich Internet Application

Comprotocols

Page 11: Chame RIA

Chame + RIA

OW2 ameleon

Service Catalog

Frameworks

Core

Web apps

Desktop apps

Comprotocols

RIA

Web apps

RIARIA

JavaScriptHTMLCSS...

JSON-RPCHTTP/1.1

...

Rich Internet Application

Desktop apps

Page 12: Chame RIA

Chame + RIA

Rich Internet ApplicationOW2 ameleon

Service Catalog

Frameworks

Core

Web apps

Desktop apps

RIA

Web apps

RIARIA

JavaScriptHTMLCSS...

Comprotocols

JSON-RPCHTTP/1.1

...

Flash clientBrowser

...

Page 13: Chame RIA

Chame + RIA

Rich Internet ApplicationOW2 ameleon

Service Catalog

Frameworks

Core

Web apps

Desktop apps

RIA

Web apps

RIARIA

JavaScriptHTMLCSS...

Comprotocols

JSON-RPCHTTP/1.1

...

Flash clientBrowser

...WebKit

Hubu

Page 14: Chame RIA

Chame + RIA

Rich Internet Application

Web apps

Desktop apps

RIA

Web apps

RIARIA

Comprotocols

OW2 ameleon

Service Catalog

Frameworks

Core

+

Page 15: Chame RIA

Chame + RIA

Rich Internet Application

Web apps

Desktop apps

RIA

Web apps

RIARIA

Comprotocols

OW2 ameleon

Service Catalog

Frameworks

Core

+

Mais pourquoi Ok ... comment

Page 16: Chame RIA

Pour quoi faire !

Java UI SwingQT

ModularityThreadingAdaptation

Page 17: Chame RIA

Pour quoi faire !

Java UI SwingQT

ModularityThreadingAdaptation

SWT Manual Object Deallocation

Page 18: Chame RIA

Pour quoi faire !

Java UI SwingQT

ModularityThreadingAdaptation

SWT Manual Object Deallocation

+ OSGi =

Page 19: Chame RIA

Pour quoi faire !

Java UI + OSGi

● Pas de concept de service● Réutilisation● Maintenance● Connaissance en OSGi pour faire l'UI

Page 20: Chame RIA

Pour quoi faire !

Page 21: Chame RIA

Pour quoi faire !

WEB UI + OSGi

● Concept de service● Pas besoin de connaissances OSGi pour l'UI● Meilleur séparation des préoccupations● Isolation !

WEB

Page 22: Chame RIA

Pour quoi faire !

Page 23: Chame RIA

Pour quoi faire !

WEB UI + OSGi

● Concept de service● Pas besoin de connaissances OSGi pour l'UI● Meilleur séparation des préoccupations● Isolation !

WEB

● Il faut des dévloppeurs web● Il faut un browser Hors du contrôle de l'application Manque de fiabilité et de confort pour l'utilisateur

Page 24: Chame RIA

ChameRIA

Rich Internet Application

Web apps

Desktop apps

RIA

Web apps

RIARIA

Comprotocols

OW2 ameleon

Service Catalog

Frameworks

Core

+

Mais pourquoi Ok ... comment

Page 25: Chame RIA

Comment ?

Combiner une passerelle OSGi avec Webkit

Page 26: Chame RIA

Comment ?

Page 27: Chame RIA

Comment ?

1 Business logic in Java● iPOJO components are POJOs

Page 28: Chame RIA

Comment ?

1 Business logic in Java● iPOJO components are POJOs

2 UI is fully realized in web technologies● JavaScript, HTML, CSS …

Page 29: Chame RIA

Comment ?

1 Business logic in Java● iPOJO components are POJOs

2 UI is fully realized in web technologies● JavaScript, HTML, CSS …

3 Follow Service-Oriented Component principles● Contract-based communication● Service availability can change at runtime● ...

Page 30: Chame RIA

Comment ?

Page 31: Chame RIA

Comment ?

Page 32: Chame RIA

Comment ?

Page 33: Chame RIA

Comment ?

Intégratation du WebKit ?

1 Launcher● Wrap the WebKit et le framework OSGi

Page 34: Chame RIA

Comment ?

Intégratation du WebKit ?

1 Launcher● Wrap the WebKit et le framework OSGi

2 WebViewFactory composant

● Creer une nouvelle fenètre● Fournit un BrowserService

Page 35: Chame RIA

Comment ?

Web User Interface - hubu

1 Modèle à composant pour JavaScript

● Interaction basé sur des contrats● Injection des dépendances● Un composant = un fichier● Communications synchrone et asynchrone● Composant sont testables

hubu

Page 36: Chame RIA

Comment ?

Web User Interface - hubu

creation

configure

start

bind

stop

hub.registerComponent

hub.bind

hub.start

hub.start

hub.stop

hub

hubu

Page 37: Chame RIA

Comment ?

<script src =”http://../jquery−latest.js”/>

<script src =” hubu. js”/>

<script src =” backendComponent.js”/>

<script src =” f rontendComponent.js”/>

<!−− The contracts −−>

<script src =” UserServiceContract.js”/>

hubu

Page 38: Chame RIA

Comment ?

<script src =”http://../jquery−latest.js”/>

<script src =” hubu. js”/>

<script src =” backendComponent.js”/>

<script src =” frontendComponent.js”/>

<!−− The contracts −−>

<script src =” UserServiceContract.js”/>

hubu

Page 39: Chame RIA

Comment ?

hub . registerComponent ( backendComponent ( ) , { component_name : ’ user ’ }) .registerComponent ( frontendComponent ( ) , { loginId : ’#login’ , logoutId : ’ #logout ’ , statusId : ’ #status’ , component_name : ’frontend’ }) // Declare a Binding .bind ({ component : ’user’ , to : ’ frontend ’ , into : ’ bind ’ , contract : UserServiceContract // The Interface }) //Start the app .start() ;}) ;

hubu

Page 40: Chame RIA

Comment ?

hub . registerComponent ( backendComponent ( ) , { component_name : ’ user ’ }) .registerComponent ( frontendComponent ( ) , { loginId : ’#login’ , logoutId : ’ #logout ’ , statusId : ’ #status’ , component_name : ’frontend’ }) // Declare a Binding .bind ({ component : ’user’ , to : ’ frontend ’ , into : ’ bind ’ , contract : UserServiceContract // The Interface }) //Start the app .start() ;}) ;

hubu

Page 41: Chame RIA

Comment ?

var myComponent = function() {

/** Private part (members and functions) **/

return {

/** Component Interface **/

getComponentName : function() { },

configure : function(theHub, configuration) { },

start: function() { },

stop: function() { },

// Public Interface //

// Functions...

}

}

hubu

Page 42: Chame RIA

Comment ?

Intégration des composants WUI !

1 Emballé dans un bundle !● Et publier comme ressources via HttpService

wui

Page 43: Chame RIA

Comment ?

Intégration des composants WUI !

1 Emballé dans un bundle !● Et publier comme ressources via HttpService

2 WebExposer component !

● Écoute un dossier● Pas besoin de connaître OSGi !

wui

Page 44: Chame RIA

Comment ?

Logique applicative !

1 Bundles !● Unité de déploiement

Page 45: Chame RIA

Comment ?

Logique applicative !

1 Bundles !● Unité de déploiement

2 iPOJO component !

● Un composant est un POJO !● Injection des dépendances● Cycle de vie

Page 46: Chame RIA

Comment ?@Component ( name=” acme.hello.component ” )@Provides // Provide HelloServicepublic class MyComponent implements HelloService { @Requires ( optional=true) // require a LogService private LogService logger; public String hello ( String name){ return ” Hello ”+name+”! ” ; } @Validate / /on validation callback private void start () { logger.log( INFO , ” HelloService started ” ) ; } @Invalidate // on invalidation callback private void stop (){ logger.log ( INFO , ” HelloService stopped” ) ; }}

Page 47: Chame RIA

Comment ?

Communication entre OSGi et WUI !

1 RoSe !● Injection de connecteurs● Séparation des préoccupations● Déclaratif (configuration)● Dynamique

Page 48: Chame RIA

Comment ?

”machine ” : {

”connection” : [

”out” : {

”servicefilter” : ” ( objectClass=acme.HelloService) ” ,

”protocol” : [ ”jsonrpc” ]

}

]

Page 49: Chame RIA

Comment ?

...

var jsonrpc = new JSONRpcClient(”/JSON−RPC”);

var greeting = jsonrpc.helloService.hello(”Dave ”);

$(’#greeting’).text(greeting);

...

Page 50: Chame RIA

Comment ?

Protocoles/standards supporté

1 JSON-RPC (jabsorb)

2 XML-RPC (Apache XML-RPC)

3 JAX-RS (Jersey – export seulement)

4 JAX-WS (Apache CXF)

Page 51: Chame RIA

Comment ?

Protocoles/standards supporté

Page 52: Chame RIA

Comment ?

Changements dynamique et couplage !

● BC: Business Logic component

● SC: Service contracts

● WC: WUI component

● WV: Web view resources

Page 53: Chame RIA

Comment ?

Bonne pratiques !

1 All communication between the server and client is contract-based and done through the use of virtual objects (e.g. JSON-RPC proxies, REST virtual resources).

Page 54: Chame RIA

Comment ?

Bonne pratiques !

1 All communication between the server and client is contract-based and done through the use of virtual objects (e.g. JSON-RPC proxies, REST virtual resources).

2 No part of the web client should be evoked, generated or templated from the server-side. This rules out in-line conditional HTML in JSP.

Page 55: Chame RIA

Comment ?

Bonne pratiques !

1 All communication between the server and client is contract-based and done through the use of virtual objects (e.g. JSON-RPC proxies, REST virtual resources).

2 No part of the web client should be evoked, generated or templated from the server-side. This rules out in-line conditional HTML in JSP.

3 The server will only implement the business logic.

Page 56: Chame RIA

Chame + RIA

Rich Internet Application

Web apps

Desktop apps

RIA

Web apps

RIARIA

Comprotocols

OW2 ameleon

Service Catalog

Frameworks

Core

+

Des expériences ?

Page 57: Chame RIA

Expérience !

Application de gestion de vannes d'eau

Page 58: Chame RIA

Expérience !

Lecteur de document (avec DRM)

Page 59: Chame RIA

Conclusion

1 Rhino plutôt que webkit et injection direct des services dans la VM de Rhino !?

Page 60: Chame RIA

Conclusion

1 Rhino plutôt que webkit et injection direct des services dans la VM de Rhino !?

2 Vers des applications WEB/Cloud ?1 Attention aux passages à l'échelle !

Page 61: Chame RIA

Merci !

ChameRIA & Hubu● http://github.com/akquinet

Chameleon & RoSe● http://chameleon.ow2.org/● http://github.com/barjo/arvensis