Tuesday, October 13, 2009

Hit the road Jack

Now that I am done with my what took a lot of my time recently, I will be on the road for pretty much the whole month of november all over Europe to spread the word.

First and foremost, I will inaugurate the new MarsJUG (in Marseille) on October 15th. I will be talking about Hibernate Search and how to implement clever full-text search engines using approximations (phonetic approximation etc).

I will also be speaking in Munich at the W-JAX conference on November 10th and 11th. This time I will cover:

  • Bean Validation (JSR-303) and Hibernate Validator 4 (just released)
  • What's new in Java Persistence 2.0. I will spend a good chunk of it to explain the new type-safe Criteria API
  • Hibernate Search and how to do full-text searches with Hibernate-based applications

Next in line is Devoxx where I will give a university talk on Hibernate Search. If you want to know everything about Hibernate Search, this is the time! This is November 17th in the afternoon. This is an interesting format (3 hours), where i will cover a bunch of what is in my book Hibernate Search in Action and do a handful of demonstrations.

Last but not least, I will be speaking at JavaEdge '09 on November 16th in Israel. This time about Bean Validation and Hibernate 4.

If you come by these cities at the right time, come and join me! Between one of these conferences is my birthday :o)

Edit: I forgot that I will be speaking at the ParisJUG on December 8th about Bean Validation. Right after a healthy debate on Spring vs EE 6 (I heard that extra medics and blood supply have been planned)

Thursday, September 24, 2009

JBoss Community Asylum - a new podcast with bits of me in it

Remember my French podcast Les Cast Codeurs? (Doing well, thank you for asking) Well apparently, I did not have enough and started a new one. In English this time.

JBoss Community Asylum. A podcast on, by and about the JBoss Community and its gazilllllllion projects and ideas. It's available here and the iTunes link is here. Basically, instead of blaming people about the lack of podcasts on the great tech at jboss.org, Max R. Andersen (JBoss Tools), Michael Neale (Drools + cloud thingies) and me have decided to give it a shot. You will get the latest news on from the JBoss sphere and we will likely interview folks about their projects.

Let us know what you think and how you would like it to evolve. It's a low-key bottom-up approach so anything's possible.

PS: I made progress, I am not the sound engineer this time, yeah!

Monday, August 10, 2009

Book review: Dependency Injection by Dhanji Prasanna

Over the last few days, I have been reading Dependency Injection by Dhanji Prasanna published by Manning. I must admit, this is a much easier task than writing Hibernate Search in Action ;)

Summary first: very easy to read, a gold mine of knowledge and tips on a subject that is essential to the life of today's Java developers. Go buy it and keep it around your desk.

Let's quickly talk about the book structure. The book walks you gently through the DI (Dependency Injection) subject:

  • why do you need DI, what does it solves concretely in application developments
  • what is injection, what are the main concepts
  • using DI to improve application modularity
  • object scoping and how to approach that with DI solutions
  • best practices learnt with tears and blood
  • and a small concrete application showing how to use Guice as your DI container

If you are a beginner, this book will explain to you how and why using DI. If you are an expert and use DI on a daily basis, this book will help you rethink what you have taken for granted in DI-land and learn a handful of new tricks and design patterns.

I consider DI and the notion of scope (aka context) to be an essential knowledge to any Java developers. This will become even more pressing with the soon arrival of JSR-330 (Dependency Injection for Java) and JSR-299 (Context and Dependency Injection for the EE platform aka Web Beans) and their inclusion in Java EE 6.

Just like you had to learn polymorphism, you need to learn DI and context management as this is an essential tool for proper component design and application modularization.

The only gotcha is that this book comes right before the finalization of the two JSRs and hence does not cover them. Don't be too afraid though, all the core concepts covered by these specifications are thoroughly explained in this book. The problem / solution approach used by Dhanji will perfectly complement your knowledge of the DI JSRs.

