Templates Including Other Templates In Groovy

I need to use templates to generate all sorts of things (java classes, xml and property files...), I have enough of Velocity and I love Groovy. Three good reasons to use Groovy Templates.

Groovy Templates come with different flavours :

  • SimpleTemplateEngine – for basic templates
  • GStringTemplateEngine – stores the template as writable closures (useful for streaming scenarios)
  • XmlTemplateEngine – works well when the template and output are valid XML
For ...

Back From The TSS Symposium In Prague

Last Wednesday I‘ve landed at noon in Prague, quickly took a taxi, arrived at the Clarion Congress Hotel where the conference well held, registered, went to my room and had a quick last look at my slides.

2008tss1.jpg

At 3:50pm I was giving a talk on Building Enterprise Applications Using Glassfish . It was about installing GlassFish, deploying an application, monitor and configure resources as well as creating a cluster. It‘s amazing how the GlassFish team made it easy ...

Primary And Secondary Table With JPA

It‘s the third time I‘ve been asked if in JPA you can persist the attributes of your entity in several tables. The answer is yes. It has a performance impact (each simple query will use joins) but it can be very helpful when you need to map your objects into an existing database.

Here is an example of an Address entity that persist its data into a primary table (t_address) as well as two secondary tables (t_city and t_country). The primary table can be customized with the Table annotation and the secondary with SecondaryTable or SecondaryTables (with an 's') if more than one. Then it's just a matter of explicitly using the Column annotation on the attributes you want to persist in the secondary tables ...

Speaking At The TSS Symposium

Soon (18–20 June) starts the TSS Symposium conference in Prague. A great conference with good speakers in a beautiful city. Well, this time I‘ll be speaking there. In fact, I‘ll be giving two talks :

ImSpeakingatTSSJS.gif

Building Enterprise Applications Using Glassfish . I‘ll talk about administrating GlassFish instances in general and in a cluster in particular. In this session, you will learn how to deploy Web and enterprise applications in different configurations and ...

A Virus At JavaOne

Today I only attended two presentations and had to leave the conference for some rest. I wonder if I‘m just exhausted about too much JavaOne, or if I‘ve got a virus. This is the email that we received this morning :

URGENT PUBLIC HEALTH ADVISORY FROM JAVAONE TEAM

The JavaOne conference team has been notified by the San Francisco Department of Public Health about an identified outbreak of a virus in the San Francisco area. Testing is still underway to identify the specific virus in question, but they believe it to be the Norovirus, a common cause of the stomach flu, which can cause temporary flu-like symptoms for up to 48 hours. Part of the San Francisco area impacted includes the Moscone Center, ...

JavaOne : A Nostalgic Portuguese Touch

It is my first JavaOne, so I can‘t really compare. But something tells me that 5 years ago JavaOne was about… Java. Today, it feels different. There are plenty of technical sessions about other languages and on the top selling books at JavaOne, three are about other languages (Groovy and JavaFX). Even James Gosling talked about Scala . And I have to be honest. JavaOne is a great place for many different reasons (networking, meeting good old friends, having fun, exchanging experiences...) but I haven't been astonished by any session. The only technical novelty was… ...

JavaOne : Opening Up The JCP

Today was an interesting day at JavaOne. I first started meeting a giant Duke in the busy corridors of the Moscone Center

2008sf10.jpg

Then I met Aaron Houston (the Sun guy who helps the JUGs around the world) who gave the Paris JUG a Sun Spot . The idea is to use the spot in a collaborative way so the JUG can develop any kind of application with. Aaron, you are a champion ;o)

2008sf11.jpg...

JavaOne : My Top 3 Issues

Today it was JavaOne‘s kick off. It started with a keynote with Rich Green. It was concentrated in mobile devices (Amazon presented its Kindle eBook) and, of course, JavaFX took a big place. I‘m still a bit sceptical about JavaFX but Rich Green said that really soon it will be running everywhere, in all kind of mobile devices.

And then came Neil Young. He talked about wht he has archived with BlueRay discs… and of course Java. It was funny to see Neil Young talking to Rich Green and Jonathan Swartz.

2008sf07.jpg

I then ...

Community One

Today was the Community One. Not exactly JavaOne yet, free of charge, and mostly based on communities. The idea is to bring different communities on board such as JUGs, GlassFish, Open Solaris, Linux, NetBeans and so on.

Community One is also based at the Moscone Center and feels sometimes like a warm up for JavaOne. You see geeks everywhere playing video games lying on the floor, geeks blogging on their iMac, geeks carrying a laptop in one hand and a beer on the other, geeks, geeks, geeks… and Wonder Women too.

2008sf04.jpg

I mostly attended the ...

From The Golden Gate To GlassFish

Yesterday morning I met Alexis Moussine Pouchkine near the Peer 45 in San Francisco. He had organized a bike tour before the GlassFish unconferences. We were a group of 10 people, ready to cycle through the Golden Gate bridge. Met at 9:30am, had a coffee, put the helmet on and off we went. The weather wasn‘t very clear and it got a bit windy. After few hills we finally arrived on top of the bridge. We cycled on the lane and crossed the bridge under some wind. But it was ok. Quite impressive to cross the Golden Gate really.

2008sf01.jpg

We ended up on the other side at Sausalito were we had lunch ...

Speaking At JavaOne

As a young JUG Leader I've been invited by Sun to JavaOne (thanks to Aaron Houston). It‘s my first time at JavaOne so I‘m very excited to attend conferences, BOFs and plenty of organized diners or unconferences. It‘s going to be a busy week, but I‘m ready (I arrived yesterday in San Francisco and already had a good night sleep to recover the 12 hours flight and 9 hours difference with Paris).

I came here to grab as much information as I can (on Java and JUGs) and take it back home. But, surprisingly, I‘ve just been asked by Corina Ulescu (JCP PMO) to talk about the JCP. I bit like what I did at the ...

English Review Of A Java EE 5 French Book

French libraries are full of English books. French blogs are full of comments on English books. Technical French website are full of reviews of English books. But the opposite is not true and doesn‘t happen very often, that‘s why I‘m mentioning it.

Few months ago I‘ve been contacted by Meera Subbarao who is the team leader for the JavaLobby/DZone book review team. She wanted to know a bit more about my book on Java EE 5. She got really interested and then quickly, very disappointed : my book is written in French !

That‘s when ...

Google Gears In Action

Google Gears is an open source browser extension that enables web applications to provide offline functionality. For those of you who, like me, haven't played with the API, there is an easy way to just use it and see it in action : Google Reader. If you use Google Reader to read your feeds and want to read them offline (while you are in the train for example), you can. In Google Reader there is a link in the upper menu called Offline When you click on it a pop up will show up proposing you to install Google Gears (in Beta version, but well, that‘s Google, we‘re used to it). Click yes, download an installer and execute it.

...

Back From QCon

Second conference in London in less that 6 months (Grails Exchange in October). It‘s always good to be back in London (where I lived for 2 years) except for public transport (Circle Line wasn‘t working on Thursday… again). The conference is held at the Queen Elisabeth just facing the Westminster Abbey. Very nice to look at during the breaks.

qcon1.jpg

I‘ve been invited to talk at a BoF aroud JCP. Thanks to Aaron Houston, Floyd Marinescu and Patrick Curran. The conference started last Monday but I could only arrive on Thursday. I only had two days at the conference and I have to say, ...

Talking At QCon In London

Thursday the 13th of March I‘ll be talking at the QCon in London. The title of this BoF is Insider's tips for developing a successful API for Java. I'll be around the table with Werner Keil (Spec lead of JSR 275 - Units Specification), Rod Johnson (the father of Spring) and Patrick Curran (Chair of the JCP). We all have in common to be part of the JCP (Chair, Spec Leads or Expert Group members).

This BOF will discuss what it takes to develop ...

Paris JUG Inauguration

Everything you want to know about the inauguration of the Paris JUG.

Why Are We Not Using Java EE 5 (Bis Repetita) ?

A few days ago I‘ve blogged about Why are we not using Java EE 5? This post had a few comments. I've then been contacted by Matthew Schmidt from DZone asking me if they could reproduce the post and let people add more comments on it.

So, to keep on talking about this topic, go to Java DZone.

By the way, talking about confusion, I‘ve found this really interesting article called Is ...

Why Are We Not Using Java EE 5 ?

Believe it or not, in a few months the Java EE 5 specification will be two years old (Final Release on the 11 May, 2006). And nobody is using it.

We have all read about how easier the development model is in Java EE 5 compared to J2EE 1.4. Complexity reduced, less XML file descriptors, less code, injection and so on. Despite all these good things, Java EE 5 projects are not taking off. Here are some reasons why :

Java EE 5 is a rupture more than a continuity. J2EE 1.4 and Java EE ...

Java EE 5 Book Used In Universities

I‘ve been teaching Java EE at a Parisian university (Cnam) for 6 years now. When I decided to write a book about Java EE 5, I took some inspiration from what I was doing at university. Thanks to these 6 years, I‘ve developed pedagogic skills in the way of teaching Java EE. That‘s also what I‘ve done with my book.

Since it‘s publication, I‘ve received a few emails from different universities in France (and Switzerland) who are using my book now to teach Java EE 5. I had some very nice feedback from these teachers who have created new classes based on my book. I‘m really happy about that.

Below is a photo sent by Thomas ...

The City Of Paris Interested In The Paris JUG

Last week I met James Gosling, today I met the Mayor of Paris‘ 11th district.

Everybody has their own political opinions and views on social policy and the workplace. I have mine too. I‘m passionate about Java, I like sharing my knowledge and creating networks, and of course making some money… but in a respectful way. I‘m a self-employed entrepreneur, working co-operatively with an organisation called Port Parallele. In French we‘d called it a co-operative, the emphasis on co-operation.

Port Parallele had a special event today at which their networks of ...

My New Best Friend From JavaPolis : James Gosling

During the JUG leaders diner at JavaPolis I made a new friend : James Gosling . No, I'm not trying to explain him any rocket science stuff where he needs to scratch his head. We didn't talk Java actually. I mentioned that I was creating a Java User Group in France (did you see my t-shirt) and we started to talk about his level of French. James did 9 years of French at school. He always says that he doesn‘t know how to speak it but he could say a few sentences without too many mistakes actually. Thanks for this photo Aaron.

jp071.jpg

Another one of James ...

First Evening At JavaPolis

The first very good news of JavaPolis is that since the 9th of december, the Thalys train (from Paris to Antwerp) stops at the central train station, in the heart of the city. Before, the station was quite far from the city. I arrived with David at 5:30pm, we quickly ran to the hotel to checkin, and then we took a taxi to JavaPolis. There we met the JUG Leaders and off we went to a brewery in the town center.

The idea of this diner was to have JUG leaders (and speakers) in the same room to exchange. And that‘s what I did. I talked to a lot of people (some I don‘t even know their names, sorry) about running a Java User Group. Bruno Bussola from JUG ...

My JavaPolis Agenda

JavaPolis will start next week and I have to decide which conference to go to.

Tuesday evening 11th

I‘ll be arriving in Antwerp on Tuesday afternoon to attend the JUG leader diner that starts at 8pm. I'm quite excited about this event because it‘s a fantastic oportunity to meet other JUG leaders and talk about Java User Groups in general. There will also be some speakers, so it should be fun to share a meal with some big name of the Java industry. I‘ll try to take some photos.

Wednesday the 12th

9:30 : Keynotes of ...

Choosing A Portal

As I was saying a few days ago, choosing a portal is a difficult task : many specifications and many implementations. We've decided to broad our choices to any kind of portal (open source and commercial) and ended up with an impressive list (in alphabetic order): Apache Pluto, ByLine, Exo Portal, GridSphere, IPoint Portal, ...

Is It The Right Time To Choose A Portal ?

In IT, it‘s never the right time to choose a software. Either a technology is too old, or it‘s too new or it‘s still in beta. But I think that November 2007 is a critical time to choose a portal platform.

I‘m not an expert on portal (as a former BEA employee I‘ve used Weblogic Portal but that was many years ago and things have changed) and I've been asked to short-list portal implementations. The first issue I have is with the version of the spec that the portal should implement. "JSR 168": http://www.jcp.org/en/jsr/detail?id=168 (Portlet V1.0) has been released in October 2003 and most of the portals implement it. ...

Paris JUG

