skip to main |
skip to sidebar
Pour le bulletin de la semaine 27 et 28, je vous propose les sujets suivants :
- Le site Twitter qui passe du langage Ruby au langage Java, pour des raisons de performance mais aussi de maintenance plus productive avec un langage à typage fort : Java par rapport à un langage à typage faible : Ruby.
- Deux articles au sujet des expressions lambda ou closures : explication et historique.
- La version 3.7 d'eclipse qui vient de sortir inclus un composeur visuel pour les IHM en Swing, SWT (Standard Widget Toolkit) ou GWT (Google Web Toolkit) : WindowBuilder.
- Le compte rendu du club Java de PARIS pour la soirée sur le cloud : résumé.
- Un article sur la machine virtuelle IKVM qui est capable de faire tourner du byte code Java sur la machine virtuelle DotNet. Il est possible d'utiliser le framework DotNet avec du code source Java.
- Cinq articles qui résume la modélisation UML pour les développeurs Java.
- Un exemple de code Hello World en Java et en Ruby
- Un article sur Java qui explique pourquoi il est interdit de faire un return ou de lancer une exception dans un bloc finally.
Bonne lecture
Twitter Shifting More Code to JVM, Citing Performance and Encapsulation As Primary Drivers
While it almost certainly remains the largest Ruby on Rails based site in the world, Twitter has gradually been moving more and more of its stack to the JVM. The change is partially motivated by oft-cited advantages of the JVM, such as performance and scalability, but is also driven by a desire for better encapsulation of individual services, and other architectural concerns.
Closures for Java "BGGA" project
- BGGA closures specification: Closures for the Java Programming Language (v0.5)
- Doug Lea's jsr166y fork-join concurrency framework: without function types and with function types. Get the code here.
- Latest openjdk prototype: http://www.javac.info/closures.tar.gz (updated 2008-08-11)
- Neal's talk about BGGA closures with Q&A
- Differences between the openjdk prototype and the spec (v0.5)
- Open issue list: Closures: Open Issues (v0.5)
- Homepage for the openjdk closures project
- A library for functional programming.
- A definition of closures
- comment on extension methods
A Definition of Closures
There has been some confusion over our proposal to add closures to the Java Programming Language. After all, doesn't Java already have closures in the form of anonymous inner classes? What is the point of adding something to the language that it already has? To some there appears to be a lot in the proposal that has nothing to do with closures, including the control invocation syntax, null as a type, Unreachable, throws type parameters, function interface types, and "nonlocal" returns. In my Javapolis talk I tried to give an explanation for why these features are in the proposal from the practical point of view of what kinds of things would be possible that were not formerly possible. But that begs the question: why do we call it "Closures" for Java? In this blog post I'll try to show how the definition of closures relates to the features of the proposal, and identify which features of the proposal do (and which do not) result from the definition.
WindowBuilder Pro Quick Start
Paris JUG "Cloud"
Voici la retranscription de la soirée du Paris JUG du 5 juillet, dédiée au Cloud.
A l'origine, seul Patrick Chanezon devait intervenir, mais toute la clique du cloud à
la Française ayant été prévenue de la soirée, ce sont finalement 6 speakers qui se
sont partagés la scène - même si les derniers ont dû parler très vite compte tenu du planning particulièrement serré !
Cloud par-ci, cloud par-là, tant et si bien qu'en sortant il pleuvait... Les aléas de la
météo font parfois écho à ceux de la technique.
IKVM Introduction
IKVM.NET is an implementation of Java for Mono and the Microsoft .NET Framework. It includes the following components:
- A Java Virtual Machine implemented in .NET
- A .NET implementation of the Java class libraries
- Tools that enable Java and .NET interoperability
UML for the Software Developer, Part 1: Building Classes
Whatever language you code in, however you feel about documentation, and whichever process you ascribe to—you will need to model. Whether those models are in a formal charter, reference document, part of a diagram, or on the back of a napkin, you as a software developer will end up using models or modeling yourself.
Why do we need to model software? After all, aren't the acts of coding and refactoring of that code enough? That depends on what is meant by enough! You could code up some software, hand it in, and go through a constant refactoring process with the client. This is how most software is developed today. However, times are changing. A decade ago, a game would have been developed by a single developer in the basement. Graphics were primitive and it was enough to produce a few sprites, some cute screens, and an occasional story line.
UML for the Software Developer, Part 2: Mastering Associations
Associations are a key part of the UML lexicon. Use them to define the ways in which your application's classes communicate. In this article you'll see that adding a database introduces design patterns for the first time using the façade pattern.
by Mark Goetsch lasses are only the first step to understanding UML. In my last article I discussed classes in UML and how they are coded using C#. In this article I will tie-up a few loose ends by describing how classes are arrived at and then march into how they relate to each other in UML using associations.
UML for the Software Developer, Part 3: Aggregating
Part 3 of this series on UML tackles aggregation, which is a special form of association.
Part 2 showed you how associations related one class to another, but this article shows that associations are not strong enough when you need to specify ownership.
In Part 2 we looked at associations, which are nothing more than references, but they can be directional and represent multiplicity. If we were restricted to our ability to generate code using UML this would be sufficient. If we
are offering guidance on how the application should be built, as well as auto-generated code, we need something more.
To continue with examples from the previous articles, your friends at Rich Men, Inc want to start tracking what stocks they buy for their clients. Ideally they would somehow offer some aggregated values for all of the stocks that a client has in order to boost their value to the client.
UML for the Software Developer, Part 4: Deployment Diagrams
Deployment diagrams act as the link and reference point between how the system is built and where it is displayed. Learn how capacity planning, n-tier development, and coordination of tasks between different teams can all benefit from these diagrams.
So far, you and I have journeyed through the realm of class diagrams. Classes are a good start for understanding how an application is hooked together, and while they describe the static relationships between the objects in the system, classes are just an abstraction of the software itself. What happens after the classes are
built? The answer is, of course, that they need to be deployed. But where? How do I model deployments? The answer is a new diagram type—the deployment diagram.
Deployment diagrams are one of the least understood—and most important-diagrams in the UML pantheon. Many developers don't even know what they are, yet consider themselves experts in UML. The purpose of a deployment
diagram is to model the execution environment for a project. They can also be used to describe the enterprise environment, but this is more the enterprise architect's domain.
UML for the Software Developer, Part 5: Component Diagrams
Their ability to show interdependencies between applications' components make
component diagrams invaluable. They can however be surprisingly complex. Find out how to use the right architectural patterns within your component diagrams to make them manageable.
According to Clemens Szyperski (author of "Component Software—Beyond Object-Oriented Programming,"), software components are binary units of independent production, acquisition, and deployment that interact to form
a functioning system. He continues to add that a software component can be deployed independently, is a unit of third-party composition and has no (externally) observable state. In UML we use component diagrams to break down systems into understandable chunks that show the dependencies between components.
Do not return in a finally block: return will swallow your exceptions
I was recently working on a code, which was failing without giving any exception.
So I had to add lots of logging to the code, to see where is the bug. I caught nothing via this method.
So I decided to check out the module source code and yeah finally I found it while
debugging. The module was correctly implementing what was required and
generating the required Exception as expected.
Pour le bulletin de cette semaine, je vous propose les sujets suivants :
- le prochain standard C++ devrait être prêt avant la fin de l'année. Le précédant date de 1998.
- Oracle confirme que OpenJDK est l'implémentation de référence qui sert de base à la distribution d'Oracle.
- Changement du look de la Javadoc du JDK7 : changement des stylesheet.
- Un résumé de la présentation du framework Akka : le pattern actor pour des systèmes distribués, scallable et tolérant au panne.
- Un chapitre : la meilleur ligne de code est celle qui n'est pas nécessaire. Pourquoi réduire le nombre de lignes de code.
- Présentation d'un runtime pour faire exécuter les applications android (présent sur les smart phones et tablettes avec le processeur ARM) en natif processeur x86 sur windows.
- Le pattern object null en remplacement des exceptions NullPointerException : l'invention qui a coûté très chère.
- La gestion des ressources dans la syntaxe du JDK 7
- Les classes atomiques du JDK 5 : comment faire des lecture-modification-ecriture sans verrous.
- La classe Objects du JDK 7 et la méthode equals().
Bonne lecture
The New C++: Lay down your guns, knives, and clubs
"The world is built on C++," Herb Sutter tells The Reg. Considering he's one of the language's chief stewards, we question his impartiality. But he does have a point. After more than 30 years – depending on whose numbers you swallow (these or these) – C++ remains one of computing's most popular programming languages, favored for its speed if not its simplicity.
Apple's Mac OS X, Adobe Illustrator, Facebook, Google's Chrome browser, the Apache MapReduce clustered data-processing architecture, Microsoft Windows 7 and Internet Explorer, Firefox, and MySQL – to name just a handful – are written in part or in their entirety with C++.
And while new languages have since been born, C++ has endured. Java is the only one to have outpaced it in popularity, according to the TIOBE Index. PHP, Ruby, and JavaScript? Sure, some might claim that they are the future, but C++ is the past, the present, and the future.
According to Sutter, C++ is on the verge of its biggest change in the 13 years since it became an official ISO standard, a change that will make it relevant for the next two decades.
The recently finished C++ ISO standard, with the working name of C++0x, is due to be published this summer, following the finishing touches to the ISO spec language and standards wonks agreed upon in March.
Sutter didn't create C++, but he is chair of the ISO's C++ committee in addition to being a noted C++ programmer, author, and chief native-languages architect at Microsoft.
OpenJDK to be Java SE 7 Reference Implementation, Bylaws Ratified by Oracle
The OpenJDK Community Bylaws have been ratified, with 70 votes in favour, no votes against, and nine abstentions. Whilst this represents a major milestone for the OpenJDK project, building from an effort which was started by Sun in 2007, it should be noted that 61 of the yes votes were from Oracle employees, and 46 people who were eligible to vote didn't bother.
New Java SE 7 Javadoc API Documentation Appearance
In my last post, I briefly referenced the Jonathan Gibbons's post What's Up, JavaDoc? that describes some recent changes to Javadoc, including changes that allow a CSS stylesheet to be applied to the documentation. Mark Reinhold's post JDK 7: Are we there yet? talks about the changes to the Java SE 7 API default display style. In this post, I briefly look at this change.
Akka: Simpler Scalability, Fault-Tolerance, Concurrency & Remoting through Actors"
Lors de la What's Next, Jonas Bonér a présenté Akka, un framework facilitant la réalisation d'applications concurrentes, pouvant passer à l'échelle et tolérantes aux erreurs. Cet article tente de retranscrire le contenu de cette présentation.
Chapter 14. Writing Less Code
Knowing when not to code is possibly the most important skill a programmer can learn. By reusing libraries or eliminating features, you can keep your code base lean and mean. Every line of code you write is a line that has to be maintained.
The most readable code is no code at all.
The best way to cope is to keep your code base as small and lightweight as possible, even as your project grows.
Native x86 Android runtime will enable Android apps on Windows
A startup called BlueStacks has developed an Android runtime environment for the Windows operating system. It will enable users to run Android applications alongside conventional Windows software on Microsoft's operating system.
The technology impressed some major investors who have supplied $7.6 million in Series A funding so that BlueStacks can turn its software into a business.
Presentation: "Null References: The Billion Dollar Mistake"
Abstract: I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years. In recent years, a number of program analysers like PREfix and PREfast in Microsoft have been used to check references, and give warnings if there is a risk they may be non-null. More recent programming languages like Spec# have introduced declarations for non-null references. This is the solution, which I rejected in 1965.
Better Resource Management with Java SE 7: Beyond Syntactic Sugar
The typical Java application manipulates several types of resources such as files, streams, sockets, and database connections. Such resources must be handled with great care, because they acquire system resources for their operations. Thus, you need to ensure that they get freed even in case of errors. Indeed, incorrect resource management is a common source of failures in production applications, with the usual pitfalls being database connections and file descriptors remaining opened after an exception has occurred somewhere else in the code. This leads to application servers being frequently restarted when resource exhaustion occurs, because operating systems and server applications generally have an upper-bound limit
for resources.
Java theory and practice: Going atomic
Summary: Until JDK 5.0, it was not possible to write wait-free, lock-free algorithms in the Java language without using native code. The addition of the atomic variable classes in java.util.concurrent changes that situation. Follow along with concurrency expert Brian Goetz as he explains how these new classes have enabled the development of highly scalable nonblocking algorithms in the Java language.
Java 7 Objects-Powered Compact Equals
Obi Ezechukwu's blog High-Octane Java recently featured the post Compact Equals, which compares an implementation of a Java class's overridden equals method in traditional form versus one implemented using arrays of the class's fields and then invoking Arrays.equals on those arrays. I am using this blog post to build upon these examples to demonstrate the utility of Java 7's Objects.equals(Object, Object) method and will demonstrate the usefulness of Objects.hash(Object...) along the way.
Pour le bulletin de cette semaine, je vous propose les sujets suivants :
- sortie de la version 3.7 de l'outil eclipse Indigo : 62 projets, 46 millions de ligne de code, 408 développeurs, 49 organisations qui contribues.
- L'avenir de Java : comment Oracle va gérer cet écosystème.
- Sonar : la qualimétrie du logiciel pour tous.
- Un livre sur le CMMI avec un chapitre pour le niveau 2.
- Un article d'IBM au sujet du développement d'application Java temps réel : temps de réponse garantie.
- Les revues de code et les résultats.
- Le HTML5 et Microsoft : changement de stratégie ?
- Les optimisations de la machine virtuelle Java.
- Le garbage collector du JDK 7 : Garbage First
- Une demande d'évolution du langage Java : les énumérés devrait être extensible
- La méthode clone() en Java : comment faire ? A automatiser dans un outil UML.
Bonne lecture.
Eclipse 3.7 (Indigo) now available
Right on schedule, The Eclipse Foundation has released Eclipse 3.7 (Indigo). Actually, Indigo is a simultaneous release of dozens of projects including the Eclipse Platform, Java development tools, source control tools, GUI designers, and more. This is the eighth successive year in which the Eclipse community has shipped a coordinated release on schedule.
Eclipse Indigo Released
The Eclipse Foundation has announced the release of Eclipse Indigo, a combination of 62 projects with a combined total of 46 million lines of code between them. Eclipse has followed an annual release train of the last week or two of June since Callisto in 2006, although the Eclipse platform has been released annually since 2001.
The simultaneous release allows all projects to standardise on a particular set of dependencies; useful when later projects depend on earlier ones (such as JDT depending on Platform, or Mylyn on EMF). Prior to Callisto, projects would often have specific dependency sets which needed to be satisfied causing problems for wide adoption of certain projects. Since the annual combined release train, stability and interoperability between projects has improved dramatically.
L'avenir de Java se joue maintenant
Cela ne vous a sans doute pas échappé: cette semaine fut particulièrement riche en évènements liés à l'avenir du langage Java et aux instances qui gouvernent son évolution. Voici un tour d'horizon des moments les plus marquants.
Coup de tampon sur Java SE 7
Tout commence par le vote public du JCP (Java Community Process) au sujet de la JSR 336. Les enjeux étaient de taille, vu qu'il s'agit ni plus ni moins de la JSR Umbrella qui chapeaute la version 7 de Java SE.
Commençons par les bonnes nouvelles: la JSR a été approuvée! L'évènement a d'ailleurs été abondamment commenté, par exemple par nos confrères de Développez.com, de H Online ainsi que par Nicolas Martignole, et les résultats sont disponibles ici.
Java SE 7 est donc sur les rails, et c'est plutôt rassurant quand on pense que les spécifications finales et l'implémentation de référence sont attendues pour le 28 juillet prochain. Mais lorsqu'on se penche sur les détails du vote, le tableau est hélas nettement moins rose.
Certes VMWare, la Fondation Eclipse, Intel, SAP, HP, Ericsson et bien entendu Oracle lui-même ont voté pour sans réserves. Mais de nombreux membres — IBM, Red Hat, Goldman Sachs, Fujitsu ainsi que les JUGs brésilien (SouJava) et londonien (London Java Community) — ont émis de sérieuses réserves et ont tous souligné que leur approbation était due exclusivement aux « mérites techniques » de la JSR.
Quant aux grincheux, nous retrouvons Werner Keil qui s'est abstenu, et surtout Google qui — sans surprise — a voté contre.
Mais que reprochent-ils à cette JSR et, par-delà, à la firme de Larry Ellison?
Il s'agit tout d'abord du vieux problème des licences du TCK, dont la revue de presse s'est fait l'écho ici et là. Sun, puis ensuite Oracle, auraient placé des restrictions d'usage (Field of Use restrictions) restreignant les plateformes sur lesquelles le langage Java peut tourner et être certifié — nous y reviendrons.
La principale victime de cet état de faits est aujourd'hui Google et l'utilisation qu'il fait du projet Apache Harmony dans son système d'exploitation Android. En plein procès contre Oracle à ce sujet, Google a tenu à manifester son mécontentement par un vote négatif assorti d'un commentaire acerbe: « les licences du TCK ne doivent pas être utilisées pour restreindre ou créer une discrimination à l'encontre d'implémentations compatibles des spécifications Java en incluant des restrictions d'usage sur les implémentations testées. De telles licences ne sont pas conformes aux exigences du JSPA, et violent les attentes de la communauté Java quant à la libre implémentations des spécifications du JCP ». Pour rappel, le Java Specification Participation Agreement (JSPA) est le contrat même d'engagement des membres du JCP.
Un autre point vertement reproché à Oracle, notamment par les JUGs brésilien et londonien, concerne le manque de transparence du JCP lui-même. Oracle ferait preuve de mauvaise volonté à rendre publiques les archives de certains Expert Groups, en particulier celles du Project Coin. Cette attitude a manifestement compliqué la tâche des votants, à tel point que Werner Keil n'hésite pas à parler de « développements en cachette » — un comble pour un langage Open Source.
Y a-t-il un pilote dans l'avion?
Certains — Stephen Colebourne pour ne pas le nommer — n'hésitent pas à voir dans ce vote moins un satisfecit pour Java 7 qu'un arrêt de mort pour les ennemis d'Oracle, Apache Harmony en tête.
Dans son blog, Colebourne estime en effet que « le vote favorable ne fut possible que parce qu'Oracle a pris la décision de tuer Apache Harmony ». Il ne ménage d'ailleurs pas les membres actuels du JCP qu'il traite de « zombies » à la solde d'Oracle.
Or, malgré les protestations lors du vote, Oracle ne semble pas changer de cap. Quelle est sa stratégie actuelle?
Depuis le rachat de Sun, il semble que deux axes se dégagent dans la stratégie d'Oracle vis-à-vis de Java:
1. Empêcher les forks incontrôlés de Java pour des plateformes spécifiques (cf. Apache Harmony);
2. Conserver la sphère du développement mobile comme une source potentielle de revenus (cf. Google).
Toujours d'après Colebourne, c'est en effet à la lumière du procès Google vs. Oracle que l'on comprendrait mieux pourquoi Sun puis Oracle ont mis tant de soin à verrouiller la licence du TCK et se sont acharnés contre Apache Harmony. Le bouillant spec lead de la JSR « Three Ten » rappelle d'ailleurs qu'initialement Sun avait donné tous les gages nécessaires à la Fondation Apache; ce n'est que plus tard, sentant le danger imminent et notamment le risque de perdre la bataille sur le terrain du développement mobile, que Sun aurait retourné sa veste avec cette trouvaille juridique de génie que nous connaissons bien maintenant: la licence du TCK. Toujours selon Colbourne, cette stratégie est enfin sortie de l'ombre lors du comité exécutif du JCP du 6 octobre 2010: Oracle a alors exprimé publiquement ses craintes qu'Apache Harmony ne crée une menace de « fork » — menace que Google et son système Android, toujours d'après Oracle, auraient su habilement exploiter.
OpenJDK: libre certes, mais incontournable?
Chat échaudé craint l'eau froide: le différend avec Google est loin d'être terminé, mais Oracle semble d'ores et déjà en tirer les conséquences et veut désormais éviter de nouvelles menaces du type Google/Harmony en misant toutes ses cartes sur OpenJDK, projet auquel Oracle a habilement réussi à rallier IBM puis Apple.
Et c'est là qu'intervient le deuxième fait marquant de la semaine, signalé entre autres par nos confrères d'H Online: le 9 juin dernier, Henrik Ståhl, directeur des produits chez Oracle, a annoncé sur son blog que la nouvelle version de Java utilisera OpenJDK pour son implémentation de référence et non plus le JDK « maison » Sun/Oracle.
C'est à nouveau une affaire de licences: le JDK de Sun/Oracle est distribué sous la licence Binary Code (BCL). Cette licence est incompatible avec des implémentations Open Source (comme OpenJDK) en raison de composants comme le plugin Java, qui ne font pas partie du standard Java.
Oracle choisit donc de conférer à OpenJDK ses lettres de noblesse, en faisant de ce projet l'implémentation de référence de Java 7.
Concrètement, comment cela se passe?
D'après Ståhl, l'implémentation de référence sera disponible sous une double licence: BCL pour les implémenteurs commerciaux et GPL v2 avec exception de classpath pour les implémenteurs Open Source.
Autre changement notable: OpenJDK possède son propre TCK et la licence qui l'accompagne, baptisée OCTLA (OpenJDK Community TCK Licence Agreement), sera mise à jour afin de couvrir Java 7; le TCK sera alors théoriquement utilisable gratuitement par tout implémenteur Open Source.
Est-ce donc la fin du conflit autour du TCK?
Pas vraiment: les internautes, répondant à Ståhl, font observer que la licence OCTLA ne s'applique qu'à des implémentations « substantiellement dérivées » d'OpenJDK, et qui plus est, en cas de distribution par une tierce partie, impose qu'elles le soient sous licence GPL. La porte reste donc toujours close pour Apache Harmony… Ståhl enfonce d'ailleurs le clou: « rien de tout cela ne changera le refus d'Oracle d'accorder à [...] Apache Harmony un accès au TCK à des fins de certification; en effet l'OCTLA ne donne accès libre au système de tests qu'aux implémentations dérivées [...] d'OpenJDK ».
Pour les détracteurs d'Oracle, il s'agit d'une manoeuvre dont le but est de se dédouaner auprès de la communauté Open Source: oui, Oracle fait bien de l'Open Source! Ne l'a-t-il pas d'ailleurs rendu JRockit gratuit? Et désormais, voilà que vous pouvez créer librement votre propre implémentation de Java 7! Vraiment? Tant qu'on reste dans le giron OpenJDK, sûrement; mais au-delà, il n'y a probablement pas de salut. Ce que Colebourne résume par une savoureuse boutade: « Apache OpenJDK anyone? »
Les statuts de la Communauté OpenJDK font peau neuve
Troisième fait marquant de la semaine, mais qui découle du précédent: le 14 juin dernier s'est ouvert le vote pour la ratification des statuts de la Communauté OpenJDK. Ce vote prendra fin le 28 juin prochain.
Les statuts gouvernent le fonctionnement de la communauté OpenJDK: groupes, adhésion, procédures de contribution, gouvernance, etc.
L'électorat est constitué des contributeurs ayant « créé au moins 5 changements uniques et non-triviaux dans les dépôts Mercurial d'OpenJDK dans les deux années précédant le vote de ratification ». Or on s'aperçoit très vite que l'immense majorité des votants est affiliée à Oracle; même si quelques « dissidents » sont bien présents (Doug Lea notamment), certains ne manqueront sûrement pas de mettre en doute la légitimité d'un tel vote.
JCP++
Ce n'est pas à proprement parler une actualité, puisque cela date du 17 mai dernier, mais la nouvelle prend tout de même une autre dimension: le JCP va bientôt faire peau neuve.
Baptisé « JCP.next », ce JCP renouvelé sera défini par deux JSRs: 348 et 349 (cette dernière n'étant pas encore publiée).
La JSR 348 introduira des changements dans le fonctionnement du JCP lui-même. A la clé, quatre axes d'améliorations: transparence, participation, réactivité et gouvernance. Et la transparence, lorsqu'on se souvient du vote de la JSR 336, tombe à pic: entre autres, toutes les opérations des Expert Groups devront être menées dans des forums publics; les processus de recrutement de leurs membres seront également publics.
Mais il y a mieux: la JSR 349 quant à elle s'attaquera au JSPA. Or, on l'a vu, c'est là que le bât blessera très fort. Nos confrères d'IT World et de H Online notent à juste titre que le JSPA est au coeur du contentieux entre Apache et Sun/Oracle, la première accusant les seconds de ne pas la respecter.
Amender le JSPA, c'est donc jouer avec le feu; on ne peut qu'attendre avec impatience de voir comment Oracle s'y prendra.
Mais a-t-il seulement le choix?
Depuis quelques mois déjà le JCP est délaissé par des acteurs de première importance: la Fondation Apache d'abord, puis Doug Lea. Pour beaucoup, Stephen Colebourne et Doug Lea en tête, le JCP fait aujourd'hui figure d'institution sclérosée; ils veulent pour preuve des graphiques comme celui-ci, montrant le déclin dans le nombre de JSRs depuis quelques années. Pour d'autres, comme Nicolas Matignole, il est au mieux un moyen de faire face à l'adversité. Il n'est guère que le JUG londonien pour en vanter encore les mérites.
Après l'échec de sa stratégie concernant OpenOffice, Oracle semble cette fois-ci décidé à tirer les leçons de ses erreurs du passé: en adoptant Java SE 7, en mettant en avant OpendJDK, en réformant enfin le JCP, Oracle est peut-être enfin en train de donner des gages sérieux de pérennité au langage Java. Espérons seulement que la future JSR 349 nous donnera raison.
Sonar, l'outil qui manquait à l'usine de développement .NET
Sonar (www.sonarsource.org) est un outil de reporting sur la qualité des projets informatique. Bien qu'à l'origine fait pour le Java, la communauté Open Source a permis l'intégration de Sonar avec d'autre langages : cobol, flex, php, c++ et maintenant .NET.
L'objet de cet article est de vous montrer ce que peut apporter Sonar pour un projet informatique et montrer quelle est sa place dans l'univers .NET.
Interview and Book Excerpt: CMMI for Development
The CMMI for Development (CMMI-DEV) framework, developed at the Software Engineering Institute (SEI), can be used to improve product quality and project and organizational performance.
InfoQ spoke with Mike Konrad, co-author of the book published on the CMMI-DEV framework. We are also making two excerpts from the book ("Applying Principles of Empiricism" from Chapter 3 and "Switching Tracks: Finding the Right Way to Get to Maturity Level 2" from Chapter 6) available for our readers.
Develop with real-time Java
Create applications with predictable response times
1. Why real-time Java?
Runtime processes (garbage collection, class loading, Just-in-time compilation, and thread scheduling) in conventional Java virtual machines (JVMs) make them incapable of running applications with real-time behavior. Real-time extensions to Java technology—based on the Real-time Specification for Java (RTSJ)—enable JVMs with real-time features. You can meet the hard or soft real-time constraints your applications require by leveraging the traditional benefits of the Java language—such as interoperability and safety—and combining them with features that the real-time Java extensions enable. Learn how.
Not doing Code Reviews? What's your excuse?
All of us have known for a long time that code reviews find defects, and that reviews are cheaper and can be more effective than most kinds of testing. In Code Complete, Steve McConnell builds an overwhelming case for code reviews: disciplined code inspections can find between 45%-70% of all defects in code, while even fast, informal reviews can find 20%-30%. Studies at IBM, HP, Microsoft and other places show that it is several times cheaper to find bugs in code reviews than through testing. And evidence keeps coming in to support that code reviews work.
La révolution HTML 5 chez Microsoft va laisser des traces
Il ne se passe pas un jour sans qu'on ne parle d'un fait lié à HTML 5, que ce soit pour encenser ces vertus multiplateformes, enterrer ses principaux concurrents ou annoncer une n-nième spécification. Le dernier en date et non des moindres est la présentation officielle de Windows 8 par Microsoft. Difficile de rester insensible à ce mouvement de fond, que dis-je ce tsunami technologique qui secoue en ce moment la firme de Redmond. Quelle histoire rocambolesque que celle de la stratégie RIA d'un éditeur qui ne sait clairement plus vers quel saint se vouer. Pour bien comprendre l'ampleur du désastre, faisons un petit retour en arrière.
Java HotSpot™ Virtual Machine Performance Enhancements
Compressed Oops
Zero-Based Compressed Ordinary Object Pointers
Escape Analysis
NUMA Collector Enhancements
NUMA Performance Metrics
Garbage-First Collector
What is the Garbage-First Collector?
Java Should Have Extended Enums!
At Devoxx09, Joe Darcy presented the status and future of the Coin project, and how changes to the language are selected and implemented (or vice versa). During his talk, he showed the cost classification of a language change: trivial, small, medium, big, or huge, and emphasized the fact that each change is also a benefit (hard to measure a priori) that can be estimated as big, medium, or small.
La Méthode Clone()
Comment rédiger la méthode clone() ? Quand utiliser Cloneable ? Ce document répond à ces questions.
Il est souvent nécessaire de dupliquer une instance. Cela permet de gérer correctement les exceptions et les agrégations. Nous désirons proposer une méthode public clone() retournant une copie d'une instance.
Pour le bulletin de cette semaine, je vous propose les sujets suivants :
- Un article sur le futur du Web selon Gartner.
- YouTube a six ans : quelques statistiques.
- Sortie de l'outil IDE (Integrated Developement Environement) compatible du JDK 7
- Sortie de JavaFX 2.0 en version béta : première version majeur 100% compatible avec tout les langages JVM : Java, JRuby, Groovy, Scala, ... C'est une évolution majeur pour les IHM en Java, avec des possibilités de nouvelles ergonomies intégrable dans une IHM Java extistant. Certains considèrent que JavaFX correspond à Swing 2.0, qui serait le remplacement de Swing actuel. Oracle propose de mettre
- Un article au sujet de la modularisation pour le JDK 8 : le leader de la spécification Mark Reinhold propose de (re-)commencer le travail de cette spécification.
- Un exemple de code Java avec le mot clé "final" :
public static void main(String[] args) {
final int s1 = 6;
int s2 = 6;
System.out.println(false ? s1 : 'X');
System.out.println(false ? s2 : 'X');
}
Quel est le résultat imprimé ? Réponse et explication dans l'article.
- Langage Java : quel est la conséquence d'une classe non static interne à une autre classe.
Bonne lecture.
The Future of the Web as Seen by Gartner
Gene Phifer, Managing VP in Gartner Research, and David Mitchell Smith, VP and Fellow in Gartner Research, recently held a webinar entitled How Web and Cloud Computing Will Drive Your IT Strategy (registration required), outlining some of the key characteristics of the future web as seen by Gartner, concluding with a number of recommendation for businesses that want to be prepared.
Smith divided the history of the web in 3 periods:
- Web 1.0 (1989-2003) – HTML on top of HTTP – consumed by humans, mostly readers and a few authors
- Web 2.0 (2004-2010) – Web 1.0 + AJAX, XML – consumed by humans and machines with many readers and authors
- Modern Web (2011-) – Web 2.0 + HTML5 – includes mobile, cloud computing, real-time
The Future or the Modern Web has several characteristics, according to Phiper :
YouTube : six ans et quelques statistiques
YouTube fête ses six ans : créé en février 2005, le site n'a été lancé qu'en mai de la même année. Google, qui a acheté la société un peu plus d'un an plus tard, profite de l'occasion pour donner quelques statistiques sur son service.
JetBrains Release IntelliJ IDEA 10.5 With Full Java 7 Support
Since version 10.0 IntelliJ IDEA has been offered in two versions, a free open-source "Community Edition" and an expanded commercial offering called the "Ultimate Edition".
As well as Java 7 support a number of other new features have been added to the Community Edition: The latest versions of Android SDK are supported, including Honeycomb; XSLT 2 support has been added; and the Groovy capabilities have been updated with new refactorings such as Introduce Field, and Groovy 1.8 support.
Updates in the Ultimate Edition include:
- Spring 3.1 support and Spring Roo console
- Bundled Jetty integration
- Google Chrome support in the JavaScript debugger
JavaFX 2.0 Beta Now Available
The much-anticipated JavaFX 2.0 beta release is now available for download—which means you can take advantage of all the new benefits that JavaFX 2.0 brings to the Java platform. This release is the latest development in Oracle's long-term commitment (roadmap) to making JavaFX a premier rich client platform.
JavaFX provides a powerful and expressive Java-based UI platform capable of handling large-scale computationally intensive data-driven business applications. JavaFX applications are completely developed in Java while leveraging the power of standards-based programming practices and design patterns. JavaFX provides a rich set of UI controls, graphics and media API with high-performance hardware-accelerated graphics, web and media engines to simplify development of immersive visual applications. JavaFX developers can preserve existing investments by reusing Java libraries in their JavaFX applications. They can even access native system capabilities via the Java native interface, or seamlessly connect to server-based Java EE middleware applications.
JavaFX 2.0 Beta is now available for download from javafx.com. Please help us make JavaFX successful by testing it at an early stage and report any issues you encounter. For detailed tutorials and API documentation, see http://download.oracle.com/javafx.
What Is JavaFX?
The JavaFX platform is the evolution of the Java client platform designed to enable application developers to easily create and deploy rich internet applications (RIAs) that behave consistently across multiple platforms. Built on Java technology, the JavaFX platform provides a rich set of graphics and media API with high-performance hardware-accelerated graphics and media engines that simplify development of data-driven enterprise client applications.
Investing in the JavaFX platform provides the following advantages to Java developers and companies that are part of the Java ecosystem:
Because the JavaFX platform is written in Java, Java developers can leverage their existing skills and tools to develop JavaFX applications. Because Java is widely used, it is easy to find experienced Java developers who can quickly become productive building JavaFX applications.
By using a homogenous set of Java technologies for both the server and the client platforms, the JavaFX platform reduces the risk of investment by reducing the complexity of the business solutions. Development costs are also reduced because of the aforementioned advantages. The JavaFX platform provides developers with a development framework and runtime environment to create enterprise and business applications that run across multiple platforms that support Java. See the JavaFX Architecture and Framework document to learn about the JavaFX platform's architecture and key concepts.
JavaFX Architecture and Framework
The JavaFX 2.0 platform is a rich client platform built on Java technology and designed to enable application developers to easily create and deploy rich Internet applications (RIAs) that behave consistently across platforms. See the What is JavaFX document for a summary of what JavaFX 2.0 has to offer.
Figure 1 illustrates the architectural components of the JavaFX 2.0 platform. The sections following the diagram describe each component and how the parts interconnect. Below the JavaFX public APIs lies the engine that runs your JavaFX code. It is composed of subcomponents that include the new JavaFX high performance graphics engine, called Prism; the new small and efficient windowing system, called Glass; a media engine, and a web engine. Although these components are not exposed publicly, their descriptions can help you to better understand what runs a JavaFX application.
JavaFX 2.0
JavaFX 2.0 Beta is the latest major update release for JavaFX. Many of the new features introduced in JavaFX 2.0 Beta are incompatible with JavaFX 1.3. If you are developing a new application in JavaFX, it is recommended that you start with JavaFX 2.0 Beta.
JavaFX 2.0 : Frequently Asked Questions
1. What is new in JavaFX 2.0?
2. Why should I choose JavaFX to develop applications?
3. What kind of applications can be built with JavaFX?
4. What is the relationship between JavaFX and the JRE?
5. What operating systems are supported by JavaFX?
6. Is JavaFX replacing Swing as the new client UI library for Java SE?
7. Does JavaFX provide support for audio and video codecs?
8. Does JavaFX 2.0 support JavaFX Script?
9. Will previous versions of JavaFX remain available?
10. What licensing model will JavaFX 2.0 be available under?
11. How do I submit a bug report or request a feature?
Requirements of a Standard Java Module System
Yesterday, Mark Reinhold posted the first public draft of the future of modularity in Java. Unlike the previous iterations of JSR294, the discussions of modularity in Java have taken place outside of Sun/Oracle's closed doors and involved others with a stake in OpenJDK, such as IBM and other members of the Java SE and Java EE communities, as explained in Mark's blog post on the subject.
As it is a draft there are a handful of issues that still need to be agreed on but it represents the consensus of what modularity in Java should look like. And with IBM being involved, there's more emphasis on interoperability with OSGi than there has been in the past.
Final : le mot clef qui évite les surprises
Titre : un bytecode peut en cacher un autre
Dans notre équipe, nous mettons les variables à final par défaut. C'est la règle "immutable par défaut" de "Java concurrency in practice" : final offre une forme d'atomicité que des langages fonctionnel comme Haskell ou Erlang systématisent (scala fournit le mot-clé val) et qui évite des problèmes de concurrence. J'ai découvert une autre raison d'utiliser final, l'opérateur ternaire " exp ? si vrai : si faux "
Voyons une manifestation paranormale du phénomène :
Reassigning the outer class reference
Everyone knows (or should) that a non-static inner classe has a hidden reference to the instance of its containing class.
Let's exercise this sample class :
Pour le bulletin de cette semaine, je vous propose les sujets suivants :
- un résumé sur le transistor en 3D annoncé par Intel : le Transistor MOS 3D Tri-Gate
- l'externalisation du système d'information : le cloud et la DSI
- sortie de la version 7 de NetBeans avec le support du JDK 7.
- Une métaphore du Model Driven Engineering
- Trois articles sur la programmation concurrente : the free lunch is over : la prochaine révolution dans l'informatique : la programmation concurrent (multi- tâche) natif dans les langages de programmation.
La sortie de la version scala 2.9 qui propose des collections où un ensemble d'opérations (itération, recherche, ...) sont multitâches (multi-threadées).
- Deux article sur la sérialisation Java : derrière la scène et sans Sérialisable.
Bonne lecture.
Transistor MOS 3D Tri-Gate : Intel ajoute la 3D aux processeurs
Intel dévoile un nouveau type de transistor Metal Oxide Semiconductor, qui fait l'effet d'une bombe : 3D Tri-Gate vise des performances plus élevées pour un coût à peine supérieur au transistor MOS classique.
Faut il avoir peur du Cloud ? Il semblerait que oui…
Le Cloud Computing est une lame de fond inévitable tant il offre d'opportunités pour les entreprises : élasticité, paiement à la consommation, externalisation de la « plomberie informatique », etc. Il provoque cependant d'importantes remises en cause et craintes au sein de leurs DSI.
Oracle Announces NetBeans IDE 7.0 with Support for JDK 7 Developer Preview
Allowing users to take advantage of latest developments in Java Platform, Standard Edition (Java SE), NetBeans IDE 7.0 introduces language support for development to the upcoming JDK 7 release, currently available as a Developer Preview. Additional enhancements include new support for GlassFish Server Open Source Edition 3.1 and Oracle GlassFish Server 3.1 and full integration of Oracle WebLogic Server. New support for Oracle Database is included, as well as Apache Maven 3 and HTML5 editing support, and enhancements to the Java editor. In addition, an improved and far more intuitive GridBagLayout visual designer has been integrated for Swing GUI development.
A metaphor for Model Driven Engineering
A couple of weeks ago I wrote an article introducing a framework for Model-Driven SOA. This article doesn't stand on its own, it's based on earlier pieces on Model-Driven SOA and observations that Model-Driven Engineering should focus on the problem domain. However, I'm noticing that these articles can be hard to grasp if you have no background knowledge. That's why I want to explain Model-Driven Engineering using a simple metaphor I often use in my presentations.
The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software
The biggest sea change in software development since the OO revolution is knocking at the door, and its name is Concurrency. This article appeared in Dr. Dobb's Journal, 30(3), March 2005. A much briefer version under the title "The Concurrency Revolution" appeared in C/C++ Users Journal, 23(2), February 2005.
Getting Started with Parallel Programming
Multi-core computers have shifted the burden of software performance from chip designers to software architects and developers. In order to gain the full benefits of this new hardware, we need to parallelize our code. The goal of this article is to introduce you to parallelism, its different types and to help you understand when to parallelize your code - and when not to. We will also examine some of the tool options developers have today for building parallel applications.
Introduction to parallelism
Scala 2.9.0 Introduces Parallel Collections
Together with last week's announcement of the new Scala company Typesafe, the latest major version 2.9.0 of Scala was released. Compared to last years Scala 2.8 release, 2.9 contains a much smaller amount of new features and concentrated on improvements and bug fixes of existing ones. The primary new feature of Scala 2.9 are the parallel collections, which are built on the same abstractions and provide the same interfaces as the existing collection implementations.
From the release notes:
Every collection may be converted into a corresponding parallel collection with the new `par` method. Parallel collections utilize multicore processors by implementing bulk operations such as `foreach`, `map`, `filter` etc. in parallel.
Behind the Scenes of Serialization in Java
When building distributed applications one of the central performance-critical components is serialization. Most modern frameworks make it very easy to send data over the wire. In many cases you don't see at all what is going on behind the
scenes. Choosing the right serialization strategy however is central for achieving good performance and scalability. Serialization problems affect CPU, memory, network load and response times.
Sérialiser des objets non sérialisables
Le mécanisme de sérialisation de Java permet de compresser un graphe d'objets sous une forme compacte, transportable hors de la JVM, puis de reconstituer ces objets en mémoire - à condition qu'ils implementent Serializable.
Dans cet article, je vous propose de découvrir et de tirer parti de certaines options méconnues pour sérialiser des objets n'implémentant pas Serializable - et sans même les modifier !
Pour le bulletin de cette semaine, je vous propose les sujets suivants :
- Intel annonce la création d'un transistor en 3D en 22 nm : réduction de la consommation et augmentation de la fréquence d'utilisation.
- Tous les navigateurs web intègrent un compilateur Just In Time (JIT) pour améliorer les performances de JavaScript des pages HTML. C'est le cas de Firefox avec IonMonkey.
- Un outil de qualimétrie : Sonar 2.7 : cette version apporte la gestion de la dette technique.
- Un article sur la séparation des préoccupations dans la construction d'une architecture logicielle : c'est une synthèse de différents types de préoccupations.
- Trois articles sur Groovy 1.8 et les compléments de ce langage compatible Java.
- La classe Void en Java : pour quel usage.
Bonne lecture.
Intel Reinvents Transistors Using New 3-D Structure
New Transistors for 22 Nanometer Chips Have an Unprecedented Combination of Power Savings and Performance Gains.
Intel announces a major technical breakthrough and historic innovation in microprocessors: the world's first 3-D transistors, called Tri-Gate, in a production technology. The transition to 3-D Tri-Gate transistors sustains the pace of technology advancement, fueling Moore's Law for years to come. An unprecedented combination of performance improvement and power reduction to enable new innovations across a range of future 22nm-based devices from the smallest handhelds to powerful cloud-based servers. Intel demonstrates a 22nm microprocessor – codenamed "Ivy Bridge" – that will be the first highvolume chip to use 3-D Tri-Gate transistors.
IonMonkey: Mozilla's new JavaScript JIT compiler
IonMonkey is the name of Mozilla's new JavaScript JIT compiler, which aims to enable many new optimizations in the SpiderMonkey JavaScript engine. InfoQ had a small Q&A with Lead Developer David Anderson, about this new development that could bring significant improvements in products that use the SpiderMonkey engine like Firefox, Thunderbird, Adobe Acrobat, MongoDB and more. This new JIT infrastructure, will feature SSA compiler intermediate representations which will facilitate advanced optimizations such as type specialization, function inlining, linear-scan register allocation, dead-code elimination, and loop-invariant code motion.
Main driving forces for IonMonkey are to:
- Provide a backend that can match or beat the Trace JIT or Crankshaft in speed. Sub-goals:
- Fine-grained specialization and de-specialization.
- Integration with type inference.
- Clean, textbook IR so optimization passes can be separated and pipelined with well-known algorithms.
- Document and comment well so the implementation and its side effects can be easily understood.
- Recompilation, debugging, bailouts are all related - and should be solved up-front.
- First SpiderMonkey JIT that starts off with peer reviews!
- (Unknown feasibility) Act as a baseline compiler to replace JM2.
- Manage memory much better, in part to avoid range problems on x64.
Sonar 2.7
The Sonar Team is pleased to announce the release of Sonar 2.7. This version focuses on providing further control on technical debt.
Prior to version 2.5, Sonar was really useful to assess application's technical debt but was not so handy to manage evolution over time. In Sonar 2.5 was added the ability to see metrics evolution and monitor the apparition of new violations over a period of time or since an event.
A similar functionality has now been added with version 2.7 for code coverage by unit tests on new / updated source code. It is now possible to follow what percentage of changed code over a period of time is covered by unit tests.
La séparations des préoccupations
La séparation des préoccupations (en anglais : Separation of Concerns - SoC) est un concept présent depuis de nombreuses années dans l'ingénierie du logiciel. Les différentes préoccupations des concepteurs d'un système à base de logiciel, apparaissent comme les premières motivations pour organiser et décomposer ce système en un ensemble d'éléments compréhensibles et facilement manipulables. La séparation en préoccupations apparaît dans les différentes étapes du cycle de vie du système et sont donc de différents ordres. Il peut s'agir de préoccupations d'ordre fonctionnel (séparations des fonctions du système), technique (séparation des propriétés non fonctionnelles du système), ou encore liées à utilisateur du système (séparation des actions de l'utilisateur du système).
Avec ces séparations, le système n'est plus abordé dans sa globalité, mais par point de vue, par parties. Cette approche réduit la complexité de conception, de réalisation, mais aussi de maintenance d'un système et en améliore la compréhension, la réutilisation et l'évolution. Cette séparation est la motivation d'approches telles que la programmation en couches logicielle ou la programmation par aspects.
Groovy 1.8
Guillaume Laforge, le chef de projet de Groovy, vient d'annoncer sur son blog la sortie de la version 1.8 du célèbre langage de scripting pour la JVM.
Le millésime semble de qualité avec de nombreuses fonctionnalités nouvelles et améliorations – certaines fonctionnalités très populaires ont d'ailleurs été backportées sur la version 1.7. A noter également que, comme le signale Burt Beckwith sur son blog, Grails 1.4 a été mis à jour pour supporter cette nouvelle version.
Nous vous proposons ici un bref aperçu des principales nouveautés; les exemples sont tirés ou inspirés des notes de version, très complètes. Signalons encore une série d'articles publiés très récemment par Mr. Haki sur son blog et qui donnent une description encore plus détaillée de certaines nouveautés de Groovy 1.8.
Command chains for nicer Domain-Specific Languages
Thanks to its flexible syntax and its compile-time and runtime meta-programming capabilities, Groovy is well known for its Domain-Specific Language capabilities. However, we felt that we could improve upon the syntax further by removing additional punctuation symbols when users chain method calls. This allows DSL implementors to develop command descriptions that read almost like natural sentences.
Before Groovy 1.8, we could omit parentheses around the arguments of a method call for top-level statements. But we couldn't chain method calls. The new "command chain" feature allows us to chain such parentheses-free method calls, requiring neither parentheses around arguments, nor dots between the chained calls. The general idea is that a call like a b c d will actually be equivalent to a(b).c(d). This also works with multiple arguments, closure arguments, and even named arguments. Furthermore, such command chains can also appear on the right-hand side of assignments. Let's have a look at some examples supported by this new syntax:
Groovy 1.8 release notes
compile-time meta programming : New AST Transformations
The Groovy compiler reads the source code, builds and Abstract Syntax Tree (AST) from it, and then puts the AST into bytecode. With AST transformations, the programmer can hook into this process. A general description of this process, an exhaustive description of all available transformations, and a guide of how to write you own ones can be found for example in Groovy in Action, 2nd Edition (MEAP), chapter 9. Below is a list of all new transformations that come with Groovy 1.8. They save you from writing repetitive code and help avoiding common errors.
Why does Void class exist in JDK
I always try to bring some thing new and useful on this blog. This time we will understand the Void.class (which in itself looks something tricky) present in rt.jar. One can consider the java.lang.Void class as a wrapper for the keyword void.
Some developers draw the analogy with the primitive data types int, long, short and byte etc. which have the wrapper classes as Integer, Long, Short and Byte receptively. But it should be kept in mind that unlike those wrappers Void class doesn't store a value of type void in itself and hence is not a wrapper in true essence.