My advice is to keep this book on your desk when you develop (next to Hibernate Search in Action mine of course ;) ), you will save yourself the burden of learning the best design approaches the hard way.

Tuesday, July 7, 2009

Lies, damned lies, and statistics: EE edition

I came across some figures regarding downloads of Glassfish and JBoss AS that really puzzled me. Basically Glassfish was downloaded 700.000 times a month (end of '08) while JBoss AS was only downloaded around 115.000 times a month at the same. My first reaction was "Well done to you, Sun!" and then I realized that the gap was too good to be true. Let's have a look at these numbers.

For JBoss AS, the Sun team has only counted the direct number of downloads out of SourceForge. That's public knowledge by the way, go there for the JBoss stats.

For Glassfish (according to this), downloads numbers (not public BTW) come from:

Surprisingly, no stats on the direct number of downloads from the Glassfish project page. Let's analyze that a bit.

JDK bundles is the thing downloaded even by my grand'ma by accident. I can tell you right there, she has never ever used Glassfish ( nor JBoss ;) ). How many times, did I download the whole enchilada while I just wanted the plain old JDK!

Java EE SDK. This one is hard. Of course, people interested in EE will go download this package. Are they interested in GF? Hard to say. On the other hand providing a SDK without runtime will do no good.

NetBeans. I'm surprised at the popularity of NB, but there it is. Are all NB users actually GF users? BTW NB also comes with a JDK bundle but I don't know if this bundle also bundle GF :)

Let's call this strategy the Russian doll statistic generation strategy. Frankly, that's not very honest for your users and customers to use this strategy and then compare apple to oranges with your competition. When someone downloads JBoss AS, for sure he did not do it by accident (thanks to SourceForce's sense of UI :) )

So we have two strategies here, JBoss could start playing the Russian doll statistics generation strategy and we can be pretty good at it:

  • include JBoss AS in Fedora and count it
  • include JBoss AS in RHEL and count it (Dell, IBM and the like are pretty good at delivering RHEL on their hardware)
  • include JBoss AS in IcedTea and count it
  • include JBoss AS in JBoss Tools and count it
  • include JBoss AS Core in JBoss ESB, Portal etc etc and count it
  • include the number of downloads from our maven repository (with the number of times you have to nuke your local repo that will be a big hit :) )
  • I've only added a few ideas but for sure our marketing guys can be more productive

Of course we won't do that. An alternative strategy would be for the Glassfish team to only display their direct download numbers (the one they fail to display) and stop using bogus charts in their public and private slides.

On a side note, I find it disappointing that open source projects don't keep their stats open and preferably via a third party provider like SourceForge. Granted the SF stats are somewhat flaky but it keeps everyone honest with their own (lack of) success.

Disclaimer: I am not saying Glassfish is not a success, I am quite happy to have them as coopetitors on the server market in general and Java EE in particular.

Monday, June 22, 2009

Having problems with Adium and Yahoo IM?

Yahoo has changed its login protocol, breaking a number of third party IM clients including Adium.

The Adium team has released 1.3.5.rc1 which solves the issue. Check it out. If you use Adium 1.4 beta, upgrade to beta7.

Hope this will save you some time.

Thursday, April 30, 2009

Java generics end of mystery

Remember my puzzlement in front of http://blog.emmanuelbernard.com/2009/04/java-generics-mystery.html?

I usually try to make sense of the unknown type by looking at what should be allowed when two incompatible types are used as the unknown type, and then using the generic type using the unknown type as a reference to a known type to see what incorrect things can be done through the reference. If the assignment your questioning was allowed, you would be able to add two incompatible ConstraintValidators to the validatedAddresses as in:

class Address {}
class Person {}

// A set of ConstraintValidator for Address
Set<ConstraintValidator<Address>> validatedAddresses =
    new HashSet<ConstraintValidator<Address>>();

// A set of ConstraintValidator of a single unknown type (*)
Set<ConstraintValidator<?>> validatedThings = validatedAddresses;

