vendredi 26 août 2011

Veille technologique semaine 34

Pour le bulletin de cette semaine, je vous propose les sujet suivants :
  • Une analyse du changement de stratégie d'HP au sujet du PC et de WebOS.
  • La mutation de l'industrie de l'informatique : l'ère post PC ?
  • Dans la série des anniversaires, après les 20 ans du Web, les 30 ans du PC, c'est les 20 ans de Linux.
  • L'organisation OASIS publie un document de référence pour les architectures orienté services : Reference Architecture Foundation for Service Oriented Architecture (SOA-RAF).
  • Un article qui fait l'analyse de l'utilisation du format XML pour la communication homme-machine.
  • Les diagrammes et la communication entre humains : le cerveau préfère un dessin plutôt qu'un long discourt.
  • La mise à jour de la doc JavaFX 2.0 : les charts, les effets sur les textes, ...
  • Introduction du langage Scala pour les programmeurs Java.
  • Une deuxième diffusion de l'article sur la gestion des exceptions en Java.
  • Un article sur la modularité prévue par le JDK 8 et celle proposée par OSGi.
  • 10 conseils pour l'écriture des commentaires dans le code : c'est toujours un exercice difficile.
Bonne lecture.


HP quitte le PC
"Nous sommes incroyablement enthousiastes sur les opportunités autour de webOS, ainsi que le sont nos 300 000 employés, nos 110 000 commerciaux et intégrateurs, nos 13 000 partenaires dans la grande distribution… beaucoup de monde est emballé par le potentiel de webOS, mais nous avons aussi beaucoup de travail devant nous".
Ces propos tenus durant une interview à This Is My Next par Stephen DeWitt,
Senior Vice President de la nouvelle division webOS global Business Unit ne datent pas d'avril 2010, au lendemain de l'annonce du rachat de Palm, mais d'il y a seulement un mois. Et le reste de l'interview, conduite avec la compagnie de Jon Rubinstein, expatron de Palm, était à l'avenant. Pleine de superlatifs sur la manière dont HP allait gérer l'avenir de la plateforme, diversifier l'offre produit, améliorer l'OS et soigner sa relation avec ses clients. Honnête aussi dans la reconnaissance de certains problèmes qui avaient entaché le lancement de la première tablette webOS.


Post-PC : le bouleversement de toute une industrie
Avec le rachat de Motorola par Google et l'abandon du matériel par HP, les cartes continuent d'être redistribuées dans un marché résolument très fluide.
Du côté du PC, c'est une véritable hécatombe : les plus grands fabricants se sont éteints ou retirés du marché les un après les autres : IBM, Gateway, Compaq, et maintenant HP, faisaient pourtant figure de forteresses imprenables, avec des chiffres de vente plus que respectables. Ces prestigieuses sociétés ont été victimes d'une guerre tarifaire sanglante, et à vrai dire inéluctable.


March of the Penguin: Ars looks back at 20 years of Linux
The Linux kernel was originally created by Linus Torvalds, a Finnish computer science student, and first announced to the world on August 25, 1991—exactly 20 years ago today. At the time, Torvalds described his work as a "hobby" and contended that it would not be "big and professional" like the GNU project.

 
Reference Architecture Foundation for Service Oriented Architecture Review announced by OASIS
OASIS has just announced a public review for Reference Architecture Foundation for Service Oriented Architecture (SOA-RAF). This new document is a result of several years of work for the OASIS SOA Reference Model TC and represents an extension of the concepts and relationships defined in the OASIS Reference Model for Service Oriented Architecture.
SOA-RAF defines Service Oriented Architecture (SOA) as an architectural paradigm (style), occupying the boundary between business and IT. It is neither wholly IT nor wholly business, but reflects concerns of both worlds. Neither business nor IT completely own, govern and manage this SOA ecosystem. Both sets of concerns must be accommodated in the SOA ecosystem to fulfill its purposes. As a result, SOA-RAF focuses on SOA as an approach to integrating business with the information technology.


Soapbox: Humans should not have to grok XML
Summary: Today the computing world tends toward using XML for any and all formal specifications and data descriptions. The author, a big fan of XML, asks a blasphemous question: "Is XML totalitarianism a good idea?" In this opinion piece, Terence Parr, co-founder of jGuru, demonstrates that XML makes a lousy human interface. He also provides questions to ask yourself to determine if XML is appropriate even for your project's program-to-program interface needs.


What Meets the Eye
Yes, diagrams. All of us use diagrams in one way or another. Mostly, diagrams are used to enhance communication and to illustrate what exactly one is talking about.
"But that's it. Diagrams are sketches which are meant to be thrown away without deserving a second look."


What's New in the JavaFX 2.0 Beta Docs
New JavaFX 2.0 Beta docs have been added and some of the existing docs have been updated to coincide with the release of the JavaFX 2.0 Beta SDK (build 40).


An Introduction to Scala for Java Developers
Scala combines the object-oriented and functional programming paradigms, using a concise syntax that is fully compatible with Java and runs on the JVM. Support for the functional programming style, and in particular Lambda expressions which are not now expected to be added to Java until JavaSE 8 in 2012, can help reduce the amount of boiler plate code that you are required to write, arguably making it easier to focus on the task in hand. This article provides an introduction to Scala.


La gestion des exceptions en java
En auditant des applications pour des clients d'OCTO, je me suis aperçu que la gestion des exceptions est un élément qui fait souvent défaut au même titre que la gestion des transactions.
Ce billet était à l'origine des notes personnelles qui avaient pour but de me servir de piqure de rappel et je me suis dit qu'un article de blog serait peut être utile à tous.
Ce sujet prête souvent à discussions et il faut parfois adapter au cas par cas, néanmoins avoir un cadre de bonnes pratiques peut s'avérer très utile.


