vendredi 19 décembre 2008

Veille technologique semaine 51

Pour cette semaine 51, je vous propose les articles suivants :
  • c'est la saison des prévisions pour 2009 et le JDK 7. Il est reporté début 2010 avec une réduction des évolutions. Certaines ne sont pas encore prêtes.
  • La conférence Devoxx 2008 en Belgique a permis d'avoir des précisons sur le JDK 7.
  • Un résumé, jour par jour, des conférences Devoxx 2008.
  • Un article sur une présentation de Devoxx au sujet des estimations et des engagements dans le développement du logiciel.
  • Ensuite, deux articles au sujets des composants logiciels. Un premier qui explique l'intérêt de la modélisation UML2 et qui propose le concept de composant
  • et un exemple de modèle de composants de l'industrie : SCA (Services Component Architecture) proposé par IBM et actuellement normalisé chez OASIS qui a en charge des spécifications. Une implémentation open sources est proposée par le groupe Apache avec TUSCANY.
  • La société Excelsior qui sort la version 6.4 de son compilateur Java. Cette version propose une gestion de la propriété intellectuelle du code Java avec un maquillage complet du binaire.
  • L'article suivant rappel, pour ceux qui font des IHM avec Swing, que le thread de l'IHM (EDT : Event Dispatcher Thread) est le seul thread autorisé à manipuler un JavaBean Swing. C'est une règle qu'il faut respecter à 100% sinon les disfonctionnement arrive très vite (dead lock, comportement non conforme ou non prévue, ...). Swing n'est pas thread safe, il faut en tenir compte.
  • Sortie de l'update 11 du JDK 6, avec son lot de bugs corrigés.

Bonne lecture.



Year in Review: What to expect in Java SE 7
An overview of features in and out of the next Java specification. The current target for Java SE 7 is early 2010. We can expect a platform JSR to arrive in the first quarter of 2009.
  • Better dependency management
  • Project Jigsaw and the 'module' keyword
  • (More) NIO APIs
  • Tackling the time dimension
  • Parallel processing
  • Better precision through annotations
  • Simplifying Swing
  • Java Management Extensions (JMX) updates
  • Language changes
  • Dynamic-language support
  • Java SE 7 and the future of Java


From Devoxx: JavaFX on show, JDK 7 News !
Closing out a busy week here at Devoxx, the release of JavaFX and JDK 7 news have been the talk of the town !



Java 7 Update from Mark Reinhold at Devoxx
This is a summary of Mark Reinhold's Java 7 update given at Devoxx, with a few comments from myself. Mark described his presentation as a provisional plan and not binding. The changes in Java 7 will come from Sun and others.


Devoxx 2008 : Bien plus que Java. En effet.

Devoxx, comme vous le savez, c'est le nouveau nom donné à Javapolis. Et ce nom permet bien plus de liberté qu'auparavant.

Avant, Javapolis oblige, tout tournait autour de Java.
Maintenant, avec Devoxx, les organisateurs peuvent se permettre d'étendre le spectre. Même si le focus est toujours principalement sur Java.




Devoxx : présentation sur les estimations du temps de dév
Estimation : Prediction is a very difficult task especially about future ones…"
Giovanni demande à l'assistance qui donne des estimations de temps de développement ? la majorité de la salle. Qui se fait négocier par son managment ces temps de développement ? Encore une fois pas mal de monde.

Il explique ensuite la différence entre "Estimation" et "Engagement".
L'estimation est la mesure objective du temps nécessaire pour faire une tâche. Cette estimation n'est donc pas négociable.
L'engagement représente le but à atteindre et donc la promesse. Cette promesse regroupe un niveau de qualité, un certain nombre d'itérations, bref c'est bien la promesse de ce que le client aura. L'estimation c'est le prix à payer.