ConstraintValidator<Address> a;
ConstraintValidator<Person> p;

// A ConstraintValidator of unknown type, ? = Address
ConstraintValidator<?> thingA = a;

// A ConstraintValidator of unknown type, ? = Person
ConstraintValidator<?> thingP = p;

// This would be allowed if (*) was a valid assignment, which puts a ConstraintValidator<Person> in a set of ConstraintValidator<Address>

validatedThings.add(thingP);


What I missed initially is that I cannot add new (and potentially heterogeneous) elements in Set<?> or Set<? extends X>, but I am free to add elements in Set<X<?>>:


Set<A<?>> c1 = new HashSet<A<?>>();
c1.add( new A<B>() );
c1.add( new A<C>() );

Set<? extends A<?>> c1 = new HashSet<A<?>>();
c1.add( new A<B>() ); <-- compilation error
c1.add( new A<C>() ); <-- compilation error

While the first example compiles, the second does not.

So to answer my initial mystery, I need to use the <? extends X<?>> approach (thanks Vivien for pointing that out).

Set<? extends ConstraintValidator<?>> valiatedThings = ...;

Wednesday, April 29, 2009

Java generics mystery

Here is a puzzle for Generics gurus.

Can somebody explain why

Set<Address> addresses = new HashSet<Address>();
Set<?> things = addresses;

compiles but

Set<ConstraintValidator<Address>> validatedAddresses = 
    new HashSet<ConstraintValidator<Address>>();
Set<ConstraintValidator<?>> validatedThings =
    validatedAddresses;

does not compile?

More specifically, the assignment on the second line breaks.

Monday, April 20, 2009

Oracle is buying Sun: best quotes of the day

Alex Miller: "Next version of Java will be Java SE 7.0.0.0.17832"

Emmanuel Bernard: "The day an Oracle swallows the Sun and in front the Business Machine. No kidding it's a Titans fight."

Max Andersen: Thinking when Orsun will introduce a String in Java that says null == ""

Alexis MP: "Checking my blog posts tagged with "oracle". No need to MarcF' them ;)"

Bruno Georges: "yes, this came out of the Blue :-)"

Stomp Rasta: "There'll have Java SE 7 Lite (300 MB) and Java SE 7 Full (600 MB). And we'll have to pay for each VM installed."

Add your own...

Tuesday, April 14, 2009

Les Cast Codeurs Podcast is born

I have just started a new podcast with a few French open source activists. All about Java, all in French. If you know French, read on ; otherwise, well... learn :)

Les Cast Codeurs Podcast est dans les bacs!

Le podcast en français dans le code sur Java par Emmanuel Bernard (JBoss, Hibernate), Guillaume Laforge (SpringSource, Groovy), Antonio Goncalves (freelance, auteur), Vincent Massol (XWiki, Maven).

Restez informés sur les sujets brûlants de l'industrie Java. Plongez sur un sujet précis avec l'interview de l'épisode. Supportez les radotages de vos hôtes.

Ecoutez-nous et faites passer le message autour de vous !

web: http://lescastcodeurs.com
itunes: http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=312239675
podcast syndication: http://lescastcodeurs.com/podcast-rss
blog feed: http://lescastcodeurs.com/feed/
feedback: commentaire@lescastcodeurs.com

Friday, April 3, 2009

Podcast on Bean Validation lastest PFD

I have recently been interviewed by Kenneth Rimple for the Chariot TechCast.

In this podcast, we speak to JBoss's Emmanuel Bernard on the future of validation using JSR-303, the Bean Validation framework. JSR-303 aims to provide an annotation-driven mechanism to mark plain old java beans with annotations, such as @NotNull, @Min, @Max, and can support custom validation annotations as well.

JSR-303 is part of the Java EE 6 suite of JSRs and will be used automatically out of the box by frameworks such as JSF 2.0. Emmanuel also goes into some detail about the current state of Hibernate Search.