Successful modularity depends on your dependency model
What We Depend On Jigsaw is implementing a module system for Java 8 that deviates from the (modular) spirit of Java in a way that is bad for the language and will cause untold headaches for the Java community in the future. In this article, I will argue that the Jigsaw design does not fit Java because it ignores packages and uses the wrong dependency model by exporting types and importing modules.


10 best practices to follow while writing code comments
Comments are an important part of writing code not only in java but whatever programming or scripting language you use. At the same time this is one of the most abused things also. Both writing no comment and writing too
much comment is bad and in this article I am going to share with you guys some 0f the rule and best practices I follow while writing comments. Before that let's first see what is the purpose of having comment in the code? Why do
we need comment, isn't writing code is enough. Some of the people I have met always argue that we are getting paid for writing code and not comment :).

vendredi 19 août 2011

Veille technologique semaine 33

Pour le bulletin de cette semaine, je vous propose les sujets suivants :
  • Google rachète la division mobile de Motorola pour 12,5 milliards de dollars. Ce rachat est visiblement motivé par les brevets plutôt que par la production de téléphones.
  • Le PC IBM que l'on connaît à 30 ans : 1981-2011. L'un de ces pères n'y croit plus. IBM a déjà revendu sa filiale de fabrication de PC. HP vient d'annoncer également la filialisation de sa division de fabrication de PC, pour se recentrer sur le service (comme IBM).
  • Le standard C++0x (pronounced "see plus plus oh ex") a été voté la semaine dernière. C'est une étape importante pour le C++ qui termine plus de dix ans de travaux. La version précédante date de 1998 (mise à jour en 2003). Les compilateurs intègrent déjà peu à peu une grande partie de ce standard (Visual Studio de Microsoft, GCC, ...). Quelques explication des évolutions.
  • Une étude du CNRS sur la fiabilité des supports CD et DVD.
  • Un article d'IBM sur sa technologie métronome pour l'implémentation d'un garbage collector temps réel (déterministe). Le langage Java et le déterminisme ne sont pas incompatible. C'est une qualité liée à d'implémentation.
  • Un exemple de l'utilisation de l'automatique unlock() d'un verrou avec la fonction du JDK 7 try-with-resource.
Bonne lecture.

Google prend le contrôle de Motorola Mobility
C'est un coup de tonnerre qui a fait trembler le monde de la téléphonie mobile hier lorsque Google a annoncé avoir racheté la division Mobility de Motorola pour la coquette somme de 12,5 milliards de dollars en cash. C'est l'acquisition la plus importante de l'histoire de Google. Pour 12,5 milliards de dollars, l'achat de Motorola Mobility à lui seul dépasse largement les 9,1 milliards que la société a payés pour ses 136 acquisitions antérieures.
Avec ce rachat, Google va donc acquérir les moyens de produire des téléphones mobiles, mais il ne faut pas s'y tromper, au-delà de la marque et de la gamme de matériels, le but de cette opération est surtout de prendre possession des 17 000 brevets (en plus des 7 500 qui attendent approbation), dont est propriétaire Motorola, un des pionniers du téléphone portable.
On ne pourra plus dire que Google n'est pas suffisamment armé dans la guerre des brevets qui fait rage entre les acteurs principaux de la téléphonie mobile. C'est une belle revanche pour Google qui s'était vue exclue de
l'arrangement  pour l'achat des milliers de brevets du canadien Nortel, il y a quelques semaines.
Un accord existe entre les deux marques, il faut maintenant que les autorités financières ainsi que l'assemblée générale des actionnaires de Motorola Mobility approuvent la vente. Si tout se passe bien, l'opération devrait être effective fin 2011, début 2012.



Google to acquire Motorola Mobility for $12.5 billion
Google revealed on Monday that it will buy handset maker Motorola Mobility, giving the search giant an entrance into the hardware business and allowing it to compete with Apple more directly by building devices tailored specifically for its Android mobile operating system.


Un des pères du PC lui dit adieu
Mark Dean est un ingénieur vétéran d'IBM, qui participa au développement du PC/AT, du bus ISA, du PS/2 70 et 80, et de la carte graphique couleur du premier PC, fabriqué par IBM en réponse à l'Apple II en 1981.
Celui-ci, aujourd'hui directeur technique d'IBM pour la région Moyen Orient et Afrique, publie sur son blog une oraison funèbre pour la machine qu'il contribua à mettre au point : « C'est surprenant pour moi de penser que le 12 août marquera le 30è anniversaire de l'IBM Personal Computer. Je suis fier d'avoir compté parmi les dizaines d'ingénieurs IBM qui ont conçu la première machine, et d'avoir eu la chance de mener la conception des PC ultérieurs à travers les années 80. »


We have an international standard: C++0x is unanimously approved
The final ISO ballot on C++0x closed on Wednesday, and we just received the results: Unanimous
approval. The next revision of C++ that we've been calling "C++0x" is now an International Standard! Geneva will take several months to publish it, but we hope it will be published well within the year, and then we'll be able to call it "C++11."


C++0x
From Wikipedia, the free encyclopedia
C++0x (pronounced "see plus plus oh ex") is the unofficial name of the new standard for the C++ programming language (originally, finalization was expected in 2008 or 2009, but the "0x" was retained). C++0x is intended to replace the existing C++ standard, ISO/IEC 14882, which was published in 1998 and
updated in 2003. These predecessors are informally but commonly known as C++98 and C++03. The new standard will include several additions to the core language and will extend the C++ standard library, incorporating most of the C++ Technical Report 1 (TR1) libraries — with the exception of the library of mathematical special functions. As of 12 August 2011, the C++0x specification has been approved by the ISO.


C++0x Core Language Features In VC10: The Table
When we announced that the Visual Studio 2010 Release Candidate Is Now
Available For Download, a reader, Igor, asked us to provide a table summarizing
which C++0x Core Language features are implemented in VC10. So, here it is!


