vendredi 22 octobre 2010

Veille technologique semaine 42

Pour le bulletin de cette semaine, je vous propose les sujets suivants :
  • mise à jour du JDK 6 en update 22.
  • un article qui propose une vidéo sur le client server versus publish subscribe : exemple avec la DDS de l'OMG (proposé par OpenSplice),
  • un outil de conversion d'une IHM en Swing vers une IHM en Web : AjaxSwing. Il faut voir les exemples sur le site.
  • une mise à jour de la spécification des expressions lambda pour le JDK 8.
  • le design des API avec les types paramétrés : les génériques Java : quelques exemples de code.
  • les EJB 3.1 et les Timer : la forme descriptive : @Schedule
  • un résumé des méthodes synthétiques en Java : cas d'usage.
  • la construction d'énuméré dynamique : pourquoi faire ?
  • les "methodes defender" pour le JDK 7 : explications.

Bonne lecture.

Java Platform, Standard Edition 6 Update 22 Release Notes

Client Server versus Publish Subscribe
Event-driven architecture (EDA) is an asynchronous pattern which can be implemented with a publish/subscribe (pub/sub) mechanism. Pub/sub is basically a decoupling mechanism in a landscape of communicating systems. Not only the technology of the communicating systems is decoupled, but also presence in time of the communicating systems is decoupled and even locations are decoupled as there is no endpoint resolution applicable.

AjaxSwing - Automatic Conversion of Swing Applications to AJAX websites
CreamTec is proud the announce that AjaxSwing 3.1.1 is available for download.
AjaxSwing is a web deployment platform for Java Swing applications. It allows companies that built Java desktop applications to run them as web applications. AjaxSwing can be thought of as a Java Swing to HTML converter that creates HTML and JavaScript at runtime.
AjaxSwing 3.1.1 release notes:
3.1.1 is our next release of the 3.1 branch introducing following changes from previous (3.1.0) version:

  • Fixed dialog z-index issue when third level dialog appeared below others
  • Added support for inverted property in JSlider
  • Added support for invisible items in JMenu (were renderer as visible before)
  • Fixed JMenu rendering when it contains normal components (labels, panels, etc)
  • Improved ajax table scrolling
  • Added support for rendering JTableHeader on top a the table while you scroll it
  • Improved rendering of TitledBorder, support difference title placement and border styles
  • Fixed exception in TemporaryFileRemover thread
  • Improved layout for JScrollPane, JComboBox, JCheckBox, JButton
  • Other small fixes and improvements

AjaxSwing Home:
Online demos:

Lambda Update
Now that the dust has settled on the future of OpenJDK and Plan B confirms the feature slip of Lambdas into JDK 8 (or later), what is the future of Lambdas themselves?
The initial lambda proposal was fairly wide reaching, in that it attempted to bring functional types to the Java language. However, some fundamental issues in the intersection of the Java type system and the newly proposed functional types resulted in these functional types (or structural typing) being dropped in favour of existing class-based (or nominal typing) representations. Partly, this is due to the fact that if X is a subtype of Object, then array[X] is a subtype of array[Object]; combined with functions that throw exceptions, it is possible to break the Java type system.

Designing APIs With the Java 5 Language Features :
While implementing a mid-sized framework, I've discovered that the following Java 5 language features can help improve the usability of APIs.
Generics can help avoid casts in more ways than one, especially if instances of Class are used (see my blog post on this subject).
Generics and constructors: Generic constructors always need a type argument, while static methods (such as factory methods) can infer type arguments from their actual (method) parameters, leading to shorter code.

Understanding the EJB 3.1 Timer service in Java EE 6 - Programmatic, Deployment Descriptor, @Schedule
EJB 3.1 has greatly simplified the ability to schedule events according to a calendar-based schedule, at a specified time, after a specified elapsed duration, or at a specific recurring intervals.
There are multiple ways events can be scheduled:
• Programmatically using Timer service
• Automatic timers based upon the metadata specified using @Schedule
• Deployment Descriptor

Java's Synthetic Methods
In this blog post, I look at the concept of Java synthetic methods. The post summarizes what a Java synthetic method is, how one can be created and identified, and the implications of Java synthetic methods on Java development.
The Java Language Specification (section 13.1) states "Any constructs introduced by the compiler that do not have a corresponding construct in the source code must be marked as synthetic, except for default constructors and the class initialization method." Further clues as to the meaning of synthetic in Java can be found in the Javadoc documentation for Member.isSynthetic(). That method's documentation states that it returns "true if and only if this member was introduced by the compiler." I like that very short definition of "synthetic": a Java construct introduced by the compiler.

Enum Tricks: Dynamic Enums
Introduced to Java 1.5, Enum is a very useful and well known feature. There are a lot of tutorials that explain enums usage in details (e.g. the official Sun's tutorial). Java enums by definition are immutable and must be defined in code. In this article I would like to explain use case when dynamic enums are needed and how to implement them.

Interface evolution via "public defender" methods
Problem statement
Once published, it is impossible to add methods to an interface without breaking existing implementations. The longer the time since a library has been published, the more likely it is that this restriction will cause grief for its maintainers.

Aucun commentaire: