maandag 26 december 2005

JavaPolis: First day of Conference (3/5)

Third day at Javapolis was kind of strange if you ask me.
The keynotes were nothing extraordinary and then we were already halfway the day...

So at 11.30 I went to What's new in NG Mobile Java as this is a bigger market than J2SE/J2EE will ever be. Even though job demand isn't that big here in Belgium for these kind of jobs. Beside the updates to the CDC / MIDP API's one thing caught my attention. JSR-180 which allows you to connect to an SIP proxy from your mobile device. This could turn out interesting, as soon as your mobile can connect to either to a WLAN or via bluetooth to the internet, it could connect to your SIP proxy avoiding the usage of the mobile network (and reducing those pesky bills :) )



Next talk was unanimous: EJB3 by Linda DeMichiel and Mike Keith, the romm was filled to the brim. Although I didn't hear a lot of new things I was still exited about how SUN finally did the right thing (even though they are screwing up JSF). So after lunch most of the crowd still exited about EJB3 wend to Seam. That seems to integrate EJB3 and JSF. Oh my... even though expectations were set at the beginning of the presentation regarding 'fix for back button' and '2 windows to the same webapp' the end of the presentation was undermined <<completely>> by the lack of knowledge of either the English language or Http Sessions. I hope it was the first. When people asked how they'd fixed the "2 open windows" problem Thomas answered 'we handle it on the server side, with cookies'. Well, sorry, at that time I wasn't the only one leaving the presentation.



One thing I was really looking forward too was the presentations by Brian Goetz about Concurrency Utilities and the Memory Model in JDK1.5.
Among others he talked about :


  • Executors: objects that define how, when and how many concurrent Runnable tasks will be executed. Even though one may think this is trivial, it's nice that SUN made a couple of default implementations like ScheduledThreadPoolExecutor and ThreadPoolExecutor.

  • ConcurrentHashMap which allows concurrent access to a Map without throwing the notorious ConcurrentModificationException as it doesn't block concurrent access, but does impose some restrictions on modifications in terms of concurrent threads

  • Condition / Lock in order to keep your code somehow cleaner than with the wait/notify. Like this rip from the javadoc clearly shows,

    class BoundedBuffer {
    final Lock lock = new ReentrantLock();
    final Condition notFull = lock.newCondition();
    final Condition notEmpty = lock.newCondition();

    final Object[] items = new Object[100];
    int putptr, takeptr, count;

    public void put(Object x) throws InterruptedException {
    lock.lock();
    try {
    while (count == items.length)
    notFull.await();
    items[putptr] = x;
    if (++putptr == items.length) putptr = 0;
    ++count;
    notEmpty.signal();
    } finally {
    lock.unlock();
    }
    }

    public Object take() throws InterruptedException {
    lock.lock();
    try {
    while (count == 0)
    notEmpty.await();
    Object x = items[takeptr];
    if (++takeptr == items.length) takeptr = 0;
    --count;
    notFull.signal();
    return x;
    } finally {
    lock.unlock();
    }
    }
    }





About the talk of the Java Memory Model I remembered that one have to be extremely careful with assuming stuff in java. The compiler can do stuff you didn't think of initially
For example who would think that


while(!asleep)
   sheep++;

could turn by the compiler into something like

if(!asleep)
   while(true)
      sheep++;

Keeps me up at night :)

zaterdag 24 december 2005

Javapolis Day 2 - Spring 2.0 & Agile Development

Title says it all


  • Spring Business tier gave me quite a surprise as finally we can create those dreaded XML files by the use of schema's so validation won't have to be done at runtime anymore. Also something like custom tags will be in the next version of spring allowing some commonly classes to be used without the FQ package name. Among others, tags for properties and transactions.Can't wait to get my hands on this release...


  • The afternoon I didn't know what to choose at first. OK Spring Web and Ajax were kinda appealing, but since it was more of the same, I decided to listen to Scott W. Ambler on Agile Model Driven Development. Not with much hope as at that time I didn't know he was such a big shot. He did mention some pain points in development. Like traditional development cycles taking too long and losing touch with customer and requirements. Or how to handle burocratic managers requiring an overload of documentation.


    He also made the case against requirements up front. As most customers will then try to come up with as much requirements as they can think of at the time loosing touch with the actual requirements. Hence applications can be made were two thirds of the functionalities aren't used at all, causing these projects to go over-time and budget. We should therefor allow our customers to change their minds.


    However, most of the customers expect projects to go over-time and budget, so they endorse fixed-price projects. This forces us then back to the old style where we need the requirements back up front since otherwise we can't make our estimates about the application. sigh...




vrijdag 23 december 2005

Old Year's Photos

Reuters Year in Photos

MSNBC



Thunderstorm




Israel: Settler pleads to stay in Gaza




War in Iraq: Honoring a fallen father

Javapolis 1/5

OK I admit, probably way late to write something about Javapolis which I attended last week. But well, since then I had so much new things to discover that I decided that it's better to be burried under work than to appear alive :).
I'll split this up in seperate days so you don't have to read it as one big chunk.

But first a picture...



If you're looking for me (for some strange and obscene reason) I'm way off to the right and probably fell of the picture.


Ok first day, since it was university one 2 speakers a day, which made it kinda interesting as when you made your pick it was for half a day. My choices the first day were Apache MyFaces and Using the EJB 3.0 Reference Implementation. Although I have to admit that I was tempted to go to Desktop Java In Action by Romain Guy from Sun Microsystems. But since I'm a frequent reader of his blog, I thought go for something you know less about.





  • MyFaces by Jonas Jacobi,Martin Marinschek and John Fallows: I've been using JSF to do the SCEA assignment last year and I found it a bit limited and full of quircks. But since a year has passed and things tend to change I wanted to see how things hopefully improved. Event though I didn't see any actual improvements (but more on that later), the announcement & demo (and actually rest of the talk) was made by Oracle that was going to open source it's ADF component suite.
    I've been looking to this and found it quite impressive but I've avoided it like the plague since I didn't want to be locked in. But now...
    This announcement was made in the MyFaces talk because of its future name MyFaces Cherokee although I haven't been able to find it on the incubator site of apache, it should be there next year (2006).


  • Using the EJB3.0 RI seemed to appeal to me as Sun finally understood that developers don't just take anything (like the M$ guys from technet sometimes seems to think) although when you look at JSF...
    Anyway, when you look at EJB3 the JSR members really seem to have done their homework. Finally no more blunted XML files (that everyone created through XDoclet anyway), simple POJO's, even the cmp's. Ahhh, what a relief to see that the most common options are now defaulted in the annotations (yes, java5 is required). Anyway the talk was really good filled with lot's of examples. Mike Keith really explained the persistence part very well. Things like the difference between EntityManagers and persistence contexts and how you can do queries now in EJB3. (Dynamic and static ones). As soon as can get my hands on this one, more of this