C++0x Support in GCC
C++0x is the working name of the next ISO C++ standard, due by the end of this decade, which introduces a host of new features into the standard C++ language and library. This project seeks to implement new C++0x features in GCC and to make it one of the first compilers to bring C++0x to C++ programmers.
C++0x features are available as part of the "mainline" GCC compiler in the trunk of GCC's Subversion repository and in GCC 4.3 and later. To enable C++0x support, add the command-line parameter -std=c++0x to your g++ command line. Or, to enable GNU extensions in addition to C++0x extensions, add -std=gnu++0x to your g++ command line.
Important: because the ISO C++0x draft is still evolving, GCC's support for C++0x is experimental. No attempt will be made to maintain backward compatibility with implementations of C++0x features that do not reflect the final C++0x standard.


CD et DVD : des supports peu fiables ?
L'Académie des sciences et l'Académie des technologies ont publié conjointement un rapport intitulé « Longévité de l'information numérique ». La conclusion en est simple : nos supports de stockage, CD, DVD et disques durs, ne sont que très peu fiables. Franck Laloë, co-auteur du rapport et directeur de recherche au CNRS, résume : « les fabricants ont voulu nous faire croire que leurs supports de stockage conserveraient nos données une éternité. Ce n'est pas le cas ».


REALTIME GARBAGE COLLECTION
Traditional computer science deals with the computation of correct results. Realtime systems interact with the physical world, so they have a second correctness criterion: they have to compute the correct result within a bounded amount of time. Simply building functionally correct software is hard enough. When timing is added to the requirements, the cost and complexity of building the software increase enormously. In the past, realtime systems have made up a relatively small portion of the total amount of software being produced, so these problems were largely ignored by the mainstream computer science community. The trend in computer technology, however, is toward an ever-increasing fraction of software having some kind of timing requirement.


Automatically Unlocking with Java 7
In this newsletter we explore my favourite new Java 7 feature "try-with-resource" and see how we can use this mechanism to automatically unlock Java 5 locks.

vendredi 12 août 2011

Veille technologique semaine 32

Pour le bulletin de cette semaine, je vous propose les sujets suivants :
  • Le web a 20 ans : historique.
  • Le début de l'ère post-PC : ou l'évolution possible des appareils numériques.
  • Une fois n'est pas coutume, un article sur une fonction du dernier Mac OSX : la fonction quitter d'une application qui perd de l'importance.
  • Un article au sujet de la plateforme Java dans le monde de l'embarqué. Le don d'ubiquité de Java.
  • Le JDK 7 vient de sortir, et les outils se mettent à jour. Première sortie de la version 3.8M1 d'eclipse avec le support JDK 7. Version complète prévue pour septembre.
  • Une liste des fonctionnalités du langage Java qui n'ont pas été reconduit (aujourd'hui) dans le langage scala.
  • La technologie d'IHM JavaFX 2.0 vient juste de sortir en version béta, que déjà des utilisation en langage Groovy apparaissent : GroovyFX. Cela illustre l'intérêt d'avoir une technologie interroperable nativement entre langages.
  • Deux articles sur la définition de l'injection de dépendances : une explication et les conséquences de conception.
  • Le groupe Khronos annonce la version 4.2 de la spécification d'OpenGL.
  • Le type nullable et les types non nullable : le langage Kotlin propose une solution.
Bonne lecture.


Le Web fête ses 20 ans
Le 6 août 1991, Tim Berners-Lee mettait en ligne le premier site Web au CERN (Organisation européenne pour la recherche nucléaire) à Genève.

Il ne faut pas mélanger Internet et Web : Internet est le système de réseaux interconnectés utilisant des protocoles communs (TCP/IP), le World Wide Web étant une application d'Internet comme le courriel, IRC ou FTP en sont. Ainsi au début des années 1990, le CERN est le plus grand noeud Internet d'Europe et un des plus grands du monde. Le principal problème est alors d'organiser l'information et d'y accéder de manière persistante et cohérente, divers protocoles — diverses applications d'Internet — étant utilisés. Gopher, FTP ou Usenet étaient alors parmi les protocoles les plus populaires — sans oublier l'email.


Twentieth Anniversary of the World Wide Web
This weekend was the 20th anniversary of the World Wide Web project announcement on the alt.hypertext group. On August 6th, 1991, Tim Berners Lee posted:


Pourquoi le "post-pc" révolutionne l'informatique
Avec l'iPad, Steve Jobs a sonné le glas de l'informatique telle que nous l'avons toujours connu et qu'il a contribué à lancer et façonner : l'ère du "post-pc" connaissait son avènement. Pourquoi ces appareils, un temps moqués par certains observateurs comme de "gros iPod touch", représentent-ils un enjeu stratégique majeur pour tous les acteurs de l'industrie ?
Entendons-nous d'abord sur le terme tel qu'initié par Steve Jobs : le "post-pc", ça n'est pas "l'après pc", mais "au-delà du PC".


L'interruption automatique des apps dans OS X Lion
Comme le remarque Tidbits, OS X Lion pousse le mimétisme avec iOS dans la manière dont il gère les applications jusqu'à décider de lui-même de la fermeture d'une application pour libérer des ressources. Cette fonction d'« interruption automatique » des applications, une véritable rupture du système de multitâche, est censée améliorer « l'expérience utilisateur » selon Apple.


A Fresh Look at Embedded with Greg Bollella, Chief Architect, Embedded Java
Greg Bollella has been a leader in the Embedded Java and real-time Java space since Java first moved into the embedded space. In the 1990s, he worked at IBM where he led the Real-Time for Java Expert Group under the Java Community Process (JCP). In 2000, he joined the highly regarded Sun Microsystems Laboratories. His work in exploring the uses of Real-Time Specification for Java (RTSJ) in controlling physical systems--from rockets to power plants to automobiles--led him to be named a Sun Distinguished Engineer.
Now, as Chief Architect, Embedded Java for Oracle, he is continuing his work in integrating Java into the rapidly changing embedded space. He holds a Ph.D. from the University of North Carolina at Chapel Hill.
We met with him to get an update on Java and the embedded space.


