Thursday, May 8, 2008

Java One 2008, day one, part two

Where was I? Ah the JAX-RS presentation. A few more things have come to mind since I finished that post. With JAX-RS you end up wanting to wrap your domain model element rather than liter them with JAX-RS annotations and structures. There appears to be a wizard to do this for you in Netbean; but not command line tool to make this sharable from other platforms.

The afternoon general session was more JavaFX stuff, looks to be an interesting technology when it finally arrives. Would appear to make it possible to a lot of nice graphical stuff for very little work. Fortunately those API are also going to be avaliable to the normal java developer as it is all based on the same VM. They showed a cool demo of Parleysport of JavaFX from its current flash implementation. Very impressive, very rich might even stand a change against Silverlight... specially with the JDKu10 release which will improve the user experience in many ways. And it is about time too!

Oh and a bit about packaging, going to support OSGi aswell as an new Java packaging standard called JAM. Should make a few people very happy.

The next presentation for me was TS-6169 which covered the new feature in spring 2.5. I wont go into all the details here as there is a fine artical here but sufficive to say it looks as clean and powerful as ever. A lot more annotations in this release mean that there is rather less of a need for the big old spring configuration files.

Interesting figures at the start of the slide showing that apparently the vast majoriy of BEA users have spring in the mix. Although to be fair any user of SOA 11 will be using spring, they just wont know about it. (The innards of SOA are put together using spring there are even a few aspects in there)

There appears to be a trend of annotations on annotations. In particular in the basis of providing marked to wire stuff up. This was also seen it the WebBeans presentation which I have seen [sic] tommorrow.

Final note is that Spring 3.0 will be a bit restfull, will be rolled out to the entire platform.

TS-6589 turing WTF code into a learning experience was presented by one of the developers in find bugs. Showed some common examples, for example synchronizing on a string constant or that DateFormat is never thread safe, but looked more at the process of trying to abstract out the programmer error. Interesting they say that writing test for findbugs is quite hard but they will write one for you if you come up with a suitable example. (They did say that writing tests in PMD and jackpot is much easier)

A section on equals methods was interesting as it presented the following three options for implementing the equals method: object equality, value equality or behavioural equality. The single equals method is not expressive enough. Indeed I can see the point here that This should never have been part of the API; but instead a seperate comparator interface for each case.

TS-6127 looked at a DIY implementation of a multitouch "table". Lots of good stuff about wood work and how to get a webcam to see in IR. Really quite fun. An interesting if obvious point is that you have to track the order of the fingers in order to do much of the gesture recognition for multitouch. So even if you rotate a figure the order of the "touches" has to stay the same in order to make the UI work properly. Not much new; but fun to hear how it was made.

BOF-5031 was a follow on from an earlier presentation, TS-5581. I liked the new annotations on of other elements proposal, JSR-308. This allows the use of declarative constraints such as @Immutable and @NotNullable which can be enforced by the compiler, those are described in JSR-305. The safe rethrow looks also quite useful, it is best explained with the code from the presentation seen below. If you want to log all exceptions when they go past you have a problem as you cannot rethrow Throwable without having to expose them in the throws clause:

void m() throws X1,X2 {
  try { /* Something that can throw X1,X2 */ }
  catch (Throwable e) {
   logger.log(e);
   throw e; // Error: Unreported exception Throwable
  }
}

Instead with the use of the final keyword you can tell the compiler that this is okay and to pass it on:

void m() throws X1,X2 {
  try { /* Something that can throw X1,X2 */ }
  catch (final Throwable e) { // Not extra final keywork
   logger.log(e);
   throw e; // Compiles OK; can throw X1,X2
  }
}

Very usefull because it means that you can register stuff like OutOfMemory errors and close transactions without having to muck up the API or use that sun.misc.Unsafe class.

No mention of closures though....

The last BOF of the day, 5613, focused on JAX-RS. I am pretty sure it was interesting; but I think I was very sleepy at this stage and appear to not to have taken any notes. Still it was after 9pm after a early start and a flight from Scotland via London. Back to the hotel for some well earned rest.

The Spoiler Question

You always get at least one person who asks a question just to try and make the person on stage look stupid. We had one today at the end of our async web services presentation.

I was along the lines of have you considered technology X? Unfortunately I hadn't and I said so; but the questioner went on to badger us for a few more question even though we admitted it was something we will have to look at. The questioners tone at the time seem a little bit off a the time but when I got out of the presentation I found out that the person asking the question was a spec lead for X. This really anoyed me as I think it is only polite to declare an interest if you are going to ask some questions. It is not as if we can actually see the questioner due to the spot lights on us.

I don't mind being told I am wrong or have missed something; but it was the tone and sneakiness of the questioner that makes me feel it was a spoiler rather than a question meant to help move everybody understanding forwards.

(I do know what technology X does in that case know, and I am not 100% convinced that it is that much better, than what we presented)

