vendredi 28 août 2009

Veille technologique semaine 35

Bonjour à tous,

pour le bulletin de la semaine 35, je vous propose les articles suivants :

  • La société Terracotta achète le produit EhCache : explication marketing et technique de ce rapprochement.
  • La sortie de eclipse galileo version 3.5 : où comment l'outil peut nous aider à coder plus rapidement ?
  • Un article théorique sur les transaction mémoire logiciels : Software Transactions Memory (STM) : c'est quoi et à quoi ça sert ? C'est en premier lieu un problème de productivité.
  • La technologie LINQ (Language Integrated Query : langage de requête intégré à C#) de Microsoft fait-elle du tort à Java ? Les closures qui étaient prévues pour la JDK 7 et qui sont reportées, oblige à faire des solutions comme celle proposé par le projet Quaere : faire des requêtes sur des collections indépendamment de la persistance, et donc sur une collection d'objets en mémoire. A intégrer rapidement dans nos systèmes. Google propose également un projet lambdaj pour généraliser l'exécution d'une opération sur une collection Java. C'est très élégant.
  • Un article sur les painters de JavaFX 1.2
  • Un autre article sur les mixin de JavaFX. JavaFX est une technologie pour réaliser des GUI qui propose également un langage (de script ?) pour programmer l'interaction.
  • Définition wikipedia des mixin.
  • Les fenêtres transparentes et non rectangulaires en Java.
  • Un petit exercice Java : avec l'exemple de code présenté, quel est le résultat du print ?

Bonne lecture.


Terracotta acquires Ehcache
We've been teasing the twitter-sphere for a few days now about some big Terracotta news and now I can finally talk about it.
Terracotta has entered into an agreement with Greg Luck, the copyright owner and primary developer on the Ehcache project. Ehcache is of course the most popular open source Java cache library. The agreement means that Greg Luck will join Terracotta, the Ehcache copyright will transfer from Greg to Terracotta, and Terracotta will take over hosting Ehcache.


Faster Java coding in Eclipse Galileo 3.5
Summary: Learn how to use the new toString() code-generation ability in Eclipse Galileo along with hashCode(), equals(), and setter/getter generation to cut down on the amount of work that goes into building the foundation of a Java class.


Software Transactional Memory
Software Transactional Memory (STM) is an emerging technology for protecting shared state in concurrent programs, based on automatic control of concurrent accesses. Its goal is to provide a more user-friendly and scalable alternative to locks by promoting the notion of transactions as a first-class citizen for component model.
This Software Transaction Memory target «state of the art» services and events oriented multi-tier components based software architecture with separation of concerns. One of the concerns is threading issues. STM propose an answer with a declarative transaction model for services and events.


Does .NET With LINQ Beat Java?
Framework's data query capabilities give it an edge, experts claim.
There is a question some developers are asking:
Has LINQ given Microsoft's latest .NET Framework an edge over Java?
Industry experts say "yes," but with some caveats.


Quaere
Quaere is an open source, extensible framework that adds a querying syntax reminiscent of SQL to Java applications. Quaere allows
you to filter, enumerate and create projections over a number of collections and other queryable resources using a common,
expressive syntax.

Iterable lowNumbers =

from("n").in(numbers).
where(lt("n",5).
select("n");


What is lambdaj for?
How many times have you read or written the same two or three lines of code that
frequently seem to go together, and even though they operate on different objects, feel like
the same thing? And how often these repetitions involve some sort of collections iteration
or more generically manipulation? These repetitions in the code is something that
developers eventually learn to filter out and ignore when reading code, once they figure
out where the interesting parts are placed. But even if the developers get used to it, it
slows them down. Code like that is clearly written for computers to execute, not for
developers to read.

List personInFamily =
asList(new Person("Domenico"),
new Person("Mario"),
new Person("Irma"));

forEach(personInFamily).setLastName("Fusco");


Introducing Custom Paints to JavaFX
In this article, I leverage a couple of undocumented capabilities to support custom paints. You
can use a custom paint to render the outline and fill for any shape (including text), and also to
render the fill for the stage's scene.

Specifically, the article introduces you to TexturePaint, BrownianPaint, and PlasmaPaint.
Each of these javafx.scene.paint.Paint subclasses relies on an undocumented Paint
function to make its underlying java.awt.Paint available to JavaFX. Furthermore, these
classes rely on an undocumented toolkit's subclass for filling a stage's scene.


Mixins in JavaFX 1.2 Technology
With the release of version 1.2 of JavaFX technology, developers have a new style of class inheritance: a mixin. A mixin is a type of class that can be inherited by a subclass, but it is not meant for instantiation. In this manner, mixins are similar to interfaces in the Java programming
language. However, the difference is that mixins may actually define method bodies and class variables in addition to constants and method signatures.


Mixin
From Wikipedia, the free encyclopedia
In object-oriented programming languages, a mixin is a class that provides a certain functionality to be inherited by a subclass, while not meant for instantiation (the generating of objects of that class). Inheriting from a mixin is not a form of specialization but is rather a means of collecting functionality. A class may inherit most or all of its functionality from one or more mixins through multiple inheritance.


How to Create Translucent and Shaped Windows
The article describes a feature that allows creating applications with translucent and shaped windows.
JavaFX Script is a capable new language that offers a set of APIs for creating RIAs. It also provides you with access to the rich features of the the standard Java language. One of the major features introduced in the Java SE 6u10 release is the ability to create translucent and shaped windows.

This includes:
making application windows translucent (tuning the general opacity of the window and using a per-pixel translucency effect) setting shapes on application windows This feature is available for objects of the java.awt.Window class and its descendants, for example javax.swing.JFrame, javax.swing.JFDialog, java.awt.Frame.


Translucent and Shaped Windows in JDK7
Here is another sneak peek at a page that was just completed for the JDK7 update of the Swing tutorial.
How to Create Translucent and Shaped Windows:
As of the Java SE 6 update 10 (6u10) release, you can add translucent and shaped windows to your Swing applications.
This functionality, part of the public AWT package in JDK 7.


The Ultimate Java Puzzler
Why is this particular one the ultimate? Two reasons:
It's at the very core of the Java language, not some obscure piece of API.
It melted my brain when I hit it.

public class /*p1.*/C1 {
/*default*/ int m() {return 1;}
}

public class /*p1.*/C2 extends C1 {
/*default*/ int m() {return 2;}
}

public class /*p2.*/C3 extends p1.C2 {
/*default*/ int m() {return 3;}
}

public class /*p1.*/Main {
public static void main(String[] args) {
C1 c = new p2.C3();
System.out.println(c.m());
}
}

Classes C1, C2 and Main are in package p1. C3 is in package p2.

What is the output of Main.main()?


vendredi 21 août 2009

Veille technologique semaine 34

Pour le bulletin de cette semaine 34, je vous propose les sujets suivants :
  • la société VMWare rachète la société SpringSource qui développe le framework Spring : pourquoi ?
  • la grande bataille du SaaS (Software As A Service) et de l'hébergement d'application, le "cloud computing" avec Google App Engine et autre Azure Microsoft : c'est quoi le "cloud computing" ?
  • le produit Terracotta a reçu le prix Duke Award lors de la conférence JavaOne 2009 qui s'est déroulé début juin à San Francisco. Ce prix est décerné annuellement par SUN pour récompenser une solution innovante dans le monde Java.
  • les architectures orientés événements commence à se faire connaître (EDA : Event Driven Architecture) et déjà le CEP : Complex Event Processing commence à avoir un marché.
  • Une série de livres qui sortent au sujet de :
    • JavaFX: Developing Rich Internet Applications en provenence de la source SUN
    • Real-Time Java Programming: With Java RTS : la programmation Java temps réel
    • Programmation concurrente en Java : un "best of" à lire absolument pour ceux qui font du Java multi-threadés
    • Spring 2.5 Aspect-Oriented Programming Book Review : la programmation par aspect proposé par Spring 2.5
    • Un compilateur Java qui génère du byte code DotNet.
    • Swing et le threading : c'est toujours un sujet compliqué qui doit être respecté
    • Le JDK 7 : ou en est-il ?
    • Les énumérés et la sérialisation.


    Bonne lecture



    Pourquoi VMWare / SpringSource ? Virtualisation matérielle vs. Cloud

    Pourquoi VMWare a racheté SpringSource dont le métier et la culture sont si différents ?
    Pourquoi un tel prix ?
    Mon analyse est que VMWare a racheté SpringSource parce que le cloud computing de forme Platform As A Service (PaaS) à la Google App Engine va bientôt mieux répondre que la virtualisation matérielle aux besoins d'optimisation des data centers Java. Selon l'adage "Si quelqu'un scie la branche sur laquelle je suis assis, mieux vaut que ce soit moi", VMWare s'est dotée de l'expertise de SpringSource sur Tomcat et Hyperic.


    Cloud Computing Demystified: Part-I
    Posted by: bond 124 on août 17, 2009 DIGG
    I recently took part in a panel discussion on Cloud Computing and how it relates to software architecture. The event used an online event organizer for signing up and the website wouldn't let me register for the event. I later found out that I could not sign-up because the event was sold out. This says something about the hype surrounding cloud computing which has become the in-thing to be 'seen with'. The panel discussion was interesting and animated and one takeaway for me was that everybody had their own idea of what cloud computing is and to some it was barely more than a buzzword.

    So, is cloud computing merely hype? While there truly is value in what is provided by Amazon (EC2 and other services), Google's App Engine, Microsoft's Azure and a few others, the providers (or at least their marketing teams), if you ask me, have not helped a whole lot. It seems like every company that used to provide virtual private servers is now a cloud computing provider. So are companies that used to provide hosting solutions, and every company that used to be a destination for an outsourced data center. Soon, we will have clouds of every other conceivable kind! When a term can be applied to pretty much anything, the term starts losing its meaning. Cloud computing, which I would put in the first stage of Gartner's Hype-Cycle (hype followed by disillusionment followed by realization), is the latest buzzword that marketing teams love to apply to anything they can. I asked representatives from several companies that claim to provide cloud solutions what did they really mean when they talked about a "cloud". When pushed, pretty much all of them ended up saying - "its just a buzzword".

    Getting back to the panel discussion, there were several strands of discussion which I would have liked to address in detail but couldn't because of time constraints. So I decided to use this blog to move the discussion online (and to also share it with a wider audience). In this and subsequent posts, I will try to summarize as well as share my view of this technology, starting with some of the points from the panel.

    Cloud computing is nothing new:
    Cloud computing, like most other technologies, is an evolution, not a revolution. If it does end up changing the way we develop, deploy and manage software (and other components), we might start calling it a revolution but at this time, it represents incremental but very useful changes in several existing technologies and how it all comes together. Most offerings use virtualization, deliver services over the Internet and expose HTTP based APIs for accessing and controlling the services. But what is truly important for me is not whether its new or old; but whether it solves my technical and business problems. There are several class of applications and organizations for which EC2, Azure or Google App Engine is the right choice. Moreover, I can not think of a single service in the late 90s or early 2000s where I could provision Linux boxes in a matter or minutes by just signing up on a website using a credit card. If nothing else, the sheer ease of use and affordability (at least in the beginning) is an innovation worth taking note of (and make use of if, it makes sense). My take on it - it works great when you use it to solve the problem it was designed to solve.

    There is no such thing as infinite scalability:
    The use of term "Infinitely Scalable" by the cloud computing service providers, in my opinion, is misguided. A better term to use would be "Sufficiently Scalable" but it does not have the same ring to it. Amazon's or Google's infrastructure can effectively provide "sufficient" scalability for small application. If you are mostly running on a couple of Xeons with 12GB of Ram or so, a typical spike in demand might need you to scale up by 4 or 5 times which can easily be handled by the Amazons of this world. I suspect, however, that you can not run another Amazon on Amazon's infrastructure (especially during Christmas time!). There is a slightly different but related discussion about differences of scale and statistical models which I will not get into.

    What about the security of my data?
    Its no less secure that using a hosting solution of the past. While people like to complaint about Hypervizor breaches and how most cloud computing providers (especially those who provide infrastructure as a service) use virtualization, the reality is that Hypervisors are far more secure that the operating systems they run. The two main and mostly related reasons for this is that the people who build Hypervizors realize this (and they are a pretty smart bunch), and that the Hypervizors are kept as small as possible. While I am not an expert in this area, the last time I was talking to one of the experts in Hypervizor and virtual machine security, he took pains to point out that inspite of the fact that it is bad for his business, Hypervizor breaches are extremely rare and that most Hypervizors are quite secure. I would, however, like to point out that what happens in case of a security breach is still not clear. We simply do not know enough about this stuff. And if you have contractual or legal requirements that prohibit you from moving your data into the cloud, you will simply have to wait until the lawyers catch up with the technology and the providers address these concerns directly through their SLAs.

    The clouds are not interoperable.
    Because every-body's offering of "cloud" services is different, the questions of interoperability while being a very important question, does not make sense at this time. The really compelling offerings today are from Amazon (EC2 being the big one, but there is also SQS and S3 and a few others), Google (app engine) and Microsoft's Azure. EC2 gives you virtual Linux servers (and now windows too) and options of launching pre-configured servers. If all you are truly using is the Linux platform, nothing stops you from moving over to someone else who will also provide you Linux boxes (either virtualized or real). While you may have to make a lot of changes to migrate your Java application over to Google App Engine, taking your application out of the App Engine and deploying it somewhere else should not be a problem (assuming you have appropriately abstracted out the areas that use Google specific APIs). I have heard talks of Azure supporting Java (and a few other platforms) in the future and it will be interesting to see how portable Java applications will be between Google App Engine and Azure.

    What is the real cost of using these services?
    This is a tough one and merits at least a white paper of its own. I do not have a clear answer but I say this - two main advantages of the cloud, the ability to scale up when you need to, and pay only for what you use go a long way in making cloud computing solutions cost effective. If you know your usage and it does not vary much, you do not really need to use a cloud computing provider. There is work needed for moving an existing application either completely or partially into the cloud and you should not, as a matter of basic engineering principle, use a cloud simply because its the in-thing. It will not make sense and it will not be cost effective. You may, however, have other reasons for using Amazon or Google (for example, cloud computing payment models let you convert your capital expenses into operational expenses).

    In my next post on cloud computing, I will list some of the prevalent definitions of cloud computing and try to factor out the characteristics that make most sense to me (especially for providers that we are most interested in) and try to come up with a working definition of the term that is most relevant to us as software architects/designers/engineers.



    Terracotta Wins Prestigious Duke's Choice Award at the 2009 JavaOne Conference
    Sun Microsystems and Java Inventor James Gosling Recognize Ubiquity of Affordable and Scalable Java Infrastructure Software.

    Terracotta, a recognized leader in infrastructure software for enterprise Java scalability, today announced it has been named a 2009 Duke's Choice "Java Everywhere!" Award winner by James Gosling and Sun Microsystems. Terracotta's technology is increasingly adopted by organizations to provide simple scalability and lower operational and capital costs for business-critical Java applications.


    Les acteurs du marché du Complex Event Processing
    Paul Vincent, Tibco, a diffusé un récapitulatif des différents acteurs du marché du Complex Event Processing listant l'ensemble des éditeurs proposant des solutions classés par date d'arrivée sur ce marché.
    Il y fait bien la distinction entre les produits se basant sur un système de requêtes temps réelles et ceux basés sur un système de règles.

    Il est ainsi possible de visualiser l'arrivée successive des nombreux acteurs sur ce marché en pleine croissance. Par ailleurs on remarque qu'Esper est le seul moteur de requêtes CEP Open Source du marché tandis que Drools, grâce à sa récente version 5 est devenu l'unique moteur de règles CEP qui soit Open Source. Ces nouveaux entrants viennent ainsi perturber StreamBase, Coral8 et Progress sur leurs positions investies il y a plusieurs années.


    JavaFX: Developing Rich Internet Applications
    Build Rich Applications that Run on the Desktop, the Web, Mobile Devices...Anywhere!
    Using JavaFX, developers and graphic designers can work together to build robust, immersive applications and deploy them anywhere: on the desktop, on the Web, and on millions of Java-enabled mobile devices. JavaFX lets you maintain your existing graphics and seamlessly integrate them into Java applications. Plus, JavaFX Script is a declarative language that allows you to preserve your investment in the Java platform while allowing more creativity with JavaFX's Rich Internet Application environment.


    Real-Time Java Programming: With Java RTS
    The Definitive Guide to Java RTS for Developers and Architects
    For Java developers and architects moving to real-time, and real-time developers moving to Java Walks through start-to-finish case study applications, identifying their constraints and discussing the APIs and design patterns used to address them Written by the former leader of the real-time Java standards process and one of Wall Street's top real-time developers. Sun Microsystems' Java Real-Time System (Java RTS) is proving itself in numerous, wideranging
    environments, including finance, control systems, manufacturing, and defense.
    Java RTS and the RTSJ standard (JSR-001) eliminate the need for complicated, specialized, real-time languages and operating environments, saving money by leveraging Java's exceptional productivity and familiarity.


    Programmation concurrente en Java
    La programmation concurrente permet l'exécution de programmes en parallèle. À l'heure où les processeurs multicœurs sont devenus un standard, elle est désormais incontournable, et concerne tous les développeurs Java. Mais l'écriture d'un code qui exploite efficacement la puissance des nouveaux processeurs et supporte les environnements concurrents représente un défi à la fois en termes d'architecture, de programmation et de tests.

    Le développement, le test et le débogage d'applications multi-threads s'avèrent en effet très ardus car, évidemment, les problèmes de concurrence se manifestent de façon imprévisible. Ils apparaissent généralement au pire moment – en production, sous une lourde charge de travail.

    Le but de ce livre est de répondre à ces défis en offrant des techniques, des patrons et des outils pour analyser les programmes et pour encapsuler la complexité des interactions concurrentes. Il fournit à la fois les bases théoriques et les techniques concrètes pour construire des applications concurrentes fiables et adaptées aux systèmes actuels – et futurs.

    L'édition française de cet ouvrage a été relue et validée par deux experts Java, Nicolas de Loof (architecte Java) et Eric Hébert (architecte Java JEE).


    Sommaire

    1 Introduction

    I Les bases
    2 Thread safety
    3 Partage des objets
    4 Composition d'objets
    5 Briques de base

    II Structuration des applications concurrentes
    6 Exécution des tâches
    7 Annulation et arrêt
    8 Pools de threads
    9 Applications graphiques

    III Vivacité, performances et tests
    10 Éviter les problèmes de vivacité
    11 Performances et adaptabilité
    12 Tests des programmes concurrents

    IV Sujets avancés
    13 Verrous explicites
    14 Construction de synchronisateurs personnalisés
    15 Variables atomiques et synchronisation non bloquante
    16 Le modèle mémoire de Java


  • Spring 2.5 Aspect-Oriented Programming Book Review
    Spring 2.5 Aspect-Oriented Programming is a good and unique work and it is highly recommended for developers who are focused (or would like to focus) on Spring AOP!


    Java 1.5 for the .NET Platform
    Ja.NET is a port of Java 1.5 SE to the .NET platform. The compiler is based on the Eclipse JDT, which has been modified to generate IL as well as Java Byte Code. Java traditionally compiles each class into a separate file, but this creates an unacceptable overhead for .NET. To address this, a tool based on Cecil is used to create larger assemblies much in the same way Jar files are created for Java.


    Swing Threading
    Desktop applications are often multi-threaded in nature. While adding benefits to responsiveness and performance, multi-threading adds coding complexity. You can write Swing applications without using multiple threads. However, once you cross the line into having a multi-threaded application, you should abide by Swing's threading rules. Otherwise, your application may behave in an unpredictable manner. In this chapter, you'll explore how Swing uses threads. You'll then view a number of threading-related resources in the Swing API. You'll also be introduced to three structured Swing threading solutions: SwingWorker, Foxtrot, and Spin. Finally, you'll learn how to detect incorrect thread usage in Swing with a custom repaint manager.


    Java Development Kit Software 7
    Java Development Kit 7 (JDK 7) is the next major release of the Java SE platform. Through the OpenJDK project, JDK 7 has been a highly collaborative effort between Sun and volunteers from the Java developer community. Sun extends its gratitude to all who have contributed to this release.


    OpenJDK 7
    A new milestone of the next generation JDK has been released, which includes several new features and enhancements in many functional areas, like garbage collection, NIO and more. This is also the first version where OpenJDK and JDK will have (almost) identical code-bases.


    Java Enums Are Inherently Serializable
    More than once, I have seen code such as the following (without the comments I have added to point out flaws), in which a well-intentioned Java developer has ensured that their favorite Enum [1] explicitly declares that it is Serializable [2] and has even provided a serialVersionUID [3] for it.