Eclipse 3.8M1 Brings Java7 Support
The Eclipse Foundation has released Eclipse 3.8M1, which is the first milestone release with Java7 support. Although there were beta releases available before, it could not be officially called Java7 until after the latter's release, and as such, the recently-released Eclipse Indigo (3.7).
Java7 support will come to Eclipse 3.7.1, which is due to be released in September. The integration builds for 3.7.1 already contain the Java7 support found in Eclipse 3.8M1, which is already supported in IntelliJ IDEA 10.5 and NetBeans 7.0.1

New changes include:
  • Diamond operators suggested by content assist
  • Redundant type literals can be removed and replaced with the diamond operator
  • Content assist can be used to insert types into diamonds
  • Multi-catch can be extended with a "Surround with try/multi-catch", complementing the existing "Surround with try/catch"
  • Multi-catch can be extended with new exception types
  • Exception blocks can be combined into a single multi-catch block
  • Resources closed with try-with-resources can detect thrown exceptions and add to (multi-)catch blocks
  • Strings-in-switch can be converted to a nested if/else
  • The Java7 execution environment has been added for dependency on execution environments

What's new for Java 7
Java 7 comes with a set of small enhancements to the Java language (aka Project Coin), a new byte code to dynamically invoke methods and many additions to the libraries. The Eclipse compiler implements all the new features of Java 7 and all Eclipse JDT features like e.g. search and refactoring have been updated to support Java 7. Besides that, some new features got added:
  • Improved Type Inference for Generic Instance Creation (Diamond)
  • Multi-catch
  • try-with-resources statement
  • Simplified Varargs Method Invocation
  • Strings in switch
  • Polymorphic Methods
  • Miscellaneous

What features of Java have been dropped in Scala?
Despite more complex and less intuitive syntax compared to Java, Scala actually drops several features of Java, sometimes for good, other times providing replacements on the standard library level. As you will see soon, Scala isn't a superset of Java (like Groovy) and actually removes a lot of noise. Below is a catalogue of the missing features.



Introducing GroovyFX: It's About Time
GroovyFX is an open source project whose goal is to combine the conciseness of Groovy with the power of JavaFX 2.0. Jim Clarke, the originator of the project, and I have been working hard to make GroovyFX the most advanced library for writing JavaFX code with alternative JVM languages. As you are about to see, it is more than a mere DSL that provides some syntactic
sugar for JavaFX code. We have decided that it is past time to share our progress with the wider JavaFX community; this article is long overdue (right, Jonathan?).

This is the first of many articles I'll be writing about GroovyFX. If you want to stay up to date
with the GroovyFX project you can follow this blog or follow me on Twitter.


A beginners guide to Dependency Injection
This article presents a high level overview of Dependency Injection (DI). It aims to present the overall concept of Dependency Injection to the junior developer within the context of how it could be used in a variety of DI containers.
Dependency Injection (DI) or Inversion of Control (IOC) ?


Dependency Injection with Mark Seemann
Mark Seemann, author of Dependency Injection in .NET, talks to us about the differences between DI and Service Locators and the importance of having a Composite Root. He also touches on how these all relate back to the SOLID principals of object oriented design.


Khronos ships OpenGL 4.2 spec, outlines plans for new sensor API
The Khronos group unveiled on Monday the OpenGL 4.2 specification, the newest update to the cross-platform 3D graphics API.
The new spec includes a handful of new features designed to improve the performance of common operations in order to allow developers to more easily create high-performance 3D software. These features include fine-grained modification of textures, more efficient data sharing between shader programs, and the ability to reuse shapes that the GPU has already tessellated without having to tessellate them again.


Nullable types and Non-null types
One of the most common pitfalls in Java programming is accessing a member of a null reference, that results in a NullPointerException, because virtually any reference in a Java program can hold null. It happens so often that we have a casual abbreviation for it: NPE.

Kotlin's type system is aimed to eliminate NullPointerException's from our code. The only possible causes of NPE's may be
1. Someone had explicitly thrown is (throw NullPointerException())
2. Someone called external Java code that caused it
3. There's data inconsistency w.r.t initialization (an uninitialized this available in a constructor is used somewhere)


vendredi 5 août 2011

Veille technologique semaine 31

Pour le bulletin de cette semaine, je vous propose les sujets suivants :
  • la migration de FaceBook avec 30PB (30 Peta Byte) à déplacer.
  • Quelques articles sur le JDK 7 : les nouveautés, les bugs, et les autres langages : JRuby et JDK 7.
  • Un article sur OpenCL : comment utiliser la puissance des processeurs graphiques pour faire du calcul.
  • JUnit et les règles : dans la version 4.7.
  • Les performances des verrou et des synchronizations.
Bonne lecture.


Migration 30 Petabytes sur Hadoop pour Facebook
Dans les architectures distribuées de stockage de données, une nouvelle fait le buzz cette semaine. Quand Facebook décide de déplacer ses datacenters, évidement, il y a de l'octet qui se promène. Victime de son trafic, l'ancien datacenter prévu initialement pour 10 PB a atteint dernièrement les 30 PB (avec pas moins de 10 PB généré en une seule année), soit quelques 30 000 000 Go!
Hadoop est le célèbre framework d'Apache pour la gestion de filesystem distribué. Il est utilisé par Facebook pour la gestion interne d'analyse ainsi que les produits additionnels (comme Facebook Ad Network), avec Hive pour la gestion d'un datawarehouse.
 