Faut-il surestimer ou sous-estimer ?
A cette question, Giovanni répond que les développeurs sont trop optimises de 30%. Par sécurité il faut donc mieux ajouter un peu plus à une estimation initiale.
Cependant, l'effet inverse s'appelle la loi de Parkinson : le temps de travail temps à rejoindre le temps donné pour effectuer une tâche. Si tu me donnes 10 jours pour faire cette tâche, je vais tendre à remplir ces 10 jours, c'est humain.
Avoir trop de temps disponible entraine aussi le phénomène de procastination. On tend à remettre à demain des tâches.



Définir une architecture par composants avec UML2
Les limitations de la modélisation / programmation par objet sur la réutilisabilité et l'autonomie, ont renouvelé l'intérêt pour les composants. En effet, réutiliser une classe signifie souvent importer un ensemble de classes liées, mal identifié par l'utilisateur. Hériter d'une classe signifie créer une dépendance forte, qui sera excessivement sensible aux évolutions de la classe héritée. Les points d'utilisation, les modes d'assemblage, l'autonomie des éléments réutilisés, le contrat d'utilisation ne sont pas fournis par la programmation/modélisation objet.

La notion de composant a été un ajout majeur introduit dans le standard UML2. Le composant permet en effet d'isoler des parties de logiciel en unités autonomes, avec des points de connexion bien définis. Les notions de "structure interne" de classe, de port et de part sont des notions nouvellement introduites offrant des mécanismes utiles pour les architectures orientées composant. A travers ces mécanismes, UML2 apporte la modélisation par composant. Ces mécanismes d'assemblage de composants permettent de réaliser le vieux rêve du "lego logiciel", c'est à dire d'assembler des composants qui ne se connaissent pas obligatoirement, pour former un système englobant. Pour ceux qui ont connu l'enfer de l'intégration logicielle, ou pire encore l'intégration logiciel / matériel, ces mécanismes sont très prometteurs.



Introduction à SCA (Service Component Architecture)
SCA (Service Componant Architecture) est un ensemble de spécifications visant à simplifier la création et la composition de services (indépendamment de leur implémentation) dans le cadre d'Architectures Orientées Service (SOA). SCA propose donc un modèle de programmation pour la construction d'applications à base de composants suivant le paradigme SOA. Ce modèle se base notamment sur l'idée qu'un service de niveau N se construit par assemblage / agrégation / orchestration de services de niveau N-1 ou N (Et ce quelque soit la hiérarchisation choisie. Par exemple : Services organisationnels, Services métiers, Services techniques).

A ce titre, SCA fournit deux niveaux de modèle :

  • Un modèle d'implémentation : Construire des composants qui fournissent et utilisent des services
  • Un modèle d'assemblage : Construire une application métier à forte valeur ajoutée en liant entre eux un ensemble de composants.

Ainsi, SCA insiste sur une séparation forte entre l'implémentation des services et leur assemblage.

Le modèle SCA se veut agnostique vis-à-vis :
  • Des technologies d'implémentation des composants de service. Il inclut entre autre les technologies d'implémentation suivantes : Java, C++, BPEL, XQuery ou SQL.
  • Des technologies d'exposition et d'invocation des composants de services (même si WSDL et les interfaces java sont mis en avant).

SCA permet de décrire des services et leur assemblage indépendamment de toutes considérations techniques d'implémentation.


Excelsior JET
Accelerate, protect, and deploy your Java applications.
Excelsior JET is a compliant Java SE 6 technology implementation with an ahead-of-time (AOT) compiler and a deployment toolkit. Use it if you want to:
  • Speed up your Java applications without any source code changes or hardware upgrades
  • Protect your Java code from decompilers without compromising performance
  • Build compact, professional installers for your Java applications without dependency on the JRE

Excelsior JET 6.4 is the first release that introduces features designed specifically for IP protection enhancement.



Swing threading and the event-dispatch thread
The evolution and pitfalls of Swing's single-threaded event model.
To ensure your Swing components are accessed correctly you should always create the entire UI in the event-dispatch thread, as shown here:

Runnable runner = new Runnable() {
public void run() {
// ...create UI here...
}
}

EventQueue.invokeLater(runner);

Moving your initialization code to the event-dispatch thread is the only way to ensure that your Swing GUIs are thread safe. Yes, it will feel awkward at first, but progress usually does.




JavaTM SE 6 Update Release Notes Changes in 1.6.0_11


vendredi 12 décembre 2008

Veille technologique semaine 50

Pour le bulletin de cette semaine 50, je vous propose les sujets suivants :
  • une première rétrospective de l'année 2008 sur la technologie Java : du langage à la plate-forme.
  • JavaFX est sorti depuis début décembre, et un certain nombre d'articles commencent à sortir. Une version 1.1 de JavaFx devrait voir le jour en Février, et une autre version 1.5 fera son apparition aux alentours de Juin 2009. Je vous propose les articles suivants :
    • SUN et JavaFX
    • des plugins qui permettent d'utiliser photoshop ou illustrator comme outil de composition visuel pour JavaFX
    • la FAQ de JavaFX
    • un article sur la création d'une petite application en JavaFX
  • Comment mesurer la productivité ? C'est une question récurrente pour laquelle l'article propose une solution qui a fait ses preuves : les tests automatisés pour permettre le refactoring.
  • Le planning de la conférence annuelle Javoxx (anciennement JavaPolis) qui se passe en Belgique en décembre. C'est une conférence très importante pour le monde Java avec des présentations de qualités. Ce planning montre un très grands nombre de sujets tous les plus intéressant les uns que les autres. Je vous indiquerais lorsque les slides seront disponible sur internet.
  • Un article au sujet de quelques amélioration des EJB proposé par la version EJB 3.1 avec : l'asynchronisme sur les services, une version d'EJB lite, ...
  • un petit article au sujet des exceptions en Java et de leur bon usage.
  • encore une page sur les performances en Java.
  • et enfin, pour ceux qui font de l'IHM avec Swing et Awt, sur la suppression de la limitation sur le mélange de composants lourd et léger : enfin corrigé dans le version JDK 6 update 12 (non encore officiel) et JDK 7.
Bonne lecture


Year in Review: Java in 2008 - What just happened?

When high-tech history is inscribed for the ages, 2008 may be remembered as the year Java tipped from a language-centric to a platform-centric technology. Andrew Glover kicks off JavaWorld's Year in Review series with a look back over the last 12 months in Java development, when alternate languages for the JVM took center stage, new directions emerged in the enterprise space, and Sun Microsystems staked its claim on the client side -- with or without Swing.


With JavaFX, Sun seeks new coders, new revenue.
JavaFX also comes with a slick feature, the ability to move running applications out of the browser and onto the desktop--and back, if desired. Essentially, they can change their nature and abilities according to where they're housed. And the same application also can run on JavaFX Mobile, holding the promise for programmers that they won't have to endlessly rewrite the same applications for different media.

"You can build a media player, run it in a browser, then you can simply drag it out of your browser onto your desktop, and it becomes a desktop application automatically. It's the same code, the same application," said Jeet Kaul, Sun's senior vice president of Java engineering. Moving to the desktop, the application could take advantage of new screen real estate that affords a better user interface and new permissions for tasks such as writing files to a hard drive, Kaul said.

JavaFX 1.0 Production Suite enables designers to convert their rich media assets to JavaFX format and view the converted files before handing them off to JavaFX application developers. JavaFX 1.0 Production Suite consists of three components:

JavaFX Plugin for Adobe Photoshop (exports graphics in Photoshop to JavaFX format)
JavaFX Plugin for Adobe Illustrator
(exports graphics in Illustrator to JavaFX format)

JavaFX Media Factory
(converts SVG files to JavaFX format and provides a Viewer for displaying JavaFX format files)



JavaFX Technology - FAQs


