For the second birthday of Paris JUG, the theme will be the open source in France. We are searching for a cheap room that can contain from 250 to 300 persons.
Atmosphere presentation
Jean-Francois Arcand has presented Atmosphere, a portable and open source framework to do ajax push or Comet (which process ajax push requests in a non blocking way).
Thanks to Atmosphere, based on POJO and inversion of control, the developer works independantly of the application server (JBoss, Tomcat, GlassFish, Google App Engine …) and the browser. Atmosphere can manage a cluster of servers. It also detects the closure of the browser, which allow to free used resources on the server.
Messages are broadcasted in a global or selective, immediate or delayed manner and can be aggregated (useful when lot of messages are sent in short time). The broadcast can be done by many implementations : JGroups, JMS ou Shoal.
As an example of global broadcasting, Jean-François has done a demonstration in which a page is displayed in 2 browsers; he moved the image in one browser and it moved identically in the other. Next, to illustrate selective broadcasting, he has shown a twitter like software with following and followers.
Atmosphere spade server is a version with an embedded server (based on grizzly, a fork of tomcat) : it’s not much useful in an enterprise because offen there is already an application server. The interest is essentially for unit tests.
Among the incoming features, there is cookie based transactions to never loose an event (when the browser is again connected, it recovers lost messages) and support for persistance. The version 1.0 should arrive in july 2010.
Gabriel Kastenbaum and Stéphane Liétard has presented Android, an open source operating system for mobile phones and PDAs. The version 2 is out since 2 weeks and is adding HTML 5 support.
Since arrival of the iPhone, Google has found that 50% of the resquests on Google Maps are coming from the iPhone. That’s why they decided to buy Android, a free and open source operating system, in the hope to impose it as a better solution for mobile phone operators in front of other operating systems, which are very expensive. In order to distribute Android applications (freely or not), Google has created Android Market.
Android is using linux 2.6 kernel with java APIs above it. Moreover, the Dalvik virtual machine, written especially for Android, is needed and it’s not a java virtual machine. Indeed, unlike JVMs which are based on the stack, Dalvik uses processor registers and executes optimised bytecode (.dex files), incompatible with java bytecode (.class or .jar files). In order to obtain .dex files, you must preprocess the java bytecode, which allows to reuse existing java code.
Despite it’s possible to develop outside of eclipse, it’s practical to install the ADT plugin (Android Development Tools) inside it to easily create and debug an Android project. That plugin allows to create HMIs by drag&drop, which will generate a description xml file. But it’s also possible to write some code to create HMIs. The logcat command from the Android SDK, which is also usable with the eclipse plugin, allows to display log messages from Android, especially system logs (gc, …) and, of course, your application logs.
As all applications are at the same level, standard applications can be replaced. The main components are activities, services, broadcast receivers and content providers. Content providers allows, for example, to share contacts between applications. An intent is a message between components. This approach allows components to communicate with each other or with the system without even know the others. The result is a low coupling between components.
From the developer point of view, an application deployed on GAE is working in the same way if there is only one user or 1 million users. In fact, it manages load balancing and addition of servlets containers as needed by the load; all that is done transparently for the developer and the user.
Some operations are forbidden : write in the file system, execute request (in response to the user) that take more than 30 seconds, create a thread …
For the scalability of the system, request can’t take more than 30 seconds but the task management API allows to go above that limit by executing some tasks in background.
The database is not a relational one, JDBC and SQL are not even used. The database engine is named BigTable : it’s a kind of big hash table. In order to reuse existing applications and existing frameworks, the API DataStore from GAE’s SDK provides an implementation of JPA and JDO for BigTable.
As GAE is opened to other languages based on the java platform, it’s possible to deploy applications developed with groovy. Thus, thanks to gaelyk, a groovy layer above GAE’s SDK, one can run groovlets (equivalent to java servlets) in GAE.
Google Wave
And to finish, Didier Girard has presented Google Wave, a collaboration tool based on GWT and that allows to group informations with different origins like e-mail, chat, all that in the same wave. It’s possible to develop a gadget with GWT, deploy it on Google App Engine and integrate it in a wave.
Didier has made a demonstration of an application wave that manages employee hollidays in a enterprise. Depending on the person that is connected on the wave, various actions are possible :
a collaborator can propose its hollidays dates
a manager can validate or refuse his collaborators hollidays
By using drag&drop, a collaborator can add his hollidays photos in the wave.
Gabriel Kastenbaum et Stéphane Liétard nous présentent Android, un système d’exploitation open source pour les téléphones portables et les PDAs. La version 2 est sortie il y a 2 semaines et ajoute notamment le support de HTML 5.
Depuis l’arrivée de l’iPhone, Google a constaté que 50% des requêtes sur Google Maps viennent de l’iPhone. C’est pourquoi il a décidé d’acheter Android, un système d’exploitation open source et gratuit, dans l’espoir de s’imposer comme une meilleure solution pour les opérateurs téléphoniques face aux autres systèmes d’exploitation, qui coûtent très cher. Afin de distribuer les applications (gratuites ou non) pour Android, Google a créé Android Market.
Android utilise le noyau linux 2.6 sur lequel des API java ont été ajoutées. D’autre part, la machine virtuelle Dalvik, écrite spécialement pour Android, est nécessaire et ce n’est pas une machine virtuelle java. En effet, contrairement aux JVM qui se basent sur la pile, Dalvik utilise les registres du processeur et execute du bytecode optimisé (fichiers .dex), non compatible avec du bytecode java (fichiers .class ou .jar). Afin d’obtenir les fichiers .dex, il faut donc faire un prétraitement du bytecode java, ce qui permet aussi la réutilisation du code java existant.
Bien qu’il soit possible de développer en dehors d’eclipse, il est pratique d’installer le plugin ADT (Android Development Tools) dans celui-ci pour créer et déboguer facilement un projet Android. Ce plugin permet aussi de créer des IHMs par cliquer-glisser, ce qui génère un fichier xml de description. Mais il est aussi possible de créer des IHMs directement par programmation. La commande logcat du SDK Android, qui a son équivalent au niveau du plugin eclipse, permet d’afficher les messages de log d’Android, notamment les logs du système (gc, …) et bien sûr les logs de l’application en cours de développement.
Comme toutes les applications sont au même niveau, les applications standards peuvent être remplacées. Les principaux composants sont les activities (activités), les services, les broadcast receivers (récepteurs de messages diffusés) et les content providers (fournisseurs de contenu). Les content providers permettent, par exemple, le partage des contacts entre différentes applications. Un intent (intention) est un message entre composants. Cette approche permet aux composants de communiquer entre eux ou avec le système sans même qu’ils se connaissent. Il en résulte un couplage faible entre les composants.
Du point de vue du développeur, une application déployée sur GAE fonctionne de la même manière qu’il y ait 1 seul utilisateur ou 1 million d’utilisateurs. En effet, il gère la répartition de charge et l’ajout de conteneurs de servlets si la charge le nécessite; tout cela se fait de manière transparente pour le développeur et l’utilisateur.
Certaines opérations sont interdites : écrire dans le système de fichiers, faire des requêtes (en réponse à l’utilisateur) qui durent plus de 30 secondes, créer un thread …
Pour l’extensibilité du système, les requêtes ne doivent pas durer plus de 30 secondes mais l’API de gestion des taches permet de passer outre cette limite en executant certaines taches en arrière plan.
La base de données n’est pas une base de données relationnelle, on n’utilise ni JDBC ni le SQL. Le moteur de base de données s’appelle BigTable : c’est une sorte de grande table de hachage. Afin de pouvoir réutiliser les applications et les frameworks existants, l’API DataStore du SDK GAE fournie une implémentation de JPA et de JDO pour BigTable.
Comme GAE est ouvert aux autres languages basés sur la plateforme java, il est possible de déployer des applications développées en groovy.
Ainsi, grâce à gaelyk une surcouche en groovy au SDK de GAE, on peut faire tourner des groovlets (équivalents aux servlets java) sur GAE.
Google Wave
Et pour finir, Didier Girard fait la présentation de Google Wave, un outils de collaboration basé sur GWT et qui permet de regrouper des informations de différentes provenances telles que le mail, le chat, tout cela dans une même wave. Il est possible de développer un gadget en GWT, le déployer sur Google App Engine et l’intégrer dans une wave.
Didier fait la démonstration d’une wave de prise de congés dans une entreprise. Suivant la personne qui se connecte sur la wave, différentes actions sont possibles :
un collaborateur peut poser ses congés
un manager peut valider ou refuser les congés de ses collaborateurs
Par cliquer-glisser, un collaborateur peut ajouter les photos de ses vacances dans la wave.
Pour le deuxième anniversaire du Paris JUG, le thème sera l’open source en France. On recherche une salle pas chère pouvant contenir 250 à 300 personnes.
Présentation d’Atmosphere
Jean-Francois Arcand nous présente Atmosphere, un framework portable et open source pour faire de l’ajax push ou du Comet (qui traite les requêtes ajax push de manière non bloquante).
Grâce à Atmosphere, basé sur les POJO et l’inversion de contrôle, le développeur travaille indépendamment du serveur d’application (JBoss, Tomcat, GlassFish, Google App Engine …) et du navigateur. Atmosphere peut gérer une grappe de serveurs. Il détecte aussi la fermeture du navigateur, ce qui permet de libérer les ressources utilisées sur le serveur.
Les messages sont diffusés de manière globale ou selective, immédiate ou retardée et peuvent être aggrégés (utile quand de nombreux messages sont envoyés en peu de temps). Leur diffusion peut se faire par différentes implémentations : JGroups, JMS ou Shoal.
Comme exemple de diffusion globale, Jean-François fait une démonstration dans laquelle une page est affichée dans 2 navigateurs; on déplace une image dans l’un des deux et celle-ci se déplace de même dans l’autre navigateur. Ensuite, pour illustrer la diffusion sélective, il nous montre un logiciel imitant twitter avec des following (les personnes dont l’utilisateur suit les messages) et followers (les personnes qui vont recevoir les messages de l’utilisateur).
Atmosphere spade server est une version contenant un serveur embarqué (basé sur grizzly, un fork de tomcat) : c’est peu utile en entreprise car souvent il existe déjà un serveur d’application. L’intérêt est donc essentiellement pour les tests unitaires.
Parmi les fonctionnalités à venir, il y a les transactions basées sur les cookies pour ne jamais perdre un évènement (quand le navigateur se reconnecte, il récupère les messages qu’il a manqué) ainsi que le support de la persistance. La version 1.0 devrait arriver vers juillet 2010.
Sonar : Olivier Gaudin has spoken about version 2.0, expected for the end of the year, and announced that it will includes design metrics
Next, Frederic Brachfeld has presented SonarJ community edition, a software allowing to split logically an architecture in vertical and horizontal layers. It checks that forbidden dependencies are not realized. The analysis is done from java bytecode or from source code, knowing that source code can provide more informations. Java server pages (jsp) are also managed if you have the compiled classes. SonarJ can be used standalone or as an eclipse plugin with a real time view of architecture violations. Another advantage of SonarJ is that it allows you to see the structure of a software you don’t know.
To finish, Fabrice Bellingard has presented Squale (Software QUALity Enhancement), an open source quality evaluation platform, based on the audit notion and that proposes an action plan to improve the score for the quality of the analysed software. The proposed plan indicates how to get a maximum of quality improvement with a minimum effort. Even if the effort notion is an empirical thing, squale is a research project put in production in the industry in more than 100 applications. Squale is part of the thematic group « free software » in the System@tic competitivity center. Qualixo, the creator of squale, is involved in the quality evaluation club‘s workgroups to define the iso 9126 standard, related to evaluation of software quality.
Thanks to that evening I have discovered new open source softwares that I didn’t know, especially the ones controlling the quality of a software design. I should test them to see if they could be useful for JNode.
The 4th of november 2008, I attended to the GWT conference organised by Paris JUG, a JAVA users group based in Paris. That allowed me to learn more about GWT in order to develop a virtual desktop for JNode, as a coworker suggested me.
First part : GWT
The presentator started by speaking about a very simple game he has developed in only few hours on his PC/Windows and that he has tested on the Wii (whose browser is opera). Then he invited us to consult the blogs on ongwt.
GWT Desktop Framework : a library based on the HMVC architecture to manage forms with input validation
GWT designer : an eclipse plugin allowing to be quickly operational on GWT
Google Gears : allow to manage (through the browser) an application in disconnected mode with a server and a database installed on client side. Moreover, it allows to make javascript multithreaded (which in not the case in standard) !
and many others …
GWT principles :
After initial loading of the page, GWT can work in disconnected mode (which means without any network connection)
Develop web applications in java (no javascript or html) : you use the JAVA syntax and a major part of its APIs (but not all)
Compile in javascript : 1 file per browser, optimised for that one + compacted code (but there is a pretty mode for a formatted and readable code)
A simple static server is enough in general, Apache for example
Can encapsulate an existing javascript library : for that purpose, the ‘native’ keyword, combined with a special format for comments, allows to define a javascript function to use in the compilation phase
Provides an API to manage browser history. That allows to make bookmarkable applications despite the fact that, by definition, a GWT application is a single page one.
Manages internationalisation => the compilation generates one javascript file per browser and per language
Compatible with JUnit for business process side and (almost compatible) with Selenium for the HMI side
Support of java 5 since GWT 1.5
Advantages :
well integrated in the existing ecosystem, especially because it’s the JAVA syntax
Ajax (and so gwt) allows to reduce workload on the server : the workload is reported on the client (browser), especially because there is no session persistance on the server.
Remark : As GWT applications are represented by a single page, you must rethink the HMI ergonomy of traditional web applications.
Second part : Restlet-GWT
REST completely defines a web architecture and is based on existing things, for example the http protocol (with its GET, POST, PUT, DELETE requests). For more informations, consult that article on the ‘journal du net’ or that one on wikipedia. Advantage : A Swing and a GWT application can share a big part of the backend thanks to REST
Restlet : it’s an open source implementation of REST in java. The version 1.1.0, named Restlet-GWT, is the first stable version of the GWT portage.
unified API on server and client side : that allow to learn/use many APIs (javamail, http, jdbc, …)
independant of the servlets but can be integrated in that kind of container. There is a standalone deployment but it remains client/server.
expose ressources (through an uri) and adapt client side representation. Thus, with http, we use content negociation to know what kind of representation is supported by the client. Example : Firefox say it prefers html or else xhtml.
BIRT est un outil de génération de rapports composé de 3 parties : le moteur de graphiques, le moteur de génération de rapports et le moteur de design.
Les sources de données peuvent être de différents types : xml, scriptée (java, javacript) et jdbc (vous pouvez utiliser un constructeur de requête similaire à celui de MS Access). Si nécessaire, vous pouvez même ajouter des colonnes calculées.
Les rapports peuvent être construits par glisser-déposer (drag&drop) et exportés en pdf, ps, xls, ppt, doc ou html paginé. Grâce à un ensemble d’évènements, à différents niveaux (rapport, page, source de données), vous pouvez ajouter de l’interactivité à vos rapports en traitant les évènements aussi bien en javacript qu’en java. Par exemple, vous pouvez ouvrir une boite de dialogue sur un clic souris.
Les graphiques peuvent être exportés dans un fichier jpg, un fichier pdf, un composant swt ou swing. Vous pouvez même les animer (exemple : faire tourner le graphique).
Le déploiement peut aussi bien se faire dans un serveur d’application J2EE, dans une plateforme de client riche ou dans une application indépendante.
BIRT is a reporting tool compound of 3 parts : the chart engine, the report engine and the design engine.
Data sources can be of different kinds : xml, scripted (java, javacript) and jdbc (you can use a MS Access like query builder). If needed, you can even add computed columns.
Since the designer is based on the eclipseRCP, you can directly debug the javascript code (which is ran by Mozilla Rhino) and plugins are managed by OSGi.
Reports can be built by drag and drop and exported in pdf, ps, xls, ppt, doc or paginated html. Thanks to a set of events, at different levels (report, page, data source), you can add interactivity to your reports by handling events both in javacript and in java. For example, you can open a popup dialog when a mouse click happen.
Charts can be exported to a jpg file, a pdf file, an swt or a swing component. You can also animate them (example : make the chart rotate).
The possible deployment scenarios are J2EE Application Server, RCP and standalone.
can watch tests execution and react according to the result
get all the files that need to be compiled
based on conventions : allow to define rules to apply for any project in a community/enterprise
allows to execute some standard operations on a task without the task does even know it
supports plugins : they can be written in java
can access the execution plan of a scenario (examples : compile, clean…)
can react to a given thrown exception
smart task exclusion (A-> B and E, but exclude B)
smart merging of tasks (to avoid executing a task more than one time)
smart skipping (example: exclude a task if the classes directory is unchanged)
the build script knows the compiled classes (written in groovy or java). example : you can write « new MyBuild() » in a script, where MyBuild is a class developped in java
there is a gradle wrapper to use gradle without installing it : it’s useful for open source projects to use a given version without depending on what’s installed on user’s computer
a support for C/C++ projects has great chance to come due to strong needs
from version 0.7 to 1.0 : there will be breaking changes but releases notes will explain how to fix existing scripts
gradle allows to add new maven scopes, which can’t be done with maven
gradle can retrieve all transitive dependencies of a maven artifact
gradle can retrieve artifacts from a maven repository or deploy them to a maven repository : it uses maven for doing these tasks, which means it’s fully maven compliant
complete freedom for multiple project builds
maven uses configuration inheritance and force to create synthetic projects to share some tasks/configurations. Gradle can inject configuration or tasks in any project
peut surveiller l’execution des tests et réagir suivant leur résultat
récupère tous les fichiers qui ont besoin d’être compilés
basé sur les conventions : permet de définir des règles à appliquer à tout projet dans une communauté/entreprise
permet d’executer certaines opérations standards sur une tache sans même que celle-ci ne le sache
support des plugins : ils peuvent être écrits en java
peut accéder au plan d’exécution d’un scénario (exemples : compile, clean…)
peut réagir à une exception donnée lorsqu’elle est levée
exclusion élégante de tache (A-> B et E, mais exclu B)
fusionnement élégant de taches (pour éviter qu’une tache ne s’execute plus d’une fois)
évitement élégant de taches (exemple: exclu une tache si le répertoire des classes est inchangé)
le script de build connait les classes compilées (écrites en groovy ou java). exemple : vous pouvez écrire « new MyBuild() » dans un script, où MyBuild est une classe développée en java
il existe un encapsuleur gradle pour utiliser gradle sans l’installer : c’est utile pour les projets open source pour utiliser une version donnée sans dépendre de ce qui est installé sur l’ordinateur de l’utilisateur
un support pour les projets C/C++ a de grandes chances de venir à cause d’un fort besoin
de la version 0.7 à 1.0 : il y aura des changements qui vont casser l’existant mais les notes de livraison expliqueront comment corriger les scripts existants
avec ant, il n’y a aucun moyen de manipuler une tache. Ce n’est pas le cas avec gradle grace à son API riche.
ant est basé sur xml, ce qui lui confère une interaction quasi unidirectionnelle. Gradle utilise groovy pour fournir une interaction bidirectionnelle de manière orientée objet.
gradle peut appeler n’importe quelle tache de manière orientée objet :
importer un fichier build.xml créé pour ant
utiliser les cibles ant comme des taches gradle
ajouter quelques cibles manquantes dans le fichier build.xml
gradle permet d’ajouter de nouveaux scopes maven, ce qui ne peut être fait avec maven
gradle peut retrouver toutes les dépendances transitives d’un artefact maven
gradle peut retrouver les artefacts d’un repository maven ou les déployer sur un repository maven : il utilise maven pour faire ces taches, ce qui signifie qu’il est entièrement compatible avec maven
liberté complète pour la construction de projets multiples
maven utilise l’héritage de configuration et force à créer des projets synthétiques pour partager certaines taches/configurations. Gradle peut injecter de la configuration ou des taches dans tout projet
les dépendences peuvent s’exprimer en terme de projet