Wednesday, May 7, 2008

Java One 2008, day one, part one

It turns out that American's do infact eat donuts for breakfast, or at least that is what I am going to assume after trying to get something to eat at the conference venue this morning. I decided not to eat at my hotel as I was running late; but most of the breakfast packaging appeared to be made up of Scones, Donuts, Muffins and something made out of chocolate. To my point of view these are thing you ear after the main course.... certainly not for breakfast!

The main topic of JavaOne this year is "Java and you" and the keynote presentations continues these themes. A lot of very cool demos of Java FX, with the new media support this is looking to being a serious competitor to Flash and Flex. They are really going to the rich client. One cool feature they presented was the ability to "tear" off applets from a web page and save if for later web start style. I wonder if they have managed to save client side java from the brink?

Note this is where the curse of the demo'08 starts, and from the demo I have seen this will continue up to at least my presentation tommorrow. After the kindle demo went wrong, every other demo appeared to fail in some way. One FX demo that did work had something like 200 running HD movie traiolers spinning on a 3D globe, they do appears to have solve a lot of performance issues dealing with media and java.

Interesting aside of the new glassfish micro-kernel, much like the BEA one, comes in at around 98k and takes on 1 second to boot. This does mean you can for instance just instance the kernel and basic HTML server technology to create the right combination for an embedded media server. Will be interest to see how this works out.

My first real session of the day was TS-5425 JAX-RS. This was really interesting if only for the elegance of the JAX-RS programming model. I can see this being a very productive enviroment to work in. Will write up some more notes once I have had some time to play with it a little bit more. Not going to be finished until September though and will not contain any client libraries. (Although there is one as part of Jersey)

Tuesday, May 6, 2008

Finally Java One is here

So here I am with my body clock in what apparently appears to be in the right time zone sitting in my hotel room just a few blocks away from the Moscone center. A very long day yesterday traveling from Edinburgh after a wedding on Sunday only to fly past again a few hours later on the way over to the US. But for one reason or another I managed to stay up and then wake up at a reasonable time. I suspect I might crash at some point this afternoon.

Presentation appears to be on track, timming have me a taking a couple of minutes more than I have. Generally the 'fear of the stage' will deal with any minor timing overruns. Going to meet up with Manoj my co-presenter today and run through the entire presentation for the first time and possibly the last before we go on stage! Certainly more exciting this way; but I think we are both prepared.

The swag in the JavaOne bag is properly light very little rubbish in there that is non-recyclable which is how it should be. Speakers gift is a wind up tourch which is actually quite good and without a batter which would take up some of the eco-cred. Not yet decided whether this is going to make it back as part of the post-conference pot-latch. Not sure I am going to find time to walk over the the Intercontental to find out what the Alumni gift is.

Lots of public sessions today, although the first interesting technical session is TS-5425 which relates is about JAX-RS which is the restful, possibly evil depending on how you feel about it, twin of the JAX-WS spec. Should be quite interesting as I have be watching this spec grouw over the months. Then later on todat possibly a presentation on Multitouch and Amazon EC2. No SoyLatte presentation though, appears to have been yanked at the last minute. Prehaps rumors of sun taking over apple jdk developement are going to come true. I hope so as the recently released JDK wont run on any of my Intel macs.

Right better get some breaky and get over to the conference. Hoping to meet up with Alex Ruiz today if only to put a name to a face.

Monday, April 28, 2008

Demo'ing with JDeveloper

I am obviously preparing for my presentation next week at JavaOne and as part of this we are using JDeveloper to demo some concepts and examples. I have to demo regularly and here is a tip for making sure that you demo works the same way each time.

The key to this trick is to start jdeveloper with the "-su" flag. This ensures that the system* and mywork directories are created under the JDeveloper install directory. This makes things much easier when you are trying to reset the test data. (Otherwise it is written into your home directory which is a pain to tidy up)

So I create my target directory with my JDeveloper instance in it. (In this case "D:\javaOneWorking") I then run up my JDeveloper and configure the environment once I am happy I quit JDeveloper. Then you can zip or make a copy of the whole directory. Use this copy to recreate javaOneWorking when you need to practice your demo again.

Also becuase doing an unzip or xcopy can take some time, make a few copies of the directory. Then you can simply rename them into place. That way you can be sure you can restart you demo very quickly up to a few minutes before you go on stage.

Oh and just in case you find a bug, do prepare you demo a little time before hand..... :-)

Friday, April 18, 2008

Where can I find www.orablogs.com content now that is has been replaced by a NSFW link farm?

I have posted about this before but you can final all orablogs content archived on the way back when machine.

Tuesday, April 15, 2008

Using HTTP Analyzer in JDeveloper to monitor SOA

Just a quick mention of Eric's entry on using the HTTP Analyzer with the SOA server. There are a few extra details that are particular to SOA.