Getting Started With JavaFX Technology
Creating Your First JavaFX Application
This section guides application developers in creating their first JavaFX application by using the NetBeans IDE 6.5 for JavaFX 1.0 technology. For web designers who want to get started using the JavaFX 1.0 Production Suite, see the Getting Started With JavaFX 1.0 Production Suite article.


Comment mesurer la productivité ?
Depuis toujours, dans le monde du logiciel, on entend « Il faut augmenter la productivité des développements ». Il ne suffit pas d'en parler pour améliorer la productivité. Comment passer d'un slogan très abstrait à des actions concrètes et des résultats tangibles ?

On ne peut améliorer que ce que l'on mesure. Il est donc impératif de trouver un indicateur permettant de vérifier l'amélioration recherchée. Les mesures comme le nombre de lignes de code ou le nombre de points de fonctions, encore utilisées aujourd'hui, sont trop éloignées de la valeur produite pour être intéressantes. Un indicateur beaucoup plus proche de la satisfaction client, et donc plus pertinent, est « le nombre de fonctionnalités sans erreur ajoutées à un logiciel durant un période donnée », ce que l'on pourrait appeler le débit de fonctionnalités.
Malgré les différences de technologies, les deux tendances (1) et (2) ont une caractéristique commune : après un certain temps, le débit de fonctionnalités chute. Le profil 3 montre les équipes arrivant à conserver une augmentation de leur productivité. Quelle caractéristique magique ont-elles ?

Une technologie spécifique ? Non. Une architecture spéciale ? Non. Elles observent simplement deux disciplines : le test automatisé et le remaniement permanent du code.


Javoxx 2008 - Schedule

Avec 3200 personnes inscrites la conférence Devoxx 2008 qui a eu lieu du 8 au 12 décembre 2008 est complète ! C'est un vrai plébiscite et une grande réussite pour le JUG Belge, organisateur de cette conférence.


EJB 3.1 – EJB New and Improved!

The EJB 3.0 specification was a huge improvement from what we were used to in the early versions of EJB. Available as an early draft, EJB 3.1 has many more features and is even easier to use. Let's take a brief overview of a few interesting topics being considered in this new and improved version of EJB.


Exceptions in Java

In this article, we look at exception handling in Java. We start with the history of exceptions, looking back at the precursor of Java, a language called Oak. We see reasons why Thread.stop() should not be used and discover the mystery of the RuntimeException name. We then look at some best practices that you can use for your coding, followed by some worst practices, in the form of exception anti-patterns.


Java Performance

I remember 12 years ago, when Java was on the rise, and it was seen as "too high level" and slow when compared to C and C++.
The latter languages were the languages of choice when you wanted to achieve maximum performance.
Java, on the other hand, was seen back then as a high overhead alternative, due to its features like bytecode generation by the compiler, automatic memory management, references instead of pointers, and built in array bounds checks. At that time, those features looked like a costly overhead. The reasoning behind that point of view went more or less along these lines:

  • Java provides automatic array bounds verification, which means that it has to check the limits of the array at every access, therefore it has to be slower.
  • Java doesn't have pointers. There must be an overhead every time a reference is accessed, therefore Java is slower than C/C++.
  • Java has the garbage collector, therefore the virtual machine has to spend a long time finding unreachable objects, therefore Java is slower than C/C++.
  • Java compiles to bytecode, therefore it loses to C and C++ because those two languages compile to native code.

The reasoning above may have been true back then, in the pre-HotSpot era of Java 1.0 and 1.1, but since the introduction of the HotSpot virtual machine in java 1.3 those problems have been greatly reduced and in some cases Java now even beats C and C++ in terms of performance.


Allow limited mixing of heavy and lightweight components

Release Fixed 7(b19), 6u12(b01) (Bug ID:2167756)



vendredi 5 décembre 2008

Veille technologique semaine 49