You can listen to it here or register to iTunes.

Monday, February 2, 2009

Go us

I am usually not the kind of person that likes patting one another on the back. I am always prompt to point out what's left to be done rather that what has been done. But reading Sacha's newsletter to our customer made me proud.

JBoss AS 5 has had record downloads. People were eager to get AS 5 out, so were we.

A fully TCK compliant OpenJDK based Java SE 6 made it into Red Hat Enterprise Linux 5.3. As far as I know, this is the first fully Open Source Java SE implementation certified against the TCK (might be wrong, so don't quote me on that).

JSR 299 (ex Web Beans, newly named Java Contexts and Dependency Injection) is now in its latest public draft review. Gavin and the EG have worked *very* hard to address the EE 6 expert group concerns and pave the road to include this technology in Java EE 6.

The JSR-299 reference implementation is in pretty good shape and releases steadily. I am personally impressed by the quality of the reference guide (alpha 2 here).

RESTEasy, the JBoss JAX-RS implementation is now fully certified and has reached 1.0. I know Bill Burke has been waiting to grab and pass the TCK for a long time.

Bean Validation public draft is out. I also worked very hard too, damn it! ;) We had a lot of positive feedbacks from you guys in our forum. If you want to look at the cutting edge, I release spec snapshots quite regularly on the hibernate-dev mailing list. The latest work includes finalized JPA and JSF integration, type-safe constraint validators, XML support and clearer names.

Also the reference implementation is developped in the open. We hope to get a first milestone release this week or the next one: we did add cool new features you requested in the spec recently (like type-safe validators) and we want to have them in the RI.

A little while ago, Navin released JBoss Cache Searchable 1.0 GA which is based on Hibernate Search. Good stuff: a full-text searchable distributed object cache.

A cool project named JBoss Negociation brings desktop Single Sign On to web apps. Basically, by login to your Windows 2000/XP machine that is secured by an Active Directory and then go to any of the kerberos aware web applications that are hosted by your company in the network, you will have seamless SSO. Their latest GA is here.

That's just my selection of January news. Who said JBoss was sleeping ;) Alright, enough self congratulation and back to work.

Monday, January 26, 2009

JBUG Munich: Java Persistence 2 and Bean Validation

Next week, I will be at the JBug in Munich presenting Java Persistence 2 and Bean Validation. If you are around Monday 2nd, come swing by. The JBug Munich website is here for details.

Saturday, January 24, 2009

DevNexus: human friendly conference March 10-11 in Atlanta

I will be speaking at DevNexus. This small conference is a spin off the Atlanta Java User Group.

Here are a few things I like about the conference personally:

  • There is around 10 presentations over two days, so you will be able to see all / most of them.
  • The price is very reasonable ($150 for early birds), $185 regular price.
  • The size is reasonable, so interacting with speakers is natural.
  • Atlanta in March is very nice.
  • ahem, I will be speaking there, ahem.

I will personally speak about our experience in scaling Hibernate in big environments and how SaaS vendors can face the challenge. I will also discuss Hibernate Shards and Hibernate Search with regard to scalability. And there are nine other speakers at the conference, so check their website.

Thursday, January 15, 2009

How to install Git and git-svn on Mac OS X

It's hard to find good Google links for installing git-svn on Mac OS X. Here is my piece.

  • Install port: download it at http://darwinports.com and run the installer
  • run sudo port install subversion-perlbindings (it takes a while as the installer download the internet)
  • run sudo port install git-core +svn (don't forget +svn or you will have to uninstall git-core and reinstall it)
You are ready to use git svn command. git-svn does not work but git svn does: that's because git-svn is not in your PATH. If you want to make git-svn work, add /opt/local/libexex/git-core to it (thanks Randall for the tip).

From there, have a look at http://viget.com/extend/effectively-using-git-with-subversion for a quick tutorial.