Useful Feeds
How many blog posts start with the words "Sorry I've not been blogging much recently, but I resolve to post more often from now". Such a post may be followed by some actual substance, before the silence re-starts.
This is not one of those posts.
Getahead used to be the only place I blogged, but I've infected a few other feeds. I generally don't spend ages linking from one blog to another - I figure you can subscribe to the others if you want that content, however you can't do that if you don't know they exist.
I'm not closing this blog down, however I expect to blog less here. The good news, however, is that I hope that means that the subject-to-noise ratio will go up and not down. Stay tuned.
Both of these blogs are multi-author, 'professional' blogs. By professional, I mean peer-reviewed posts and no cat pictures - you can get those elsewhere.
CometDaily is written by the people that have spent the most time working on Comet. I've been busy this week so:...
On-board vs. Off-board Comet is about 2 architectural styles around how to deploy comet. DWR typifies one style. It's taken (in part) from the Comet BOF that Alex and I did at JavaOne.
Comet and Cross-Site Scripting is about how comet could supercharge a web worm so it becomes more virulent than a Warhol Worm. Samy took MySpace down with a web worm in 23 hours. I think it might be possible to reduce this time to about 6 seconds.
I work for SitePen along with a long list of similar techies. Our blog generally one post per day, about Ajax, Dojo, DWR and Comet.
Servlet Spec, Comet and Java is about how to work around Java's servlet spec to avoid needlessly chewing up threads. It looks at the options provided by Jetty, Grizzy, Tomcat and the new Servlet Spec.
And clearly, like everyone else, I tweet from time to time. In between tweeting, like everyone else, I mostly complain about how I can't tweet because Twitter is so unreliable.
Still no cat pictures, but I don't get peer reviews on my tweets.
Big Question for Sun
It looks from the outside as though every spare resource that Sun has is going into JavaFX. JavaFX may or may not win against Flash/Flex/Air/Silverlight/Android/Ajax, but while Sun is concentrating on FX, it doesn't appear to be giving the Java language the updates it badly needs.
Maybe Sun sees Java as 'done'. OK, but the Java language has one of the largest developer communities in the world, and they'd like some direction. Where do Sun recommend they go for their server-side development needs in 5 years time?
Maybe Sun think we should change to JRuby, Scala or Groovy. Maybe there are updates to Java that I don't know about. If none of the above are the case, the community will eventually disappear into mish-mash of languages that doesn't have the strength of numbers.
3:19pm Update: tweaked last paragraph to make the point clearer.
App Engine and Java
The world is now split into Python programmers, making funny 'Goo' noises over App Engine, and everyone else who are wondering when/if this will be available in their language or if they are going to have to change their spots.
Of all the languages to support, I guess Java must be one of the hardest because of the heavyweight runtime and the difficulty in separating code. But it also makes sense because supporting Java might give you quick access to Ruby/JavaScript/etc.
I have no knowledge of if Google are going to support Java in App Engine, however there are some tea-leaves that can be stretched and rearranged to form a vague picture.
Some time ago Google hired Greg Czajkowski the lead of Project Barcelona from Sun. Project Barcelona was where Isolates (JSR-121) came from and the Resource Consumption API (JSR 284), both of which would help you do this sort of thing. And both of which are now in Final Draft stage.
I have no idea if this does mean that Google are working on App Engine for Java, but if they do I'm going to claim bragging rights for having blogged about this 18 months ago.
Commercial Support for DWR
Short version: Commercial support and development assistance is now available for DWR.
Long version: SitePen has been offering support packages for a while, but you've had to ask. But it's now an advertised service, if you want help with Dojo, DWR or Cometd, packages start from $995. The DWR mailing lists are not going away and is still going to be a good solution for many problems, but if you need a bit more care and attention, we can now do that too.
The team of people that I'm working with at SitePen are awesome. Aside from the obvious DWR, Dojo and Cometd projects, SitePen people have also created TurboGears, Persevere and JSPON, are working specs for Bayeux, JSON schema and Servlet 3.0, and author json.com and cometdaily.com.
If you need to know more check-out the summary over on the SitePen site.
IE8 Review
I've been playing with IE8 beta 1, and I've got some thoughts ...
In terms of user visible HTML rendering features, I think IE 8 beta 1 is possibly the biggest release of IE in nearly 11 years since April 1997 when IE 4.0 alpha 1 was released. The history shows mostly bug fixes, and chrome changes since then. Maybe transparent PNG or Bidi text are bigger than Activities? It looks like that's going to be the feature that most people talk about, so I'm going to talk about some of the other stuff. There are 3 big things I'm interested in, and a few smaller features:
6 Connection Limit
I've been testing the new 6 connection limit. It works perfectly in my testing, Without any cookie or window.name hacks, DWR can do reverse ajax using comet to more than 2 browser windows:
DOM Storage
IE is way behind everyone else in implementing HTML5 features. So this is catching up to everyone else. It will be interesting to hear from the Dojo guys on this.
// sessionStorage also available
var store = window.globalStorage["http://www.example.com"];
store.setItem("key", "value");
var value = storage.getItem("key"); // == "value"
store.removeItem("key");
JavaScript Debugger
Firebug has been a stick that's been used to beat up IE for a while, and they've got an answer now. Unlike the other features, there isn't a screenshot in the release notes...
Firebug is still much better, in my opinion so far. But this is certainly a huge step forward compared to fighting with Script [Editor|Debugger] or Visual WebDev.
Acid 3
IE 8 does very badly on Acid 3 (17/100). However given that it's so new it's probably not fair to ding it too much. However it does need to improve big time:
- WebKit Nightly: 87%
- Opera 9.5b: 64%
- Firefox 3.0b3: 61%
- IE 8b1: 17%
For comparison, the released versions:
- Firefox 2.0.0.12: 50%
- Opera 9.26: 46%
- Safari 3.0.4: 39%
- IE 7: 11%
Given that they are innovating, I'm prepared to give them time to get the number up.
URL Bar Goodness
I didn't see this in the release notes anywhere. On Firefox I've got an add-on called LocationBar 2 that does some nice widgetry with the URL Bar:
Well it looks like IE8 has something similar built in too:
Cross-Domain XHR
The standards are still evolving on this one, but somewhat annoyingly IE8 seems to be going in a different direction from everyone else:
var xdr = new XDomainRequest();
xdr.open("POST", "http://www.example.com/xdr.txt");
xdr.send("Data for post body");
What is missing?
Lots. Still. No SVG/Canvas. No updates to the JScript implementation at a language level (it looks like there have been some performance increases though).
Let's not forget that Microsoft have more resources to get this right than almost anyone. If Opera can manage to create a first class browser, so should Microsoft.
And Finally ...
I loved the irony of the download recommendation. If you're downloading IE8, you might also like to download - IE6!:
InfoQ Interview
InfoQ interviewed me, and asked:
- What are some of the major features planned for [DWR] version 3.0?
- When is 3.0 slated for release? Is it still sometime in June?
- What does the incremental release schedule look like before the final 3.0 release?
- What are the top small features or fixes in 3.0 that a developer will be thankful for?
- For someone who might have looked at DWR 2.0 and decided the time wasn't right, what might 3.0 provide to help "make the deal"?
- What happened to 2.1, why the jump to 3.0?
- What sort of impact will Tibco's role play in the future of DWR?
- What are the next major milestones for DWR after 3.0?
InfoQ is built using DWR, so it would be great if they could take advantage of features like automatic offline when 3.0 comes out.
Taking of things Q. Next week, I'm talking on DWR and Comet at QCon.
DWR + Aptana Jaxer
I've been working with the guys from Aptana for the past week or so on adapting DWR to be a remoting layer for Jaxer.
Jaxer is a way to run JavaScript on the server. But it's not just JavaScript as an alternative to Java/Ruby/PHP/etc. Jaxer is Mozilla, on the server, with it's face ripped off and replaced by a snorkel to serialize the DOM to a web browser. John has a great introduction, or there's the podcast that Ajaxian did.
The vision with DWR was always to say: We've got Javascript in the browser, and Java on the server - lets connect them in the best possible way. This leads to the migration of view logic from the server to the client. But it's not safe to move it all; Validation is part of view logic, but that needs to be done on the server. With Jaxer you can specify scripts to be runat="server" or runat="both" to allow validation or other logic to be run in both places.
Some of the changes that we've made to DWR will only help you if you are using DWR inside Jaxer, but others could be generally useful.
There are 2 basic changes. DWR on the Internet needs to make sure that the Internet only touches the code that you want it to touch. DWR in Jaxer doesn't have this problem because it's not accessible from the Internet, so we can do away with almost all configuration. Secondly latency inside a server-room is tiny compared with the net, which makes synchronous XHR viable.
So as it stands at the moment in development, you can use DWR inside Jaxer like this (clearly this is subject to change):
<script type='text/javascript' runat="server"> Jaxer.dwr.pathToDwrServlet = "http://localhost:8080/demoServer/dwr"; Jaxer.dwr.require("util", "new/org.example.Demo"); function loadServer() { var data = Demo.getData(); dwr.util.setValue('fillFromServer', data); } </script>
There are a number of benefits that come out of this even if you're not using Jaxer:
- In dwr.xml you needed to specify javascript='ScriptName'. If (as is common) ScriptName == Class.getShortName then you can just drop the attribute, it will default properly.
- Cross domain remoting is now automatically detected, and scriptTag remoting is used if needed.
- There is a new init-param 'useAbsolutePaths' which might help people with trouble remapping DWR's location.
- All URLs are now reconfigurable.
- If you are using DWR in synchronous mode (which I don't recommend on the Internet) then you can use returned data in the normal way without needing a callback.
IWebMvc Preview
Jose Noheda has released a preview of a library that glues together DWR, Dojo, Spring and Hibernate/JPA. It's a 0.1 release and he's looking for feedback.
Despite the name, it's not really another Web MVC framework, but more along the lines of AppFuse or Grails, as a way to kick-start a project and provide some sensible defaults without needing to learn everything from scratch.
The source and release notes say it needs 1.6, so Mac heads will need to get the Apple Java6 preview.
Jose's aims:
In my mind what I really needed was a platform that:
- Is based on Java
Although supporting Groovy / JRuby is a plus - Helps me to kick start a project
But simplifying the process by giving me the best (and this can be tricky) set of frameworks for each task - Integrates both server and client sides
And it's lightweight, robust and extensible. Read enterprise quality. - Supports all the common tasks a web app has to handle
I include here: User Management, CRUD operations, i18n support (both framework & data), AJAX and astounding visuals
Jose has done some brilliant work on DWR. He created a large chunk of our binary file support, and is currently the Spring integration maintainer, so it might be worth a download to see if it can help you.
2 Wrongs Making a Right: (false && false) = true
I just had one of those times when I thought I totally lost the ability to do simple logic. Take a look at this screenshot:
I'll break it down: req.readyState = 4, and batch.async = false.
Last time I checked 4 = 4. So blatantly (4 != 4) is false. And false && false is blatantly uber false, as true as Alice Cooper covering Barbie Girl.
So seeing firebug step through if (false) and onto the return statement made about as much sense as trying to raise Schrodinger's cat in a séance.
I think it's another quirk in Firebug. This time it's simply something funky going on with "step over".
The moral is: Firebug sometimes lies to you about where the current line is.
This is all part of me adapting DWR so that it can be used as a connector between Jaxer and some Java server. More on that in a bit.