Pour cette semaine 49, je vous propose les sujets suivants :
  • sortie de JavaFX en version 1.0. Après plus d'un an depuis l'annonce à JavaOne en juin 2007, SUN propose la technologie JavaFX en version 1.0. Une technologie basée sur Java, pour réaliser des applications IHM pour internet : les RIA (Rich Internet Application). Le terme riche fait référence à l'expérience utilisateur : interactions, look and feel, multimédias, etc... pour des IHM connectés à des applications distantes à travers internet. C'est une technologie qui se place en concurrence de la technologie Air d'Adobe (flash) et de la technologie Silverlight de Microsoft, ou de l'HTML 5. C'est ambitieux de la part de SUN de se placer en challenger.
  • JavaFX c'est quoi ?
  • FAQ JavaFX
  • JavaFX script
  • La version 2.0 des API de persistance : JPA avec les requêtes basées sur des critères typées. C'est une avancé importante sur le chemin de l'intégration d'un langage de requête dans Java, comme LINQ pour C#.
  • LIQUidFORM par google qui propose de résoudre le même genre de problème de requêtes typées pour JPA.
  • Un article technique sur le principe de compression des pointeurs mémoire pour les JVM 64 bits en pointeur 32 bits. Cette compression permet d'avoir les avantages du mode 64 bits du pentium (meilleures performances) sans les inconvénients de la taille des pointeurs 64 bits : la JVM est en mode 64 bits mais avec des pointeurs 32 bits, ce qui donne une mémoire maximum adressable de 32 Go = 4Go x 8 = 32G octets. Question : pourquoi 4 x 8 ? A votre avis ? Réponse dans l'article.
  • L'article suivant est une explication de ce principe de compression de pointeur : oops = "ordinary object pointer"
  • Un article sur l'analyse de la couverture de code. C'est un point incontournable pour augmenter la qualité de code.
Bonne lecture.


JavaFX Technologies At a Glance
JavaFX provides a productive development environment for web developers, mashup authors, and Java developers to quickly and easily build the next generation of rich internet applications (RIAs). With JavaFX, designers and developers can collaborate on building high-impact RIAs. Designers gain a broad set of tools to complete the designer/developer workflow, and developers have a simple, declarative scripting language with the right set of tools.

site JavaFX
http://javafx.com

Quickly and easily create and deploy Rich Internet Applications with JavaFX
It's here. The JavaFX Rich Client platform. A platform and tools suite that offers distinct advantages to Web developers, Web designers, and Java developers that are building rich, connected experiences.


Frequently Asked Questions : JavaFX
JavaFX is an expressive rich client platform for creating and delivering rich Internet experiences across all screens of your life.
JavaFX is fully integrated with the Java Runtime and takes advantage of the performance and ubiquity of Sun's Java Runtime Environment that is installed on literally billions of devices worldwide. In addition, JavaFX fosters a productive and collaborative developer-designer workflow.
Web developers and designers can use JavaFX to imagine, create and express a real experience that jumps out of the browser and into our day-to-day lives. JavaFX is the powerful combination of a scripting language â€" JavaFX Script, a rich client platform and set of tools that enable a complete, productive and collaborative developer-designer workflow.



JavaFX Released: Top 10 Things to Know



Experiments With JavaFX Script

JavaFX was unveiled at JavaOne 2007 as a new initiative for consumer-oriented Java applications. The strategy includes a new programming language called JavaFX Script that is geared towards developing Java-based GUIs, as well as libraries and tools for developing desktop, browser and mobile applications.



Java Persistence 2.0 Public Draft: Criteria API :
Probably the most significant of the new features introduced in the JPA 2.0 Public Draft is the Criteria API. This is a non-string-based API for the dynamic construction of object-based queries.

Criteria queries are constructed in terms of query definition objects.
As with JPQL static and dynamic queries, criteria query definition objects are passed to the EntityManager createQuery method to create Query objectsâ€"and then executed using the methods of the Query API.