I‘ve been thinking about creating a Java User Group in Paris (France) for a long long time. That‘s done now !!! Well, just the first steps :

  • I‘ve created a JUG project at dev.java.net (the project is still pending)
  • Mailing list at users@parisjug.dev.java.net
  • Bought the parisjug.org domain name
  • Looking for a meeting room (either at the Cnam university or with a partnership that I have with the Port Parallelecooperation)
  • I‘m having ...

    3rd And Last Day At Grails Exchange

    Well, this morning I managed to arrive on time and have my first breakfast at the conference. Thanks to the train driver, thanks to the London tube, thanks to the people on the platform who let me in the train, thanks to God when it comes to arriving on time with London public transports.

    So, today is the last day of what has been a very good experience of this Grails Exchange. I've started with The Whole 9 Yards: Things you can do in 10 minutes that will make users love you by Glen Smith. When I read the title I thought that was the place to be this morning. The place to be loved by your customers. Glen is the Australian guy behind the ...

    2nd Day At Grails Exchange

    Well, first of all, I really have to beach about public transports in London. Yesterday the Central line wasn‘t working and today the Northern line had severe delays. It took me 1:30 hour to go from south London (Balham) to the conference hall (the Barbican Center). I love London, it‘s a fantastic city and I really enjoyed leaving here for 2 years. But each time I come back for business (not for holidays where I can just wonder around) I remember why I left this city and went back to Paris : on a day to day basis, London is a really tough place to live in. Well, I suppose some people would say the same about Paris though…

    Enough beaching. Second day at the Grails ...

    1st Day At Grails Exchange

    Here I am in London attending my first day at the Grails Exchange. Unfortunately I missed the keynote from Guillaume LaForge and Graeme Rocher this morning because I took a late train from Paris. Not because I wanted to sleep more, but I just managed to enrol yesterday afternoon (thanks to Guillaume for his help on that). Difficult to find an earlier train with such a short notice.

    The conference is held at the Barbican center in London. Good memories come back to me when I was living in London and coming here to listen to weird concerts. I arrived at the conference at 1pm, just in time for lunch. The atmosphere is pretty good. The food great. A fantastic indoor garden ...

    I Just Blog To Say I Love Idea

    The other day I was presenting Java EE 5 to a customer‘s team. There was a guy who had read my book and at the end of the presentation asked me : "You are involved with open source, how come in your book you use Intellij Idea and not Eclipse or Netbeans ? Is it because JetBrains gave you a license ?”.

    Indeed. When I started writing my book I asked JetBrains and Visual Paradigm if they would offer me a licence. And they both did. But, I‘ll say it again out loud : I LOVE INTELLIJ IDEA !!! I‘ve been using this IDE for 6 years now ...

    J2EE, Java EE, Java SE… The Marketing Is Not Ready

    Looking for a contract in Java EE ? You will not find any. What about J2EE ? Yes but, be careful, only with Java 5, not Java 1.4. What ? You are only using Java EE 5, we already use the 6 version…

    For techies, things are getting clearer. We know that there is a EE, SE and even ME edition of Java. We also know that the versionning of these platforms are not the same, and it doesn‘t really matter (EE 5 works with SE 6). So a sentence like “Java EE 5 project using Java SE 5” makes sense for us. But not for the marketing. When a company wants to advertise a job about ...

    Waiting For Firefox 3

    In his blog Firefox memory usage and memory leak news Jesse Ruderman talks about memory usage and fix memory leak bugs in Firefox 3. For people who know Marmite I've been feeling the same with Firefox for the last years (I even used Opera for a long time). I love it for its plugins and extensibility, I hate it for memory and CPU usage (I have to restart Firefox 4/5 times a day). And funny enough, lots of my friends and colleague feel the same. I suppose we stick to Firefox because we don‘t want to go back to IE.

    Hope I won‘t have this problem any more with ...

    Configure Your EJB 3 With Envirnoment Entries Using ENC

    Very often you can read ” xml descriptors are dead with EJB 3 ". Well, it's not exactly true. XML descriptors are not dead, they are optional (thank god). But there is still a very good and legitimate use for them when you want to configure an EJB. When you have an attribute in an EJB which value can change at deployment, you don't want to change your code, recompile it, package it and redeploy the EJB. No, you just want to change an XML file (ejb-jar.xml), package it with your classes and deploy the EJB. So, how do we do that with EJB 3 ? Still using ENC ( environment namming context also sometimes called enterprise namming context ) but in a much easier way.

    ENC has been around since ...

    XWiki Tutorial

    More and more customers are using wikis for collaborative work… and universities too. At the Cnam, where I teach, we felt the need of using a wiki. Our department installed MediaWiki last year but the administrator didn‘t set up the rights properly so it was a real nightmare for teachers to have access to the right resources. A couple of month later, nobody was using MediaWiki anymore.

    I then had a look at other different wikis and found XWiki. It's really good for exactly what we want : a fine use of groups, users and access rights. To get use to it I've used XWiki for my personal web ...

    Container Managed Transaction, EJB 3 And Exceptions

    Let's face it. Exceptions in Java have always been a nightmare because we've never known how to handle them properly. Hundreads of articles and thousands of blogs have tried to help us on "how to use exceptions in Java". We went from "all exception should be checked" to "all shoud be unchecked" and then to "business exception should be checked and technical exceptions unchecked", "each layer should wrap the parent exception", "just throw it to the client"… ...

    Container Managed Transaction - Mind The Interface

    We've been using EJBs for a long time now and, thanks to Java EE 5, it's today even easier to do so. What happens when you are comfortable with something ? You forget the basics. And the basics are, J2EE 1.4 or Java EE 5, an EJB runs inside a container. This container can do a lot for you, transactions for example, but you have to make sure you use the container. Let give me an example of a common mistake.

    Imagine that you have two Stateless EJBs, each one persisting an object. To make it simple I'll call them ABean (persists a A object) and BBean (persists a B object). Here is how it works :

    1 - The ABean.createsA() method starts a ...

    Intellij Idea Is Really Groovy

    I've been an Intellij Idea follower for more than 5 years now. I've never really made the move to Eclipse, unless I really have to on rare occasions. Here is another example of how good Idea is. I've been developing a little bit with Groovy and recently with Grails. I was sad not to see any Groovy features in the IDE, but things have changed. I read Guillaume Laforge's blog about Groovy 1.1 beta and that Intellij had made some progress. Then I read Graeme Rocher's Blog about how to install the Groovy plugin. I followed his instructions and look what I get ...

    Signing Copies Of My Book

    Saturday the 30th of June I'll be at the Parisian library Le Monde en Tique signing copies of my book from 3:30pm to 6pm. Thanks to Jean Demetreau for organizing this event. So, if you want to have a drink, talk about Java EE 5 and even buy a book and get it signed, it's the right moment, at the right place (the library is really nice and you can even see Notre ...

    Java EE 5 Book Chat

    Next Tuesday from 5pm to 6pm French time, the Journal Du Net is organizing a chat (in French) about the Java EE 5 book I wrote. I'll be on the other side of the computer answering questions about the content of the book but also Java EE 5 in general. You just have to enroll and be ready on Tuesday afternoon.

    See you ...

    Java EE 5 Book Is Out

    Just to let you know that the book I wrote about Java EE 5 is out. I've blogged before about its content and I've also written a presentaion on my web site. The book helps expert Java developers to write an e-commerce website with the lastest Java EE 5 specifications (EJB 3, JPA, JSF, JSP, JMS, JavaMail) running on GlassFish and Derby. The book is written in french but english speaker can also download the code of the application and follow the ...

    Java EE Version History: Help Needed !!!

    I was trying to do a study about the evolution of Java in terms of the langage (how many versions, how many APIs in each version, main features...), its popularity (how many book written in the last 10 years, evolution of the market, job offers in the last 10 years...), its enterprise version (versions of J2EE, how many specifications in each version...)… but I'm giving up. Too difficult. I will spend the next years trying to read articles, compare figures, sort out dates. Java is evolving fine, full stop.

    In my research I found a very good article on Wikipedia about Java version history. Because the same information on JEE was missing I've created a new article called ...

    Article: Generate An XML Document From An Object Model With JAXB 2

    I've just published an article about JAXB 2 on DevX web site. JAXB (Java Architecture for XML Binding) allows you to perform XML-to-Java data binding and generate Java classes from XML schemas and vice-versa. But in this article I mainly focus on marshalling (generate XML from Java objects). You will see how easy it is to generate XML without doing much (thanks to coding by exception). Then, I introduce a set of annotations that enable to customize the XML mapping.

    At the end of the article I make a reference to ...

    Learn Java EE 5 At Sun Tech Day (Paris)

    Just to let you know that I will be presenting my book at the GlassFish Community User Group during the Sun Tech Day in Paris. It will be a quick 15 minutes talk called Learn Java EE 5 on Wednesday the 21th of March around 11 am. I know, 15 minutes is a bit quick to learn Java EE 5, that's why you will have to buy my book (if you read French of course).

    I would like to thank Alexis Moussine-Pouchkine for giving me this opportunity as well as my editor Eyrolles for letting me ...

    Article: Persistence Pays Offs: Advanced Mapping With JPA

    Few weeks ago I blogged about JPA and how I believe it will be the future of ORM. After a first article introducing basic concepts, I wrote a second one for DevX showing how to use JPA to map inheritance, one-to-many, and many-to-many relationships. And also a little bit more of query language (JPQL) to query concrete and abstract ...

    Java Black Belt Will Be At University

    Few weeks ago I've posted about trying Java Black Belt at the University to test the level of our students. We made 40 students take 3 exams (JSP, Servlet and EJB) and got their feedback. Being French students we had some "I didn't understand every questions". We decided not to take that into account because engineering students should have a good technical English understanding. Some students thought the tests were too difficult, some thought they were easy… but all thought it was a good way to know about certifications (some mentioned Sun certifications). With the teachers involved in this test we decided to use Java Black Belt at the beginning of each semesters ...

    Why Is JavaPolis So Cheap (Or Why Are IT Conferences So Expensive) ?

    I've been playing a bit with Groovy and I've attended a Grails presentation done by Guillaume Laforge back in January. I thought it was really good and when he mentioned the Grails conference in London I thought "Let's go! The conference is in May, just during my birthday, I love London, I have plenty of friends there, it would be a good oportunity to know a bit more about Grails, meet people at the conference and have some English and Irish beer" . Recently the registration opened and to my surprise I saw that the first International Grails eXchange 2007 ...

    www.javasoft.com

    I was clearing my old bookmarks and adding them to magnolia when I realized that Java Technology was pointing to www.javasoft.com. A long time ago (1998/1999) that was the link to java.sun.com. So now, if you type www.javasoft.com you'll be automatically redirected to java.sun.com. Even on Wikipedia, if you type JavaSoft you'll be forwarded to Sun Microsystem. There is just ...

    Article: Master The New Persistence Paradigm With JPA

    I have to say, I believe in JPA. Being a former BEA consultant, I used entity beans at a very early stage of the spec and was one of the first to do a prototype of entity beans 2.0 for a customer with a beta version of weblogic (6.0 if I still remember back in 2001). I thought that wasn't very good (to be polite). We had customers doing so many funny things with entity beans that it couldn't be right. The spec was too difficult and customers didn't have a clue to use it the right way. And then Hibernate arrived, and now JPA.

    I believe the JPA spec will be the one in terms of ORM because it's inspired by excellent frameworks such as Hibernate or ...

    Java Black Belt At University

    I'm quite excited. At the CNAM University we've decided to try Java Black Belt with our students. The idea is to use JBB to ensure a minimum level of Java within our students. Thanks to John Rizzo (who I met at JavaPolis) and Gonzague Lefere who've setup a temporary server just for our IT department. Our students will have the week of the 5th of february to pass 3 Java Black Belt exams (JSP, Servlet and EJB). We will then get their feedback to see if we will carry on with Java Black Belt or not. Such a test is quite a novelty for the CNAM University. Usually students have to sit an exam at university. In our case, ...

    Java EE 5 Book - What, When, Who

    As I've posted back in september, the book I've written uses Java EE 5 to develop a good old PetStore-like application. It's written in French and will be published by Eyrolles at the end of March or begining of April. It is part of the Les cahiers du programmeur collection (programmer's book). This collection is quite pragmatic and focuses on a hands-on approach. The books always start with a presentation of the application to develop, and after, chapter by chapter, add functionnalities and technologies. All that is written in two columns : one ...

    I'Ve Been Tagged - Six Things You Don't Know About Me

    Yes, I've been tagged by Matthieu… a long time ago. I should have blogged back a month ago but because of finishing my book I haven't had time to do it. I deserve a penalty for beeing so late. So, here are six things (instead of five) about me that (nearly) nobody knows :

    • Tell me a word and I'll sing you a song. I'm this kind of guy that you have to stop from singing each time you say something. I always find a match between a word and a song (mainly 60's and 70's music)
    • I'm passionate about religions (with an 's'). Beeing a complete atheist makes life easier to read any kind of book about any kind ...

      Java EE 5 Book - The End

      Today I've uploaded all my Open Office files to Eyrolles FTP server. That's it, I've finished writing my book about Java EE 5. I will blog later about its content.

      I just want to thank my team of readers : Matthieu Riou, Alexis Midon, Zouheir Cadi and David Dewalle. Thanks guys, you've been a great help. The book will benefit from your comments and expertise. And sorry for making you work so hard on the last weeks.

      I would also like to thank ...

      JavaPolis 2006 - Back Home

      Well, how to say that in a simple way: JavaPolis 2006 was great. Here are more details.

      Organisation

      First of all, the organisation was amazing. JavaPolis is not organised by Sun, BEA, IBM, Oracle… but by the BeJUG (Belgium Java User Group). Guys like you and me who decided 5 years ago to create such an event that became international and very professional. I've been to many events like that through Europe (sorry, never been to JavaOne in the US) but not of such quality. On top of the quality of the sessions, these guys thought of everything: food, drinks, coffee, cakes, of course, but also free beer on Wednesday night, a ...

      Writing A Book About Java EE 5

      A couple of days ago a friend sent me an email saying that I haven't blogged for few weeks now. The reason is that I'm writing a book about Java EE 5 and it's taking me a lot of time (after work and in the week-ends). The chapters will roughtly be :

      • Presentation of Java EE 5
      • Presentation of the Architecture of the application to develop
      • Java Persistent API
      • Stateless EJB 3.0
      • JNDI an remote access with swing client
      • JSF 1.2 and JSP 2.1 (Unified EL)
      • Stateful EJB
      • JMS and MDB
      • Web Services (with Jaxb 2)

      It's a practical book, not a reference one, so there is only 30/40 pages per chapter with external references to go to. It's aimed at experienced java developpers who have had web ...

      How To Unit Test CRUD Operations

      I like to unit test CRUD (Create, Read, Update, Delete) operations for my domain objects as well as find all. I use the same template again and again, it's quick to do and makes sure that the basic operations work. Here is what I do :

      • A first find all to get all the objects from the database
      • Create an object with random values and persist it into the database
      • Find the created object from the database
      • Make sure it exists
      • Make sure it has the right random values
      • Update the created object with other random values into the database
      • Find the updated object from the database
      • Make sure it still exists
      • Make sure it has the new random values
      • A second find all ...

        HelloWorld With JPA, Hibernate And MySql

        I love Hello Worlds. So when I read the blog HelloWorld with JPA, TopLink and MySql I've quickly copied/pasted the code, downloaded everyhting and made it work. Good. But because I'm more a Hibernate user, I thought, let's give it a try with the same example but using Hibernate EntityManager instead of Toplink.

        So here is the same simple example of standalone java application using Java Persistence API (JPA), Hibernate, and MySql 5. Here is what you have to do :

        • First, download ...

          Article On JUnit 4

          I've published an article about JUnit 4 on DevX : Get Acquainted with the New Advanced Features of JUnit 4. JUnit 4 has changed a lot and it looks like there is much more to come. This article shows you how to migrate from JUnit 3.8 to JUnit 4 and gives you an overview of JUnit 4 new features.

          An article is never written alone. So first of all I would like to thank my wife Denise who read and corrected a boring technical article that she didn't understand a word. Second, Lori Piquet from JupiterMedia for his help and expertise in writing articles. And a special thanks to both my friends Alexis Midon and ...

          Annotations Are Great ! Really ?

          Do you remember 6/7 years ago. EJBs were the big thing and with them came deployment descriptor written in XML. Then Webapp with their web.xml, and then Enterprise applications with their application.xml. XML was everywhere, XML was cool. Imagine, you can write your Java code, deploy it and after just twist bits and pieces in your XML files. XML, XML… Then we had SAX, DOM, JAXB, Castor, XSL, XSLT, Schemas, DTD… God, life became so flexible. Too flexible ? Of course ! XML has taken over our lives, we all hate ...

          JAXB 2.0 Hello World

          For people who have played with JAXB 1.x, JAXB 2.0 has the same beahavior: it can marshall/unmarshall object from/to XML. But the syntax is completly different. It uses all kind of annotations. This blog is just about writing and executing a good old Hello World with JAXB 2.0.

          First you need to download and install the binary. For the following example you will just need to put jaxb-api.jar and jaxb-impl.jar in your classpath.

          The following code represents a HelloWorld class with two attributes. The main method creates a HelloWorld object, sets some values, marshalles it to the hello.xml file, displays ...

          Java Day 2006 In Paris

          Well, in fact Java Day 2006 wasn't held in Paris itself but in Versailles, just in front of the castle So, yes, things also happen outside the US. I know, it was just a one day java conferences with only 5 sessions, nothing compare to the four days of Java One and its 188 sessions. But still, we had James Goslings on stage. If you look at the agenda, this is what happened.

          Welcome
          Eric Mahé ? Technology Advisor ? Sun Microsystems France

          Eric, ...

          Google Notebook

          You surf the web, you read something interesting, you copy the text? but where will you paste it ? In a note on your desktop at the office, in a text file on your computer at home, send it to you by email ? Forget it, just use Google Notebook.

          Create new notes in your notebooks, expand them, change their order just using drag&drop.

          googlenote1.JPG

          But the best is when you use the Firefox extension. Select a bit of text, right click and add it to your notebook? simple as that.

          ...

          What Would Be Your Ideal Job?

          I've been working in the IT industry for quite a long time now. Mainly in big companies, on big projects where you spend half your time in meetings and the other half writing meeting reports. Through this experience I've met a lot of people who have had different experiences, different projects but I've never met anyone who has had their ideal job during his/her career. There are always management, political, personnel or budget problems which cause the project to turn into a nightmare. When you talk to people, everybody seems to converge towards an ideal situation where innovation, dynamism, professionalism, intelligent management and beauty flow 10 hours a day… but that never happens.

          As a Java developer, architect or project leader, what would be ...

          Weblogic Cluster Life Cycle

          When you run a weblogic cluster you have to deal with several messages BEA-0001xx . It is then difficult to figure out what is the normal behavior of a cluster and the normal messages to get.

          Imagine two managed servers ClusterServer1 (listening on port 4001) and ClusterServer2 (port 4002) running on a cluster and sharing heartbeats through the multicast address 237.0.0.1. ClusterServer2 is started first, and then comes ClusterServer1 This is what you'll get on both logs of the server.

          ClusterServer2 logs (simplified)

          <Notice>  ...

          Connection Time Out. Careful With Your Threads

          Last week we had a bottle neck on our application and it took us several days to find it. So, here is what you should not do.

          The architecture is as followed :

          • 2 Alteons to spread the load
          • 2 reverse proxy
          • a layer of Firewalls
          • 2 HTTP compressors
          • 4 web server iPlanet (Sun Java Web Server 6.0)
          • a cluster of 40 Weblogic server running on 4 different boxes
          • a database server.
          Everything running on HP-Ux11. iPlanet only dispatch static pages and images and Weblogic has the presentation (JSP/Servlet) and EJB layers (it does 99% of the work).

          The ...

          God Is A .Net Programmer

          Part of my company's job is to create tailored software for clients. They manage to deliver 5-6 a year and producing each one takes between 200-500 days. For the last 2 years they have developed around 80% using the .Net platform and the remaining 20% using Java. Last year I worked for 1 month with a .Net team trying to re-architect their software, but I gave up. Those guys didn't know what a Singleton was, nor a framework, nor even a package ! And because I didn't know anything about .Net (and still don't) I moved to do other things.

          The other day I was talking to one of the commercial guys and I asked him why my company wasn't putting any effort in trying to do more Java. The answer was quick and precise: "We realized that .Net software is 40% ...

          I Hate Html !!!

          Am I the only one to hate HTML or is this « language » really a pain in the back ? Like many of you, I am a back-end guy : I love Java, I feel happy when I use hibernate, J2EE doesn't scare me anymore, Struts has no secret… but behind the Strut's Form lies the dark side of web applications : HTML (or XHTML)

          I'm working with some friends on a website that we will soon put online. This time we are not allowed to have dirty Hello World black&white pages. This time there is no HTML designer to do the dirty job of writing HTML for us, so we have to do it. We use a java ...

          10 Things To Do When Your Job Is Really Boring

          Sometimes, your job is really boring. And I'm not talking about a couple of hours or a day, I'm taking about weeks and even months of boredom. This can be due to several reasons: the project is delayed, the client has not really made up his mind, the budget has not been approved yet, the compliance team is still checking that the JDK 1.3 can be installed, let's prototype all the MVC frameworks first… But the most common reason is political issues: everybody is waiting for a decision maker to do his job, take a decision. In the meantime, what can you do:

          1. Change the situation: the first thing to do is to try to change the situation. Make things go faster, talk to the right ...

            And The Winner Is : COBOL !!!

            J2EE has nothing new happening ! J2EE is a back-end language ! JCP is too heavy ! Java language is not open sourced ! Ruby on Rails is the next thing ! JRuby looks interesting ! Java is dead ! .Net is easier to develop than Java ! Ruby is more flexible than Java ! J2EE is too complicated when you want to do web development ! And what about PHP ?

            This is what we can read here and there in blogs, articles, web sites. I have to admit, I'm starting to get confused too. I arrived at the early stages of Java, coming from C and C++, and I thought that was great. When J2EE arrived I was the first one ...

            Migrating From Tiles To SiteMesh In AppFuse 1.5

            In this blog I explain how I've migrated from Struts Tiles to SiteMesh in a AppFuse 1.5 project. I wanted to do that because I was fedup of dealing with Tiles aliases and also because I've used SiteMesh in other projects and it's really easy to use.

            Metadata

            filter-mappings.xml

            In %ROOT%metadatawebfilter-mappings.xml add the folowing

            
            <filter-mapping>
            <filter-name>sitemesh</filter-name>
            <url-pattern>/*</url-pattern>
            <!-- These are needed by Tomcat 5 for forwards -->

            <!--dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher--> </filter-mapping>

            filters.xml

            And in the filters.xml file ...

            Thank You Skype 2.0beta

            I've just downloaded Skype 2.0 beta with video. It's fantastic. I've got half of my family in Portugal and half in Australia, so I am a big Skype and Skype Out user. The problem was the video. I had to use Yahoo Msg as well as Skype. But now, with the version 2.0, the video works pretty well I have to say. I was quite impressed. You can even have a full screen image of your friend, while speaking normaly.

            And it's just a beta version… I can't wait to have the final ...

            An Easy Way To Version Your Objects

            Imagine that you have a Customer object that has an Address and a BankAccount. In other words, John lives in Los Angeles and has the bank account number 123456 (V1.0). Imagine then that John decides to move to New York (V1.1) and several months later changes bank accounts (V1.2). Tired of the city stress, he moves to Alaska (V1.3) where he closes his bank account (V1.4) and starts fishing.

            How do you keep all this information in your system ? How can you get V1.2 of all your object ? You never delete data, you add version numbers when you make updates, add a timestamp, a version to your class definition (imagine that the Customer class has changed and has different attributes) and, of course, lots of data manipulation and processing to be able to ...

            Is Ruby An Aesthetic Language ?

            For me, a computing language has to be aesthetic !

            Like many IT people, I've used several computing languages through my life. With my Comodore 64 I've started developing in Basic followed by Assembly. Then I had to do a bit of Cobol for a living and jumped into C and Ada. During the client server era I used Visual Basic and then I had a long and painful period of C++ ('*' and '&' are definitely not esthetic). In the meantime I was doing a research project in Prolog (that was cool and beautiful). Then, in 1998 Java arrived and I thought "this is great". Since then, I have to be honest, I have just focused on Java and I love it. Java is great because of the APIs, the Open Source projects, the JCPs… Java is great because a lot of people are ...

            Looking For A Definition Of An Architect

            On top of my J2EE consultancy work, I teach one evening a week at university. The topics I cover go from UML modelling, Design Patterns, Refactoring, Java APIs, Servlets, JSP, XML, EJBs, XML? to Web Services . My students have to do a weekly exercise and therefore have to model and write lots of Java classes (and refactor them from time to time). At the end of the year, I always have the same question: « Will I have to do all this work if I become an architect? »

            In my students? heads, an architect is someone who doesn?t write code anymore (even better, someone who never had to write a line in his/her entire life, not even a Hello World). I try ...

            You Need A Workflow ? Just Use Database Views !

            I'm still working for the same massive telecommunication company and trying to understand the tricky architecture of the expensive software they bought and are trying to use, see my previous post Today I've discovered how works a new piece of the architecture : the workflow.

            Their business rules are more or less these ones: managers arrive in the morning and dispatch the work through their team. A worker does the actual work and a supervisor checks that it's done properly and accepts it or not. I'm simplyfing here but I have to tell you that the entire national team is about 4000 person big and deals with thousands and thousands of request a ...

            How Thick Is A Rich Thin Client ?

            Long time ago, client machines were so thin that they didn't even have a hard drive or a floppy disk. The screen was black and green and all the work (even the display) was made on the server.

            Hardware became cheap, memory, hard drive… let's put less pressure on the server and develop thick clients. VB, Power Builder and so on arrived.

            Internet arrived a bit later with a stateless protocol carrying HTML to be displayed on browsers. That was thin and colorful (forget the black and green)… but java said, "hey, let's write some thick applets".

            Now companies and software editors are re-developing their thick applications so they can become thin again.

            I am working ...

Comments 0

No comments for this document
Java Champion

Paris JUG Leader

Cast Codeurs

Antonio Goncalves' personal website