I was pleased to see the listing of the forthcoming O’Reilly Energy Innovation Conference, and wondered… how can Java and IT developers in general participate?
Usual first reactions to the JSR 310 that I saw on the web were “finally” or “too late”, but I think that “better late then never” should be applied in this case. People behind this specification are developers of Joda time and this API will be heavily based on Joda time, which has been an excellent replacement for traditional Java date/calendar API (and must-have tool in your toolbox) for years. Beside the initial goal, to provide lightweight and simple API, one of the area of interest will be interoperability with JDBC. The general attitude toward this spec is maybe best described by the Google’s voting comment:
On 2007-01-30 Google Inc. voted Yes with the following comment:
We are thrilled to see this happen!
Hopefully, this specification will be included in Java 7.
Now back to the RESTful Web Services and the specification request 311. Although it is not crucial part of the language as Date/Time API, I think that this specification deserves to pass approval process and we (Java developers) deserve to have standard API to deal with RESTfull web services.
The introductory example, from Marc Hadley (one of the spec leads) looks promising
@UriTemplate("widgets/{widgetid}")
@ConsumeMime("application/widgets+xml")
@ProduceMime("application/widgets+xml")
public class Widget {
@HttpMethod(GET)
public Representation getWidget(@UriParam("widgetid") String id) {
String replyStr = getWidgetAsXml(id);
return new StringRepresentation(replyStr,
"application/widgets+xml");
}
@HttpMethod(PUT)
public void updateWidget(@UriParam("widgetid") String id,
Representation update) {
updateWidgetFromXml(id, update);
}
@LastModified
public Date getChangeDate(@UriParam("widgetid") String id) {
return getLastChanged(id);
}
}
but I’ll second usual comments found on this topic: “I hope that they don’t screw it up”.
The Dictionary class is part of the i18n GWT package, but the big advantage it has is that it is resolved at runtime, rather than compile time. This means you can pass in values to your GWT app from the host page. In this case, the host page being a JSP.
What you want to do is create a script tag in a host JSP like this:
to get a lookup for your service URLs with JSessionID encoded and use that when you construct your stubs. This will give the service cals the same JSessionID as your JSP host page.
The final version of Sun Java Wireless Toolkit 2.5 for CLDC is finally out and available for download. A lot of worthy things have been included in the toolkit which also includes support for all JSRs under the MSA. It has some of the advanced development features existing in version 2.2, 2.3 Beta, 2.5 Beta 2 such as certificate management, MIDlet signing, push registry emulation and over the air emulation.
Java Mozilla HTML Parser 1.0.1 has seen an updation. Developed as a part of Dapper, it is a package which allows parsing HTML pages into a Java Document object. Wrapped around Mozilla’s HTML parser, it gives the user a browser quality HTML parser.
In the Java industry this week, the Apache Tapestry project announced a preview release of Tapestry 5.0.1. From their website they define Tapestry as “an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server.”
This is just so cool, I cannot contain it. For those of you who haven’t heard about Hpricot, it is one of why the lucky stiff’s incredibly cool tools (which he probably will use to take over the world any day now…). It’s HTML parsing goodness, very flexible, with the goal of being able to parse (and fix) everything that Firefox handles.
“So what?” you’re probably asking… Well, Hpricot uses Ragel and some C code to achieve blinding speed. This means JRuby can’t run it. Or I should say couldn’t run it:
orpheus:~/workspace/jruby> jruby bin/gem install hpricot –source https://code.whytheluckystiff.net
Bulk updating Gem source index for: https://code.whytheluckystiff.net
Select which gem to install for your platform (java)
1. hpricot 0.5.110 (jruby)
2. hpricot 0.5.110 (mswin32)
3. hpricot 0.5.110 (ruby)
4. hpricot 0.5 (ruby)
5. hpricot 0.5 (mswin32)
6. hpricot 0.5.0 (ruby)
…
That’s right, Hpricot is now more promiscuous than any other gem with native parts.
What can you do with it? Well, I’m just going to point you to _why’s own description of it. All he says at https://code.whytheluckystiff.net/hpricot/ will work fine in JRuby!
How did this come to be? Well, me and _why did some joint hacking, which was helped along by the fact that Adrian Thurston (the genius behind Ragel) recently added Java support to it. So, basically, most of the Ragel definition is exactly the same for both the C and the Java versions. The native code has been factored out, and both versions are buildable with rake from _why’s code repository.
This is important. Don’t think anything else. This strategy will, and can, be used for other gems with native parts. It’s just a question of time.
Yeah, I can’t help but wonder how long it will be before this becomes SOP.
Laszlo Systems announced the beta release of its latest product (or should I say framework) to help make AJAX/RIA development easier. Its called “Laszlo Webtop” and its aim is to help do two things - (1) provide the infrastructure to create a desktop on the web(or should I call it Portal 3.0) and (2) continue the effort of providing server side infrastructure for Java developers to utilize the tools, libraries and container services that already work well for them.
This is built on OpenLaszlo, but is a commercial offering. Laszlo has what they call an early access program to testdrive this framework. So if you are interested, you would have to request for it through their website - www.laszlosystems.com.
So there was definitely a big response to My response to Pat on typing in Java. Some of it was fair, some people don’t know they difference between Typed and Static Typed languages, but that is to be expected.
One of the things that comes up all the time is Groovy. Someone brought it up in the context of STDs, and it always comes up in these discussions. A lot of Groovy people are (rightly so) pissed — can I use that word here? — that Sun effectively “endorsed” Ruby over Groovy. Grails *is* an …. almost… perfectly good analogue to Rails, and Groovy definitely sits better with most Java people.
Here is the problem, guys. You aren’t buzzword compliant. At this point, arguing the merits of Groovy over Ruby or Grails vs Rails doesn’t matter in the least. The “technorati” have dubbed RoR “the big thing.” Sun, having gotten their collective ass whipped by PHP and Python in the open source space are dying to retake some of that ground. The people who care about Groovy are already Java programmers. PHP and Perl people are looking at Ruby, and that is Sun’s market motivation.
Please don’t take this as an insult. Groovy is great. For my money, it stomps Python into the ground and then drops a St. Peter’s sized obelisk on its grave. However, whatever you do, you will always be the “Java” version of Boo. I don’t know what to tell you, other than implement your language in C++, with wxWidgets and Gtk# bindings, create a CGI library , and then you will be taken “seriously” by the powers that be.
An anonymous reader writes “There are 139,834 open-source projects under way on SourceForge. IWeek wonders which projects will make lasting contributions, and which will fizzle. Sure, Linux, Apache, and MySQL are winners, but what about OpenVista, FLOSSmole, and Hyperic HQ? What’s your list of open-source winners and losers?”
I know it is all kinds of fun to poke around SF.net and look at all the projects that went anywhere, or even started the trip. The thing is, a few weeks ago, I had a really interesting email exchange. Someone contacted me about the function of a class I wrote as part of a one-off two-weekend project. I walked away from a lot of that code over a year ago, and here I am getting support requests. It wasn’t even about the core functionality of the project, but a utility class I had written in it.
I was, of course, fascinated. Did you see my project? Did you care enough to look into the code? No, it was the result of a Koders search. Koders, and the less-useful Google Code Search might actually give a lot of life to those “Open Source Losers”. Even if the project never takes off, if there are useful bits of code living on the web, people will find them. It isn’t quite the grand vision of component-reuse that the Computer Scientists (capital C capital S) have wanted to see, but neither is Google the vast auto-correlated semantic web that TBL has been foretelling for a decade. Maybe, just maybe, though, it is good enough.
Romain is pimping the pimping of Swing apps. Of course, I have to pick at him:
It looks bad by default. You have to change it to [get] a good-looking application. Swing makes that really easy. You can override everything, the behaviors, the feel, you can change the look.
You have the powerful Java2D API [that] gives you all the drawing tools you need to create very rich user interfaces, with animation and nice effects. It’s the same technology we see in the old-style Swing applications, [and] with the same technology we can create things [that look] similar to the Vista [UI].
[snip]
When you bring up Windows, most rich clients aren’t that rich, actually. They’re just gray and dull and have a lot of buttons and text fields. We needed to find a term to talk about clients that go beyond that–rich clients with animation and 3D. The kinds of stuff you see on Vista today. We used the term filthy-rich clients to talk about those clients that tried to go beyond the existing user interfaces…
Rich-clients are getting better and better. They steal ideas from the Web, so we are now at this integration of several media. You have 3D, you have video, it goes beyond just the images we’ve had so far.
Here is the thing: I don’t want to monkey with all the stuff to make my swing app look good. If it is gray and dull that is because you aren’t providing me with a default that looks better. This is one of the reasons people respond so well to Flex apps: they look great with just the defaults. I, like most programmers, am lazy. I usually just want an app that does X as quickly as possible. Give me a toolkit that makes it look good by default.