Loosely speaking, a QueryDefinition object can be thought of as a set of nodes corresponding to the semantic constructs of the query: domain objects, which correspond to the range variables and other identification variables of the JPQL FROM clause where clause predicates, which comprise one or more conditional expression objects select clauses, which comprise one or more "select item" objects order-by and group-by items subqueries and so on...




LIQUidFORM stands for Language Integrated QUeries
For Object Relational Mapping and is a Java library that provides a Java Domain Specific Language for building type-safe and refactoring proof JPA queries.



Language Integrated Queries For Object Relational Mapping
LIQUidFORM stands for Language Integrated QUeries For Object Relational Mapping and is a Java library that provides a Domain Specific Language for
building type-safe and refactoring proof JPA queries. While the project draws its inspiration from the LINQ project, it is not LINQ for Java : its aim is only to help in writting JPA queries against your domain model. Read on to understand what LIQUidFORM is and what it is not.



32-bit or 64-bit JVM? How about a Hybrid?
Before x86-64 came along, the decision on whether to use 32-bit or 64-bit mode for architectures that supported both was relatively simple: use 64-bit mode if the application requires the larger address space, 32-bit mode otherwise. After all, no point in reducing the amount of data that fits into the processor cache while increasing memory usage and bandwidth if the application doesn’t need the extra addressing space.

When it comes to x86-64, however, there’s also the fact that the number of named general-purpose registers has doubled from 8 to 16 in 64-bit mode. For CPU intensive apps, this may mean performance at the cost of extra memory usage. On the other hand, for memory intensive apps 32-bit mode might be better in if you manage to fit your application within the address space provided. Wouldn’t it be nice if there was a single JVM that would cover the common cases?



Compressed oops in the Hotspot JVM
What's an oop, and why should they be compressed?
An "oop", or "ordinary object pointer" in HotSpot parlance is a managed pointer to an object. It is normally the same size as a native machine pointer, which means 64 bits on an LP64 system. On an ILP32 system, there is a maximum heap size of somewhat less than 4Gb, which is not enough for many applications. On an LP64 system, though, the heap for any given run may have to be around 1.5 times as large as for the corresponding IPL32 system (assuming the run fits both modes). This is due to the expanded size of managed pointers. Memory is pretty cheap, but these days bandwidth and cache is in short supply, so significantly increasing the size of the heap just to get over the 4Gb limit is painful.


L'analyse de couverture de code en Java
Il ne reste plus grand monde pour soutenir que l'écriture de tests unitaires automatisés est une perte de temps sur un projet logiciel - la notion de dette technique entre dans les moeurs. Cette prise de conscience salutaire se heurte pourtant souvent à deux grandes catégories de difficultés :
Le conservatisme - pour ne pas dire la stupidité - de certains chefs de projet, qui persistent à voir dans l'écriture des tests une activité contre-productive, qui servira de variable d'ajustement au moindre coup de grisou. L'existant : quand le projet n'a pas systématisé la pratique du test dès son origine et que la multiplication des anomalies tardives le pousse à la réintroduire. Par où commencer ?

Pour le premier point, la solution passe par un effort pédagogique, ou, pour les cas désespérés, par une reconversion imposée ou un congé sabbatique.
Pour le second, il faut un peu de bon sens, et un peu d'outillage.

C'est sur le deuxième aspect qu'interviennent les outils d'analyse de couverture de code (ou "code coverage" en anglais). Dans la suite, nous verrons que ces outils ne permettent pas
d'évaluer les tests unitaires d'un point de vue qualitatif, mais qu'ils peuvent en revanche apporter au bon sens un précieux appui en répondant aux questions suivantes :
  • Quels sont les tests unitaires déjà en place ?
  • Les tests sont-ils en phase (à jour) avec le code qu'ils testent ?
  • Les fonctions critiques de l'application sont-elles couvertes par les tests ?