Voilà un potentiel sujet pour un prochain challenge USI: comment déplacer 30 PB de filesystem avec une contrainte d'exploitation du système en 24/7, et quelques millions d'utilisateurs de connectés ? (avis aux amateurs de défis !)
Côté infrastructure, 1200 serveurs 8-coeurs ainsi que 800 serveurs 16-coeurs avec chacun 12 To de disque et 32 Go de RAM.
Pour répondre à cette problématiques, les ingénieurs optent pour la solution du basculement total de l'ancien cluster vers le nouveau. Transporter un tel volume de données n'est pas instantané. L'équipe a du développer un système de réplication des changements en continue de l'ancien cluster vers le nouveau, tant que le basculement n'était pas effectué.
 
L'ajout d'un plugin sur Hive permet d'écrire tous ses changements sources dans un fichier d'audit. Le système de réplication est branché sur ce fichier et reproduit en continu les changements sur le nouveau noeud. Ce système n'est pas sans rappelé le mécanisme Change Data Capture d'Oracle !
Ensuite, l'équipe s'enferme dans une war-room, tire à la courte-paille quel ops devra lancer la commande fatidique, et stoppe l'ancien cluster. Je vous laisse imaginer la petite émotion lorsque le bouton Enter du clavier est pressée. Une fois le tour de magie effectué, et le sanity check passé, un changement de DNS ensuite permettra de rentre le système stable, et le stress des équipes redescendre face à la réussite d'un projet aussi colossal !
Ceci est par ailleurs une excellente publicité faite à Hadoop et Hive pour l'intégration dans le monde de l'entreprise.
A titre de comparaison, le nouvel accélérateur à particules du CERN, le LHC bat des records de collisions. Ses chiffres pourtant prodigieux n'arrivent que difficilement à la hauteur des volumétries de Facebook. Avec plus de 10 000 milliard de collision par an, et plus 1 Mo de données par collision, on atteint la barre des 10 Po par an. Cependant, on ne mesure pas l'octet à la valeur qu'il peut représenter.

Java 7
Ca y est, après une longue attente, Java 7 est sorti la semaine passée, le 28 juillet pour être exact. C'est sous la forme d'OpenJDK, le pendant open-source de l'ancien JDK fermé de Sun qui était jusqu'aux versions 6 l'implémentation de référence, que s'effectue cette sortie.
Nous vous avons tenu au courant assez régulièrement de l'avancement des travaux donc nous ne reviendrons pas en long, large et travers sur tout ce qu'apporte cette version et sur sa gestation
pas toujours facile. Alors bien sûr, certains regretteront l'absence des expressions lambda et du projet Jigsaw (modularité) reportés à Java 8, mais ne boudons pas notre plaisir et profitons:
  • du fork/join
  • la fermeture automatique des ressources auto-closables
  • du support des Strings dans les switch
  • du support du symbole underscore '_' dans les nombres comme séparateur, pour une meilleure lisibilité
  • du multi-catch d'exceptions
  • de l'opérateur diamant apportant une meilleure inférence de type sur la création d'instances génériques
  • de Nio 2 (que nous vous avons récemment présenté) et de ses améliorations sur les E/S: l'ajout des Path du service Watchable ainsi que le support des symlinks pour le filesystem, mais aussi de nombreux apports sur les E/S asynchrones et les sockets non bloquants.
  • invokedynamic, qui devrait accélérer les langages dynamiques qui l'utiliseront
Premiers couacs
Mais comme toute nouveauté, cette nouvelle version du JDK apporte aussi son lot de douleurs. Apache l'a compris avec un bug sur les projets d'indexation et de recherche Lucene et Solr. Après mise à jour vers le JDK 7, des indexes se sont corrompus et des JVM sont tombées par dizaines avec l'erreur la plus connue des étudiants qui commence en langage C: SIGSEGV ou Segmentation Fault !
Les erreurs se portent sur une partie identifiée du projet, l'algorithme Porter Stemming pour l'optimisation de son moteur de recherche dans la langue de Shakespeare. La réponse apportée par l'équipe d'Apache ne s'est pas fait attendre. Après un premier problème d'optimisation des boucles, des effets de bords des nouvelles locales dans le JDK ou encore avec DataInput.readVInt(). Le premier fix est d'utiliser le paramètre de VM *XX:-UseLoopPredicate.*
Pour Solr, le problème venait principalement du fait que la bonne exécution des tests était dépendantes de l'ordre dans lequel ils étaient écrits. Comme quoi, les principes de réalisations des tests unitaires ne sont pas vains !
Il n'en faut pas moins pour que la blogosphère ne s'enflamme en quelques temps, dans des invectives contre JDK 7 et Apache, à tort. En effet, le problème vient plus d'un bug d'implémentation de HotSpot plutôt que des JSR en elle-mêmes. Le conseil est donc d'utiliser le workaround pour les projets Solr et Lucene, et d'attendre le bug fix d'Oracle. Oracle tente de rassurer les foules par ce billet: les corrections de bug des JVM sont en cours.


Adam Messinger Talks to InfoQ About Java 7 and 8
Following on from last week's release of Java 7, InfoQ spoke to Adam Messinger, Vice President of Development in the Fusion Middleware group at Oracle, to get more information about the release and Oracle's plan for Java 8.


Java Programming Language Enhancements
Enhancements in JDK 7


Java7 Hotspot Loop Bug Details
After Java7's GA release last week, an issue was discovered with one of the optimisations enabled by default with the new JIT. Although originally identified by a use-case in the Lucene search indexer, the problem may be more widespread in other codebases as well.
 
This prompted a number of alarmist articles, such as "Don't use Java 7 for anything" which implied that all loops were problematic. In fact, although there is a valid bug (in which loops may be incorrectly unrolled or cause SIGSEGV crashes), this optimisation bug has been present since Java 6 if either the -XX:+OptimizeStringConcat or -XX:+AggressiveOpts optimisations are enabled.
 
In fact, the problem only occurs with specific loops (those which uses conditions which may be mutated by the loop body), as noted in the fix. The problem doesn't occur when running in -Xint (in interpreted mode) but does occur when -server mode, which most server-side applications are likely to use.


JRuby and Java 7: What to Expect
Java 7 has landed, with a modest set of new features and a few major improvements as well. What can you expect from JRuby running on Java 7?
What's In Java 7 The biggest changes in Java 7 are not related to the Java language at all. Sure, there's the "project coin" enhancements to the Java language, which add some exception-handling shortcuts, new literals for numbers, arrays, hashes, the oftrequested "strings in switch" support, and a few other things. But they're modest incremental changes; the real revolution is at the JVM and JDK level.

Invokedynamic
The most important change in Java 7 is the incorporation of a new bytecode -- invokedynamic -- and an API for building chains of "method handles" to back that bytecode up.


GPU Computing with OpenCL
In the past, processor vendors have increased performance by increasing CPU clock rates, but an upper limit is being reached due to factors such as the settling time of CPU circuitry and the dissipation of waste heat. Performance can still be improved by adding additional processors — dual and quad core machines are now becoming commonplace, but adding more than a handful of cores is cost-prohibitive on commodity hardware.

Additional processing power can be achieved by utilizing the GPU of video cards that allow general purpose computing. As far back as 2001, consumer-grade graphics cards from NVidia allowed part of the rendering pipeline to be customized via user-written code, and since then GPUs have advanced to where more general computation is possible. GPU computing is now used in areas such as science, engineering, cryptography, and computer graphics.

As a GPU is designed to execute the same operations on each item of work (such as a pixel of an image, or an element of an array), it can be conceptualized as a large SPMD (Single Program, Multiple Data) processor array supporting data-parallel applications. Applications most suited to this programming model are ones where there is little dependency between the data items in the computation, such as vector addition or image processing. Computations that are task, rather than data, driven, may not benefit as much.


New Feature of JUnit: Rules
I am always surprised how many unknown feature hide in a supposedly simple library. Todays example is JUnit. When inspecting the newest version (4.7) I noted an annotation I hadn't noticed before: @Rule. WTF? I am looking at a testing framework and not at a rules engine, am I? So naturally I tried to find out what it is good for, and since not to much documentation is available my little research resulted in this blog post. Enjoy.


Rules in JUnit 4.9
One of the most useful innovations in the JUnit realm have been Rules. I wrote about Rules here [4]. And I wrote about use cases for JUnit Rules here [5]. Rules are great. And with JUnit  4.9 they get even better.
You can think of Rules as a way to encapsulate setup and teardown of a test in one class instead of two methods. But Rules are also a way to modify the way to execute your tests.
You can run tests a dozen time instead of once. Or in twenty different threads. Interestingly there were only Rules for single tests. So if you want to stick with the comparison with setup and teardown, aka @Before and @After there wasn't a @BeforeClass and @AfterClass equivalent in Rules.


Synchronized vs Lock performance
There are a number of articles on whether synchronized or Locks are faster. There appear to be opinions in favour of either option. In this article I attempt to show how you can achieve different views depending on how you benchmark the two approaches. I have included AtomicInteger to see how a volatile field compares.

vendredi 29 juillet 2011

Veille technologique semaine 30

Pour le bulletin de cette semaine, je vous propose les sujets suivants :
  • Sortie du JDK 7, comme prévu, le 28 juillet 2011 : articles sur le contenu avec les détails de la documentation.
  • Un article sur le pattern "Disruptor".
  • OSGi et la gestion des modules partagés.
  • Java et la réflexivité des génériques.
  • La définition des classes non mutables
  • La déclaration des variables : la forme dépends du langage de programmation.
  • La taille des objets en Java.
  • La taille des tableaux en Java.

Bonne lecture.


Java SE 7 Released: First Major Update Since December 2006
Java 7 is generally available from today, the first release of the Java platform since Oracle's acquisition of Sun. The release includes a number of small but welcome changes to the language, incorporates a new file API and the Fork/Join Framework, and improves dynamic language support on the JVM.

For Java 7 language changes have been managed as part of Project Coin (JSR 334), a successor to JSR 201, designed to enhance the Java language with an assortment of small changes to improve productivity. Of particular note is the introduction of "try-with-resources". This is analogous to C#'s using statement but based on a form of the try statement. As a result, whilst the using statement only takes a single resource, try-with-resources is able to handle multiple resources within the scope of a given block. Two changes have been made to exception handling. First, multiple exception types can be named as being handled by a single catch block. The grammar of a catch clause of a try statement is extended to allow a series of exception types, separated by the "OR" operator symbol, "|", to be used in the declaration of the exception parameter. Second, if an exception parameter is not modified and if it is rethrown inside the catch block, you don't now have to add the exception to the method signature.


Java SE 7 Downloads
This release includes new features such as small language changes for improved developer productivity, a new Filesystem API, support for asynchronous I/O, a new fork/join framework for multicore performance, improved support for dynamic and script languages, updates to security, internationalization and web standards and much more.


Java Platform Standard Edition 7 Documentation
Oracle has two products that implement Java Platform Standard Edition (Java SE) 7: Java SE Development Kit (JDK) 7 and Java SE Runtime Environment (JRE) 7.
JDK 7 is a superset of JRE 7, and contains everything that is in JRE 7, plus tools such as the compilers and debuggers necessary for developing applets and applications. JRE 7 provides the libraries, the Java Virtual Machine (JVM), and other components to run applets and applications written in the Java programming language.

What's New in Documentation
Documentation is regularly updated to provide developers with in-depth information about new features in the Java platform.


Java as a platform and a language
Welcome to Java 7. Things around here are a little different than you may be used to. This is a really good thing—we have a lot to explore now that the dust has settled and Java 7 has been unleashed. By the time we finish our journey, you'll have taken your first steps into a larger world—a world of new features, of software craftsmanship, and other languages on the JVM.
 
We're going to warm you up with a gentle introduction to Java 7, but one that still acquaints you with its powerful features. We'll showcase Project Coin, a collection of small yet effective new features. You'll learn new syntax, such as an improved way of handling exceptions (multi-catch). You'll also learn about Automatic Resource Management and how it helps you to avoid bugs in the code that deals with files or other resources. By the end of this paper, you'll be writing Java in a new way and you'll be fully primed and ready for bigger topics.
Let's get going! We'll first dive into a critically important duality that lies at the heart of modern Java. This is a point that we'll come back to again throughout the book, so it's an absolutely essential one to grasp.


Dissecting the Disruptor: Why it's so fast (part one) - Locks Are Bad
Martin Fowler has written a really good article describing not only the Disruptor, but also how it fits into the architecture at LMAX. This gives some of the context that has been missing so far, but the most frequently asked question is still "What is the Disruptor?". I'm working up to answering that. I'm currently on question number two: "Why is it so fast?". These questions do go hand in hand, however, because I can't talk about why it's fast without saying what it does, and I can't talk about what it is without saying why it is that way. So I'm trapped in a circular dependency. A circular dependency of blogging.


OSGi: Because Sharing Shouldn't Be Painful
At the dawn of Windows, applications were statically linked and life was simple; applications carried their own dependencies so there was never confusion. However, this simplicity had its costs.


Java Reflection: Generics
I have often read in articles and forums that all Java Generics information is erased at compile time so that you cannot access any of that information at runtime. This is not entirely true though. It is possible to access generics information at runtime in a handful of cases. These cases actually cover several of our needs for Java Generics information. This text explains these cases.

Here is a list of the topics covered in this text:
1. The Generics Reflection Rule of Thumb
2. Generic Field Types
3. Generic Method Return Type
4. Generic Method Parameter Types



Defining immutable classes
To make a Java class immutable, you must:
  • Make all fields final.
When you define fields as final in Java, you must either initialize them at declaration time or in the constructor. Don't panic if your IDE complains that you don't initialize them at the declaration site. It'll realize that you've come back to your senses when you write the appropriate code in the constructor.
  • Make the class final so that it cannot be overridden.
If the class can be overridden, its methods' behaviors can be overridden as well, so your safest bet is to disallow subclassing. Notice that this is the strategy used by Java's String class.
  • Do not provide a no-argument constructor.
If you have an immutable object, you must set whatever state it will contain in the constructor. If you have no state to set, why do you have an object? Static methods on a stateless class would work just as well. Thus, you should never have a no-argument constructor for an immutable class. If you're using a framework that requires this for some reason, see if you can satisfy it by providing a private no-argument constructor (which is visible via reflection).
Notice that the lack of a no-argument constructor violates the JavaBeans standard, which insists on a default constructor. But JavaBeans cannot be immutable anyway, because of the way the setXXX methods work.
  • Provide at least one constructor.
If you haven't provided a no-argument one, this is your last chance to add some state to the object!
  • Do not provide any mutating methods other than the constructor.
Not only must you avoid typical JavaBeans-inspired setXXX methods, but you must also be careful not to return mutable object references. The fact that the object reference is final doesn't mean that you can't change what it points to. Thus, you need to make sure you defensively copy any object references you return from getXXX methods.


Reversed type declarations
I can't write about Kotlin without first talking about the folly of "reversed" type declarations. Sadly this disease has afflicted Scala, Gosu and now Kotlin (but perhaps its not yet too late for Kotlin ;-).


Java: Getting the size of an Object
Java was designed with the principle that you shouldn't need to know the size of an object. There are times when you really would like to know and want to avoid the guess work. Measuring how much memory an object uses


Java: How much memory do different arrays consume
Arrays can be large and consume a significant amount of memory. It can me worth choosing the most memory efficient array/collection. Comparing array sizes.

vendredi 22 juillet 2011

Veille technologique semaine 29

Pour le bulletin de cette semaine, je vous propose les sujets suivants :
  • Un bilan six semaine après le jour de l'IPV6 : avez-vous vérifié votre connectivité IPV6 ?
  • Le JDK 7 est toujours prévu pour fin juillet 2011 : quelques vidéos de présentations sur le web.
  • Un article sur le code mal conçus et mal écrit : c'est un problème de qualité non fonctionnel qui se traduit par une bombe à retardement. Il faut être très vigilant sur la qualité de conception, pour éviter une dégénérescence de l'application.
  • Un article d'Oracle au sujet de la programmation concurrente (multi-thread) et du fork / join du JDK 7.
  • Un nouvel article (en français) sur les principes SOLID : Single responsibility principle, Open close principle,  Liskov principle, Interface segregation principle, Dependency inversion principle.
  • Une synthèse du principe d'injection de dépendance.
  • La modularité avec OSGi : l'injection de dépendance avec et sans OSGi.
  • Le primitifs Java sont plus performants que les wrappeurs correspondants : réfléchir à deux fois avant d'avoir des problèmes de performances.
  • Les dépendances cycliques dans un logiciel sont interdites : comment les supprimer.
  • Le JDK 5 et le toString() des tableaux.
Bonne lecture.


Six weeks after World IPv6 Day, what have we learned?
Last month's World IPv6 Day created some excitement about IPv6. Once it was over, however, everyone went back to work—which for most people doesn't include anything IPv6-related.
The idea behind World IPv6 Day on the 8th of June was to flush out broken IPv6 setups by simultaneously turning on IPv6 across a large number of Web properties —including the four largest in the world. Few, if any, problems were reported, so in that sense WIPv6D was a resounding success. Apparently, it's possible to add IPv6 addresses to large Web destinations without significant adverse effects.


Java SE7 To Arrive At End Of July
On Monday, The Java Community Process completed voting on the final approval ballots for Java SE7, and all JSRs were given the green light.

This completes the JCP's work on Java 7, but there's a few more steps to finishing the product, according to Mark Reinhold, the Chief Architect of Oracle's Java Platform Group:

At this point all of the work required to define the abstract Java SE 7 Platform in the JCP is done but the actual product, JDK 7, is not quite finished.

Here at Oracle we're busy wrapping up final testing of the release candidate, build 147. If all goes well then that will be declared the GA build on 28 July per the schedule posted in January. Oracle's commercial binaries, based almost entirely on OpenJDK code, will be published that day; implementations from other vendors will follow.



JAVA 7 TECHNICAL BREAKOUTS

EVENT HOSTS
See the replays for all technical breakouts below:
• Making Heads and Tails of Project Coin, Small Language Changes in JDK 7 (Presentation/PDF)
• Divide and Conquer Parallelism with the Fork/Join Framework (Presentation/PDF)
• The New File System API in JDK 7 (Presentation/PDF)
• A Renaissance VM: One Platform, Many Languages(Presentation/PDF)
• Meet the Experts: Q&A and Panel Discussion




Watch the Java 7 Celebration Webcast
Oracle is committed to Java: the technology, the community, the Java Community Process (JCP), and the entire ecosystem focused on moving Java forward.
Watch this Webcast to find out more about the features of Java 7, hear from technologists at companies that use Java technology, and learn through a series of technical presentations and a panel discussion.

http://www.oracle.com/us/corporate/events/java7/index.html


Bad Code: The Invisible Threat
One of the first things said by the non-believers of the software craftsmanship movement was that good and clean code is not enough to guarantee the success of a project. And yes, they are absolutely right. There are innumerable reasons which would make a project to fail ranging from business strategy to competitors, project management, cost, time to
market, partnerships, technical limitations, integrations, etc. Due to the amount of important things a software project may have, organizations tend not to pay to much attention to things that are considered less important, like the quality of the software being developed. It is believed that with a good management team, deep hierarchies, micro management, strict process and a large amount of good documentation, the project will succeed.

How do the new fork/join tasks provided by Java SE 7 make it easier to write parallel programs?

Multicore processors are now widespread across server, desktop, and laptop hardware. They are also making their way into smaller devices, such as smartphones and tablets. They open new possibilities for concurrent programming because the threads of a process can be executed on several cores in parallel. One important technique for achieving
maximal performance in applications is the ability to split intensive tasks into chunks that can be performed in parallel to maximize the use of computational power. Dealing with concurrent (parallel) programming has traditionally been difficult, because you have to deal with thread synchronization and the pitfalls of shared data. Interest in language-level support for concurrent programming on the Java platform is strong, as proven by the efforts in the Groovy (GPars), Scala, and Clojure communities. These communities all try to provide comprehensive programming models and efficient implementations that mask the pain points associated with multithreaded and distributed applications. The Java language itself should not be considered inferior in this regard. Java Platform, Standard Edition (Java SE) 5 and then Java SE 6 introduced a set of packages providing powerful concurrency building blocks. Java SE 7 further enhanced them by adding support for parallelism.


Les principes SOLID
A l'heure où de nombreux débats font rages sur l'éventuel successeur du langage Java, le XKE (Xebia Knowledge Exchange) de Mars a été l'occasion de faire un retour sur les fondamentaux de la conception Orienté Objet.
Faisons un petit sondage dans la communauté : quels arguments avanceriez-vous en faveur du langage Java ?
Parmi les principaux arguments, il est fort à parier que les réponses seront en majorité les applets (heu… non plus maintenant… mais souvenez vous dans les années 90), la JVM, le crossplatform, le monde Open Source et la Communauté, les nombreux frameworks, la simplicité d'écriture et la gestion de la mémoire, les IDEs, etc.


A beginners guide to Dependency Injection
This article presents a high level overview of Dependency Injection (DI). It aims to present the overall  concept of Dependency Injection to the junior developer within the context of how it could be used in a  variety of DI containers.

Dependency Injection (DI) or Inversion of Control (IOC) ?


OSGi: A Proven Approach for Developing Modular Applications
OSGi is about how to create a useful application by installing a set of (preferably reusable) modules in a framework. Basically, we set out in 1998 to solve the component programming model; amazingly I think we largely succeeded looking at the many successful OSGi projects. Mission accomplished?
comment on this article Not really, looking at the often heated debate around OSGi in the Enterprise world: Spring, Jigsaw, etc.
Many love it, some seem to hate it with a vengeance (Come on guys, get a life, this is only technology). My explanation is that OSGi violates some Enterprise developers' basic expectations that it should just be a library on your class path, providing some useful and convenient functions but otherwise staying out of the way.


Low GC in Java: Use primitives instead of wrappers
There are two good reason to use primitives instead of wrappers where possible. Clarity. By using a primitive, you are making it clear that a null value is not appropriate.
Performance. Using primitives is often much faster. Clarity is often more important than performance, and is the best reason to use them. However, this article discussed the performance implications of using wrappers.


Breaking Dependency Cycles
If you look into rules for good software design you!ll probably come around the notion that dependency circles are bad. From my interview experience I!d say that many of the more experienced developers know that rule. And almost everybody agrees to that rule when asked. (Of course that might be due to the way I phrase the question. Some people say I can be pretty … convincing).


Stringifying Java Arrays
J2SE 5 provided significant new language features that made Java significantly
easier to use and more expressive than it had ever been. Although "big" new J2SE 5  features such as enums, generics, and annotations, there was a plethora of new APIs and methods that have made our lives easier ever since. In this post, I briefly look at two of my favorites when dealing with Java arrays:
the Arrays.toString(Object[]) method and the Arrays.deepToString(Object[]) method.

vendredi 8 juillet 2011

Veille technologique semaine 27 et 28

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.