<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.adjective.org/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>A word used to describe something</title>
  <link>http://blog.adjective.org/</link>
  <description></description>
  <language>en</language>
  <pubDate>Thu, 24 Jul 2008 12:55:48 +1000</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Announce - Orthodox Type Reflection Library</title>
    <link>http://blog.adjective.org/post/2008/02/21/Announce-Orthodox-Type-Reflection-Library</link>
    <guid isPermaLink="false">urn:md5:01228bc0b423e35d494ddd6df9fa0eb0</guid>
    <pubDate>Thu, 21 Feb 2008 23:39:00 +1100</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Development</category>
        <category>Java</category><category>Orthodox</category>    
    <description>&lt;p&gt;Prior to the release of Java 5, the Java library had 1 class that provided
access to type information at runtime - java.lang.Class. However, with the
introduction of generics in Java 5, this has been extended significantly.
Dealing with all these classes, and working with them at runtime, is overly
complex, and reduces the power of generics.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.adjective.org/orthodox/&quot;&gt;Orthodox&lt;/a&gt; is a library that
makes it easier to work with the Java type system at runtime.&lt;/p&gt;    &lt;p&gt;In Java 5, the type system includes the interfaces:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;java.lang.reflect.Type&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;java.lang.reflect.ParameterizedType&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;java.lang.reflect.WildcardType&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;java.lang.reflect.TypeVariable&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;java.lang.reflect.GenericArrayType&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;java.lang.reflect.GenericDeclaration&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Have you ever tried to use those interfaces? It's not straight forward.&lt;/p&gt;
&lt;p&gt;Imagine a class &lt;code&gt;com.example.Bean&lt;/code&gt; has a method
&lt;code&gt;getList()&lt;/code&gt; that returns an object of type
&lt;code&gt;java.util.List&lt;/code&gt;. You want to know what type of object that list
will contain. Is it a list of Objects? A list of Strings? Something else?&lt;/p&gt;
&lt;p&gt;If we look at the source code, we might see:&lt;/p&gt;
&lt;pre&gt;
List&amp;lt; ? extends CharSequence &amp;gt; getList() { /* ... */ }
&lt;/pre&gt;
&lt;p&gt;But how do we get access to that information at runtime? You might think
it's impossible, due to &lt;a href=&quot;http://www.google.com/search?q=java+type+erasure&quot;&gt;type erasure&lt;/a&gt;, but the
information is actually there, it's just that it's hard to get to because of
all those different ways of representing a type.&lt;/p&gt;
&lt;p&gt;Orthodox makes it easy to get at that information (and much more).&lt;/p&gt;
&lt;p&gt;At the moment it's a 0.5 release, because it hasn't had enough real world
usage to be sure that the API is right. Since the whole point of orthodox is to
put a better API on top of &lt;code&gt;java.lang.reflect.Type&lt;/code&gt;, getting the API
right is important. And I don't want to declare it a 1.0 release until I'm
happy that I've achieved that.&lt;/p&gt;
&lt;p&gt;However, don't let the 0.5 tag scare you into thinking it's unstable or
untested - I've put it through its paces, and it works like a charm.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Java Backwards Compatability</title>
    <link>http://blog.adjective.org/post/2008/02/21/Java-Backwards-Compatability</link>
    <guid isPermaLink="false">urn:md5:6aeb7cf12ed8246b9fcac4d953546aa5</guid>
    <pubDate>Thu, 21 Feb 2008 22:10:00 +1100</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Development</category>
        <category>Java</category>    
    <description>&lt;p&gt;Ted blogged about the &lt;a href=&quot;http://blogs.tedneward.com/2008/02/19/Who+Herds+The+Cats.aspx&quot;&gt;absence of
leadership&lt;/a&gt; in the direction of Java (the language).&lt;/p&gt;
&lt;p&gt;One of the comments there suggested we &lt;em&gt;forget about backward
compatibility&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I'm not necessarily for or against that idea, but I do think it's worth
thinking about, so we know what it is we're trying to preserve, and what we're
willing to give up.&lt;/p&gt;
&lt;p&gt;By necessity then, the first step must be to define what we mean be
backwards compatibility...&lt;/p&gt;    &lt;p&gt;There are a number of possible ways we can be &amp;quot;backwards compatible&amp;quot; and
some of them are easier to manage than others.&lt;/p&gt;
&lt;p&gt;Since the original post/comment was about Java 7, I'm going to use &amp;quot;Java 6&amp;quot;
to mean the &amp;quot;old&amp;quot; version of Java that we're trying to stay compatible with and
&amp;quot;Java 7&amp;quot; to refer to the new, perhaps incompatible version. And I'll use
closures as an example of a feature in Java 7 that may interfere with
compatibility. You can substitute in your own features and version numbers if
you wish.&lt;/p&gt;
&lt;p&gt;As best I can identify, the various ways to preserve backwards compatibility
are:&lt;/p&gt;
&lt;p&gt;&lt;ins&gt;At the binary level&lt;/ins&gt;&lt;/p&gt;
&lt;p&gt;1. &lt;strong&gt;Source written in Java 6 can be recompiled for Java 7&lt;/strong&gt;
For some people, this may be enough. Ditch any plans to keep running existing
class files, throw away your binary jar files (or run them through a Java 7
converter), and recompile everything from source. It's more or less what
Android is (although it hasn't added a new alternate syntax). However, it means
that the new VM can't run old applets (for the devoted few who still care about
applets) and it also means that you can't download a jar file from the internet
and use it in your app unless you know whether it's a Java 6 jar file, or a
Java 7 jar file. In practice we already have that problem. Java 5 jar files
don't run on a Java 4 VM. But this would create the reverse - Java 6 jar files
won't run on Java 7 VMs and Java 7 jar files won't run on Java 6 VMs. The only
extent to which this can be considered to be &amp;quot;backwards compatible&amp;quot; is that you
don't have to throw away your existing source code. You can make it run on the
new VM (with a small amount of effort)&lt;/p&gt;
&lt;p&gt;2. &lt;strong&gt;Old applications run unchanged on new VMs&lt;/strong&gt; At its
simplest, that just means that the Java 7 VM has support for running a pure
Java 6 application. It's a bit like the Playstation 2 being compatible with the
original Playstation - it had a PS1 embedded in it so it could play PS1 games.
However, since JEE deployments are a significant focus on the java landscape,
we probably need to extend the definition of an application to include anything
packaged as an EAR or WAR file. Which means we need app servers that can run
Java 6 applications as well as Java 7 applications. Presumably at the same
time. The main complexity in that is the consequences for &lt;code&gt;rt.jar&lt;/code&gt;.
Does the VM need to expose a single version of &lt;code&gt;rt.jar&lt;/code&gt; that is
compatible with both Java 6 and Java 7 applications? Would it be possible for
an app server running on a Java 7 VM to provide different versions of
&lt;code&gt;rt.jar&lt;/code&gt; to the different applications? Or would we need to have an
&lt;code&gt;rt.jar&lt;/code&gt; with a &lt;code&gt;java.util&lt;/code&gt; package and a
&lt;code&gt;java7.util&lt;/code&gt; package? (The latter of which has serious consequences
for the other possible definitions of &amp;quot;backwards compatible&amp;quot;)&lt;/p&gt;
&lt;p&gt;3. &lt;strong&gt;Old class files can be used by new class files (written in Java
7)&lt;/strong&gt; This would mean that your new Java 7 source code would be able to
use the existing jar file for your JDBC driver. It means that as far as Java 7
is concerned we need&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A VM that can run Java 6 class files alongside Java 7 class files&lt;/li&gt;
&lt;li&gt;A calling method from a Java 7 class file to a method in a Java 6 class
file&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;4. &lt;strong&gt;Old class files can call methods on Java 7 classes&lt;/strong&gt; If
you want to be able to write a &lt;code&gt;ListModel&lt;/code&gt; in Java 7, and then pass
that to a swing component written in Java 6, then you need this. To do it
properly, it means that the Java 6 code can use reflection on the Java 7 class,
and get meaningful data back. The class file format may not need to be anything
like the Java 6 class file format, but the reflection APIs and classloaders
need to be able to hide the differences. This form of compatibility was one of
the requirements that impacted generics.&lt;/p&gt;
&lt;p&gt;&lt;ins&gt;At the source level&lt;/ins&gt;&lt;/p&gt;
&lt;p&gt;5. &lt;strong&gt;The Java 7 version of &amp;quot;javac&amp;quot; knows how to compile both Java 6
and Java 7 code&lt;/strong&gt; This is easy. The Groovy compiler already does this -
you just need a way to work out which syntax is being used in a source
file.&lt;/p&gt;
&lt;p&gt;6. &lt;strong&gt;Source that uses the Java 7 syntax can call methods on Java 6
classes&lt;/strong&gt; This is pretty simple to do. The new syntax needs a way to
invoke a Java 6 method, but the various &amp;quot;new&amp;quot; syntaxes being played with
(Groovy, Scala, etc) already support this (although as Gilad Bracha's &lt;a href=&quot;http://gbracha.blogspot.com/2008/02/cutting-out-static.html&quot;&gt;recent post on
static variables&lt;/a&gt; points out, it has constrained the design of those
languages).&lt;/p&gt;
&lt;p&gt;7. &lt;strong&gt;Source that uses the old Java 6 syntax can call methods on new
Java 7 classes&lt;/strong&gt; This is fairly straight forward if you're happy to
require that it's compiled with the new compiler. You need to decide what to do
about classes that use new features. E.g. What if Java 6 code calls a method
that returns a closure? If the Java 6 syntax has no way to represent that
closure, then we have a problem.&lt;/p&gt;
&lt;p&gt;8. &lt;strong&gt;Source written in Java 6 can have Java 7 features added to it
slowly&lt;/strong&gt; This would require that every Java 6 source file is also a
valid Java 7 source file. It means that I can have a single source file,
defining a single class, and one of the methods (that was written years ago)
uses the old Java 6 syntax, while another method (that I wrote today) uses the
new Java 7 syntax. And they live happily together in the same file.&lt;/p&gt;
&lt;p&gt;I think we're likely to find different people care about different
definitions for &amp;quot;backwards compatibility&amp;quot;, and there will be some people who
think we need to support &lt;em&gt;all&lt;/em&gt; of them.&lt;/p&gt;
&lt;p&gt;My personal opinion is that if you don't have #1, #2, #3, and #6 then it's
not Java. Not having #7 (and probably #4 too) will seriously restrict the
number of people that are willing to switch. Point #5 is easy to do (as groovy
has shown) and useful enough that you'd be stupid not to do it.&lt;/p&gt;
&lt;p&gt;So really the point to question is #8. And while it's useful, and I think
we'd all like to keep it, the question has to be &amp;quot;Is it important enough to
hold back the evolution of the language (and platform) ?&amp;quot;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Dimple - a random Google find</title>
    <link>http://blog.adjective.org/post/2007/04/29/Dimple-a-random-Google-find</link>
    <guid isPermaLink="false">urn:md5:5aa6fdf01a2673164ad1769e292882ff</guid>
    <pubDate>Sun, 29 Apr 2007 01:43:00 +1000</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Development</category>
        <category>Java</category><category>Tie</category><category>Uniform</category>    
    <description>&lt;p&gt;The &lt;a href=&quot;http://dimple.codehaus.org/&quot;&gt;dimple framework&lt;/a&gt; turned up
after I did some (mostly) random searching on Google.&lt;/p&gt;    &lt;p&gt;There are two interesting things about dimple&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It matches pretty well to 2 libraries I wrote in the last couple of years:
&lt;a href=&quot;http://www.adjective.org/uniform&quot;&gt;uniform&lt;/a&gt; and &lt;a href=&quot;http://tie.sourceforge.net&quot;&gt;tie&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;In a previous &lt;del&gt;life&lt;/del&gt;job I worked on an application called Dimple
(which had nothing to do with method interception, and wasn't even written in
Java)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Just one of those interesting things that Google led me to.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Announce - Tie Method Interception Library</title>
    <link>http://blog.adjective.org/post/2007/04/10/Announce-Tie-Method-Interception-Library</link>
    <guid isPermaLink="false">urn:md5:2fdf5999498c60afc5e445653ad6248a</guid>
    <pubDate>Tue, 10 Apr 2007 23:19:00 +1000</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Development</category>
        <category>Java</category><category>sourceforge</category><category>Tie</category>    
    <description>&lt;p&gt;I'm pleased to announce that after sitting around for quite a few weeks, I
have finally succeeded in pushing out the first release of &amp;quot;tie&amp;quot;&lt;/p&gt;    &lt;p&gt;&lt;a href=&quot;http://tie.sf.net&quot;&gt;Tie&lt;/a&gt; is a method interception toolkit.&lt;/p&gt;
&lt;p&gt;It's a simple, zero configuration, library to support dynamic interception
at runtime. It doesn't do mixins, it makes no mention of pointcuts or aspects,
it simply does method interception.&lt;/p&gt;
&lt;p&gt;For projects which already making use of an AOP framework, that's probably
not particularly useful - if you're a happy user of Spring-AOP, Guice,
AspectWerkz or AspectJ, then Tie probably doesn't offer you anything new. But
if (like me) you're not overly into this whole AOP thing, and you just want to
use interception to apply the decorator pattern to a mix of different classes,
then tie is exactly what you're after.&lt;/p&gt;
&lt;p&gt;One of the reasons it took me so long to push the code out (I finished the
bulk of the development about 2 month ago) is that I've spent a fair bit of
time writing what I hope will be very useful documentation. So I'm going to
avoid making this blog entry any longer than it needs to be, and just point you
at &lt;a href=&quot;http://tie.sf.net/doc/user-guide/&quot;&gt;the docs&lt;/a&gt;.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>An early autumn rant</title>
    <link>http://blog.adjective.org/post/2007/03/31/An-early-autumn-rant</link>
    <guid isPermaLink="false">urn:md5:d984a6cd9dcdf3d1adcfb34020c41ec9</guid>
    <pubDate>Sat, 31 Mar 2007 23:59:00 +1000</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Rants</category>
        <category>sourceforge</category>    
    <description>&lt;p&gt;I got an email from sourceforge telling me about a new feature that they
&amp;quot;will add to SourceForge.net in late spring/early summer&amp;quot; So that does mean
that all the open source developers in South America, Southern Africa and
Australia get to the feature 6 months early, or 6 months late?&lt;/p&gt;    &lt;p&gt;It may seem petty, but it peeves me.&lt;/p&gt;
&lt;p&gt;The world has pretty much come to a consensus that there are 12 months in
the year, and they have generally accepted names. Why do companies insist on
ignoring that, and use the northern hemisphere seasons to describe periods of
the year?&lt;/p&gt;
&lt;p&gt;So, what I think SF is trying to say is that they'll be adding the feature
in the May-July period. But I may have to wait until November-January before
I'm allowed to use it.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Superhero</title>
    <link>http://blog.adjective.org/post/2007/01/06/Superhero</link>
    <guid isPermaLink="false">urn:md5:4328e3fff0af7f27bdc5ca7a0897ae32</guid>
    <pubDate>Sat, 06 Jan 2007 17:29:00 +1100</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Personal</category>
        <category>quiz</category>    
    <description>It seems these quiz things are the cool thing to do...    &lt;strong&gt;You are Spider-Man&lt;/strong&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Spider-Man&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;75%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Iron Man&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;65%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Superman&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;65%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Supergirl&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;55%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hulk&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;55%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Robin&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;45%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The Flash&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;45%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Batman&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;45%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Catwoman&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;35%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Green Lantern&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;25%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wonder Woman&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;20%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;td&gt;You are intelligent, witty,&lt;br /&gt;
a bit geeky and have great&lt;br /&gt;
power and responsibility.&lt;br /&gt;
&lt;img src=&quot;http://www.thesuperheroquiz.com/pics/spidy.gif&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;a href=&quot;http://www.thesuperheroquiz.com/&quot;&gt;Click here to take the &amp;quot;Which
Superhero am I?&amp;quot; quiz...&lt;/a&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;strong&gt;You are Dr. Doom&lt;/strong&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dr. Doom&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;74%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The Joker&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;70%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lex Luthor&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;66%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Green Goblin&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;58%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apocalypse&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;57%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Magneto&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;53%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dark Phoenix&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;50%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Riddler&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;47%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two-Face&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;46%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mr. Freeze&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;44%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Venom&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;38%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Juggernaut&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;34%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kingpin&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;32%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Poison Ivy&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;32%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mystique&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;26%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Catwoman&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;td&gt;21%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;td width=&quot;250&quot;&gt;Blessed with smarts and power but burdened by vanity.&lt;br /&gt;
&lt;img src=&quot;http://www.thesuperheroquiz.com/villain/pics/dr_doom.jpg&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;a href=&quot;http://www.thesuperheroquiz.com/villain&quot;&gt;Click here to take the &amp;quot;Which
Super Villain am I?&amp;quot; quiz...&lt;/a&gt;&lt;br /&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Java 7 Language Features</title>
    <link>http://blog.adjective.org/post/2006/12/13/Java-7-Language-Features</link>
    <guid isPermaLink="false">urn:md5:2ce1a0c928d1744830a95599985cbbfe</guid>
    <pubDate>Wed, 13 Dec 2006 23:53:00 +1100</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Development</category>
        <category>Java</category>    
    <description>I wanted to respond to &lt;a hreflang=&quot;en&quot; href=&quot;http://blogs.sun.com/dannycoward/entry/java_se_7_caught_on%20&quot;&gt;Danny Coward's
blog&lt;/a&gt; entry on Java 7, but his spam detection seem somewhat too rigourous,
so I'm making my comments here    My few thoughts:
&lt;ul&gt;
&lt;li&gt;I'm in favour of having concise property access syntax, but I'm not 100%
convinced on the arrow operator. I understand the concern about having the dot
operator be ambiguous, and the potential performance penalties that can occur,
but I think those fears are being over played. To my thinking the cost of
having two different member access operators is worse. Having
&lt;code&gt;bean-&amp;gt;property&lt;/code&gt; and &lt;code&gt;bean.getProperty()&lt;/code&gt; mean the
same thing segments the development space. Some people will use one, and some
people the other. If I'm using an IDE with content assist, then I have to know
whether I'm looking for a method or a property before I start typing. If we
really need to have a different syntax I'd prefer something like
&lt;code&gt;bean.getProperty()&lt;/code&gt; and &lt;code&gt;bean.@property&lt;/code&gt; or
&lt;code&gt;bean.$property&lt;/code&gt; - something that makes it clear that the difference
is in what sort of member you're accessing rather than what sort of operator
you use to get it. (NB: I spent a fair bit of time playing with Sather, so I'm
probably more comfortable than most people with &lt;a href=&quot;http://www.icsi.berkeley.edu/%7Esather/Documentation/LanguageDescription/webmaker/DescriptionX2Echapter2-1.html#HEADING1-152&quot;&gt;
transparent property access&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;If we are going to get syntactical support for declaring property
accessors, then I have 2 requests:
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://www.icsi.berkeley.edu/%7Esather/Documentation/LanguageDescription/webmaker/DescriptionX2Echapter2-1.html#HEADING1-56&quot;&gt;
readonly&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;It should be a transparent change to clients if I need to convert that from
a property accessor to a standard pair of methods (or just a getter
method)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Please please please &lt;em&gt;don't&lt;/em&gt; give XML special treatment in the
language. If we've found that working with arbitrary dynamic object graphs is
too difficult then find a way to support them, but please do not make it XML
specific. XML is not that important. I've had multiple situations where I've
wanted to dynamically access properties from object graphs - I'd love a neat
syntax for it. Please don't make this a XML-only solution. As Neal likes to
quote &lt;em&gt;Programming languages should be designed not by piling feature on top
of feature, but by removing the weaknesses and restrictions that make
additional features appear necessary.&lt;/em&gt; (R6RS)&lt;/li&gt;
&lt;li&gt;I know others have said this, but I'll repeat them - please make sure JAMs
play nicely with OSGi bundles.&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>A Continuation of another</title>
    <link>http://blog.adjective.org/post/2006/10/19/A-Continuation-of-another</link>
    <guid isPermaLink="false">urn:md5:d3d545515ba0879078058c4d57f98dcd</guid>
    <pubDate>Thu, 19 Oct 2006 01:10:00 +1000</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Development</category>
        <category>Java</category><category>Jetty</category>    
    <description>&lt;p&gt;&lt;a href=&quot;http://blogs.webtide.com/gregw/2006/10/18/1161127500000.html&quot;&gt;Greg&lt;/a&gt; has
blogged about the ThrottlingFilter I wrote for Jetty. He's covered the
situation quite well.&lt;/p&gt;    &lt;p&gt;I wrote the filter (with Greg's input) based a situation that was quite
similar to what he describes. There are a few other ways you can approach it
though.&lt;/p&gt;
&lt;p&gt;I've not tried it, but I believe it would be feasible to push the same logic
down into the connection pool (or any other pooled resource).&lt;/p&gt;
&lt;p&gt;Many pooling implementations (e.g. commons-pool/commons-dbcp) offer
configurable behaviour when the pool is full - a common behaviour is to block
as Greg describes in his blog entry. What could be useful is to be able to do
lost cost waiting - i.e. continuations from within the pool.&lt;/p&gt;
&lt;p&gt;The filter is nice in that it stops the unwanted request at the beginning of
the chain, before any processing time has been wasted on it, and when the
impact of retrying is quite low. The cost to that is that you need to be able
to split your application by URL. The filter needs to be able to tell whether
to throttle any given request.&lt;/p&gt;
&lt;p&gt;Putting that logic into the datasource would mean that some processing would
have already been performed before the request is suspended, and you would have
to be confident that the application is safe to retry. However it has the
advantage of being very precise - requests are only suspended when they attempt
to access an exhausted pool.&lt;/p&gt;
&lt;p&gt;I'm sure there are a lot of other possible ways to make use of
continuations. The use of continuations in the ThrottlingFilter was a
suggestion by Greg - I had originally intended to simply reject requests that
exceeded the maximum size until he reminded me how useful continutations would
be in that context. I'm sure that with a bit of imagination many other uses
could also be found.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Achieving closure</title>
    <link>http://blog.adjective.org/post/2006/10/17/Achieving-closure</link>
    <guid isPermaLink="false">urn:md5:2c867e73cb783b48d1aeb5bd172d52ed</guid>
    <pubDate>Tue, 17 Oct 2006 21:13:00 +1000</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Development</category>
        <category>Java</category>    
    <description>&lt;p&gt;Over the last week or so I've spent some time evaluating the &lt;a href=&quot;http://gafter.blogspot.com/2006/09/nominal-closures-for-java-version-02.html&quot;&gt;various&lt;/a&gt;
&lt;a href=&quot;http://www.writely.com/Doc.aspx?id=k73_1ggr36h&quot;&gt;closure&lt;/a&gt; &lt;a href=&quot;http://blogs.sun.com/jrose/entry/closures_without_function_types&quot;&gt;discussions&lt;/a&gt;
that are floating about.&lt;/p&gt;
&lt;p&gt;So, I sat down to write some code. Most of the situations where I've longed
for some sort of closure syntax are in iteration contexts - searching lists,
filtering lists, etc. - so my first test scenario was just that. I wanted to
iterate over a list of integers, and negate each one to produce a new list.
Then I wanted to iterate over that list and print out each number.&lt;/p&gt;    &lt;p&gt;Here's the code in idiomatic Java5 syntax:&lt;/p&gt;
&lt;pre&gt;
    public void sample( List&amp;lt;Integer&amp;gt; numbers )
    {
        List&amp;lt;Integer&amp;gt; inverse = new ArrayList&amp;lt;Integer&amp;gt;( numbers.size() );
        for( Integer i : numbers )
        {
            inverse.add( -i.intValue() ) ;
        }

        for( Integer i : inverse )
        {
            System.out.println(i);
        }
    }
&lt;/pre&gt;
&lt;p&gt;If we define a couple of interfaces and utility methods:&lt;/p&gt;
&lt;pre&gt;
    public static interface Mapper&amp;lt;FROM,TO&amp;gt;
    {
        public TO map(FROM arg);
    }

    public static interface Acceptor&amp;lt;FROM&amp;gt;
    {
        public void accept(FROM arg);
    }

    public static &amp;lt;FROM,TO&amp;gt; List&amp;lt;TO&amp;gt; map(Iterable&amp;lt;FROM&amp;gt; itr, Mapper&amp;lt;FROM,TO&amp;gt; mapper)
    {
        List&amp;lt;TO&amp;gt; result = new ArrayList&amp;lt;TO&amp;gt;();
        for( FROM el : itr )
        {
            result.add( mapper.map(el) ) ;
        }
        return result;
    }
    
    public static &amp;lt;FROM&amp;gt; void apply(Iterable&amp;lt;FROM&amp;gt; itr, Acceptor&amp;lt;FROM&amp;gt; apply)
    {
        for( FROM el : itr )
        {
            apply.accept(el);
        }
    }
&lt;/pre&gt;
&lt;p&gt;Then we can write that code in Java5 with anonymous inner classes:&lt;/p&gt;
&lt;pre&gt;
    public void sample( List&amp;lt;Integer numbers )
    {
        List&amp;lt;Integer&amp;gt; inverse = map( numbers,
            new Mapper&amp;lt;Integer,Integer&amp;gt;()
            {
                public Integer map(Integer i) { return -i.intValue() ; }
            }
        ) ;

        apply( inverse, 
            new Acceptor&amp;lt;Integer&amp;gt;()
            {
                public void accept(Integer i) { System.out.println(i); }
            }
        );
    }
&lt;/pre&gt;
&lt;p&gt;I would argue that this syntax is significantly uglier, and less clear than
the idiomatic java.&lt;/p&gt;
&lt;p&gt;Here's what we can do with &lt;a href=&quot;http://www.writely.com/Doc.aspx?id=k73_1ggr36h&quot;&gt;CICE&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;
    public void sample( List&amp;lt;Integer numbers )
    {
        List&amp;lt;Integer&amp;gt; inverse = map( numbers, Mapper&amp;lt;Integer,Integer&amp;gt;(Integer i) { return -i.intValue() ; }) ;
        apply( inverse, Acceptor&amp;lt;Integer&amp;gt;(Integer i) { System.out.println(i); });
    }

&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;-- please correct me if I've done something wrong with these samples -
none of the proposal authors provided a compiler to test with :)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The CICE example is a lot shorter than either of the Java5 examples
(although that's partly due to my choice in code style), but I'm not sure that
it's any more readable than the first version. One of the keys to clarity and
readability is to make the important bits stand out, and in this example that
doesn't really happen. Some of that is due to my choice in the parameter order,
and the fact that the apply and map methods are static rather than members of
Collection, but a large part of it is that there's a lot of characters that are
mostly redundant to my understanding of the code. I don't care that the map
method takes a Mapper&amp;lt;Integer,Integer&amp;gt; - I care that it is going to map
the elements through the expression &amp;quot;-i.intValue()&amp;quot;, and that is hidden at the
end of the statement in amongst the noise of the interface and type
parameters.&lt;/p&gt;
&lt;p&gt;However, the CICE example is pretty easy to understand. I didn't have to
keep consulting back to the spec to work out what I needed to write, and there
was only 1 syntax to learn (and most of that was syntax I already knew)&lt;/p&gt;
&lt;p&gt;My first attempt at a &lt;a href=&quot;http://gafter.blogspot.com/2006/09/nominal-closures-for-java-version-02.html&quot;&gt;BGGA
0.2&lt;/a&gt; example was:&lt;/p&gt;
&lt;pre&gt;
    public void sample(List&amp;lt;Integer&amp;gt; numbers)
    {
        List&amp;lt;Integer&amp;gt; inverse = map( numbers, (Integer i) { new Integer(-i.intValue()) } ) ;
        apply( inverse, (Integer i) { System.out.println(i) });
    }
&lt;/pre&gt;
&lt;p&gt;It's not a lot different from CICE. There's less noise, but more magic. I
don't need to &amp;quot;return&amp;quot; keyword in the map example, and I don't need semicolons
in either. However, within this choice of BGGA syntax, I don't think the
removal of those syntactical elements has aided the readability in any
meaningful way. In fact in both cases I originally had them in the code and
then realised they were not needed.&lt;/p&gt;
&lt;p&gt;I don't know whether the &amp;quot;new Integer(...)&amp;quot; is required. I suspect not, but
I'm really not 100% sure. Without it, the closure would return &amp;quot;int&amp;quot; rather
than &amp;quot;Integer&amp;quot; (the CICE example didn't have this confusion because I had
specified the return type as a type parameter). However the BGGA refers to &amp;quot;an
assignment conversion from the result type of T to the return type of U&amp;quot;, which
I can only hope includes auto-boxing. But is BGGA smart enough to know that it
should handle map&amp;lt;?,?&amp;gt;( List&amp;lt;Integer&amp;gt; int(Integer) ) by setting the
2nd type parameter to Integer and auto-boxing the closure result? I hope so.
The fact that I need to stop and think about it is a little worrying - there's
enough compiler magic going on that I can't really call this example &amp;quot;straight
forward&amp;quot;&lt;/p&gt;
&lt;p&gt;BGGA allows an alternate syntax for this sample:&lt;/p&gt;
&lt;pre&gt;
    public void sample(List&amp;lt;Integer&amp;gt; numbers)
    {
        List&amp;lt;Integer&amp;gt; inverse = map( Integer i : numbers) { -i.intValue() } 
        apply( Integer i: inverse ) { System.out.println(i) }
    }
&lt;/pre&gt;
&lt;p&gt;That certainly reads a little more succinctly. It looks a bit like the Java5
foreach syntax, but not quite. It's concise and readable, but it's a little bit
foreign.&lt;/p&gt;
&lt;p&gt;I'm not sure which proposal I prefer. CICE was easy to write, and easy to
understand, but I'm not sure it adds enough syntactical benefit to actually
make the language significantly better. If we end up with CICE closures, I
suspect a lot of people will keep writing code in the style of the first
example. That's OK - the first example is perfectly readable - but it might be
a sign that CICE doesn't give quite enough syntactical sugar. I do think CICE
will provide some readability benefits for list searching/filtering though.&lt;/p&gt;
&lt;pre&gt;
        List&amp;lt;Integer&amp;gt; positive = select( numbers, Predicate&amp;lt;Integer&amp;gt;(Integer i) { return i &amp;gt;= 0 ; }) ;
&lt;/pre&gt;
&lt;p&gt;is (IMO) more readable than:&lt;/p&gt;
&lt;pre&gt;
        List&amp;lt;Integer&amp;gt; positive = new ArrayList&amp;lt;Integer&amp;gt;( numbers.size() );
        for( Integer i : numbers )
        {
            if(i &amp;gt;= 0 ) 
            {
                positive.add( - i.intValue() ) ;
            }
        }

&lt;/pre&gt;
&lt;p&gt;But the BGGA:&lt;/p&gt;
&lt;pre&gt;
    List&amp;lt;Integer&amp;gt; positive = select( Integer i : numbers) { i &amp;gt;= 0  } 
&lt;/pre&gt;
&lt;p&gt;is significantly easier to read. It's clear what the code is trying to do -
it's less clear (particularly to less experienced developers) how it
accomplishes it.&lt;/p&gt;
&lt;p&gt;Ultimately, I see this as an intractable problem. The goal here is to add a
concise, neat and elegant syntax for closures to a language which is none of
those things. Any closure proposal that meets that goal is going to look out of
place in the overly-verbose, staticly-typed world of java. I want closures, I
think they're an important part of any modern programming language, but there's
a big risk of this turning into a case of lipstick on a pig.&lt;/p&gt;
&lt;p&gt;BGGA ends up providing a syntax that is quite similar to the syntax provided
by some other languages. The syntax really helps in writing concise,
intentional code, but it doesn't really have a &amp;quot;java feel&amp;quot; to it.&lt;/p&gt;
&lt;p&gt;Java isn't ruby. Even if we wanted to turn it into ruby, it's too late. So
java needs a closure syntax that looks and feels like java. I think BGGA misses
the mark on that one. But if we're going to add a closure syntax it at least
needs to offer some advantage over what we currently have, and I think CICE
falls down there.&lt;/p&gt;
&lt;p&gt;Turning to some of the semantic concepts involved, I really like that fact
that CICE treats everything as an implementation of a SAM. There's no new
types, no new methods on Class/Object, not much new to learn. It also forces
library writers to develop against interfaces rather than function types. This
has 2 specific advantages that I can think of&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Teams who reject the new syntax will not be prevented from using those new
APIs.&lt;/li&gt;
&lt;li&gt;It opens up some interesting possibilities to use dynamic proxies&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;But in the end I can't really support CICE for the use cases I've played
with here. It simply doesn't improve the clarity of the code sufficiently to
warrant a change to the language - even such a simple change. Perhaps when I
dig into more complex uses cases its value will show through, but for simple
cases, I can't see it.&lt;/p&gt;
&lt;p&gt;Neither proposal has yet included any discussion of APIs (or new syntax) for
manipulating closures. I haven't seen a nice way to perform currying in either
proposal (perhaps I'm just not imaginative enough), and neither proposal seems
to allow taking a reference to an existing method (either static or
non-static). In my &amp;quot;apply&amp;quot; example above, I see no real reason why I had to
write a new closure for System.out.println(i), that's already a void(Integer)
method, why can it not be assigned to a function type? In BGGA that syntax is
simple enough that the loss is quite small. In CICE that ability is missed.&lt;/p&gt;
&lt;p&gt;I didn't need any of the complex BGGA features. No synchronized parameters.
No non-local returns. No &amp;quot;Unreachable&amp;quot; types. I still question whether those
features are worth adding to the language. There's a lot of complexity there
for a fairly uncommon use case.&lt;/p&gt;
&lt;p&gt;Partly it's an issue of balance: One of my other concerns with CICE is that
it follows the same route the anonymous inner classes took us down the first
time - add minimal changes to the language in order to cater for a particular
set of use cases. I'm not sure that's what we need. We don't just need to be
able to do the same things better, we need to be able to do better things. We
all decided quite a long time ago that anonymous inner classes aren't enough to
provide the expressiveness developer are after. What happens when we decide
that CICE isn't enough either? Do we keep adding little bits of syntax until we
get where we want to go? I think BGGA is going the other direction. It's adding
a lot of stuff that we haven't tried before, and I don't think we (or they)
truly understand the consequences. Do we really need all of that functionality
now? Can we be confident that the decisions we make in our current relative
ignorance will turn out to be the right ones? Perhaps it is possible to
implement part of BGGA in Java 7 and then refine it after that. I'm not really
sure how to approach it, but it seems like a lot to through into the language
without a good feel for how it will play out.&lt;/p&gt;
&lt;p&gt;I'll be very disappointed if Java 7 ends up having either CICE (as it
currently stands) or BGGA (any version &amp;lt;= 0.2) because I don't think either
of the proposals manages to get the balance of &amp;quot;java-ness&amp;quot;, readability,
expressiveness, and clarity that we need.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Side Note: I wrote all the samples in vi, and was pleasantly surprised
to find I could still write java code without an IDE. I had expected to be
cursing at the unnecessary verbosity of java, but it was quite manageable for
the small snippets of code I was writing&lt;/em&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Pick an action - any action</title>
    <link>http://blog.adjective.org/post/2006/10/07/Pick-an-action-any-action</link>
    <guid isPermaLink="false">urn:md5:fc5de8c9bde36adf16d0a0fc6b953338</guid>
    <pubDate>Sat, 07 Oct 2006 11:46:00 +1000</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Politics</category>
            
    <description>&lt;p&gt;Clearly appropriate actions are better than endless talk. But are petty,
knee-jerk actions better than name-calling and insults? A lesson from the
Queensland government.&lt;/p&gt;    &lt;p&gt;There's a certain level of irony in a &lt;a href=&quot;http://statements.cabinet.qld.gov.au/MMS/StatementDisplaySingle.aspx?id=48312&quot;&gt;
media release&lt;/a&gt; titled &amp;quot;WOORABINDA HOUSING PROBLEMS NEED ACTION, NOT TALK&amp;quot;
that consists almost entirely of insults and derision.&lt;/p&gt;
&lt;p&gt;I don't think there's much more that needs to be said. It's quite depressing
that Queensland funds are being used to produce such rubbish, but I guess you
get what you vote for. &lt;em&gt;Disclaimer: I'm in NSW, so they're not my funds or
votes&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.andrewbartlett.com/blog/?page_id=374&quot;&gt;Here's&lt;/a&gt; the
press release that sparked Schwarten's tirade.&lt;/p&gt;
&lt;p&gt;(Found from &lt;a href=&quot;http://www.andrewbartlett.com/blog/?p=380&quot;&gt;Andrew
Bartlett's blog&lt;/a&gt;, I'm just a few days behind in my reading)&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Slum Survivor</title>
    <link>http://blog.adjective.org/post/2006/10/07/Slum-Survivor</link>
    <guid isPermaLink="false">urn:md5:8503a593175533447dfaef3d3ef2cd5b</guid>
    <pubDate>Sat, 07 Oct 2006 01:06:00 +1000</pubDate>
    <dc:creator>Tim</dc:creator>
        <category>Politics</category>
            
    <description>&lt;p&gt;Last weekend was a long weekend over here, so myself and 9 people I'd never
met set out to to build ourselves a slum...&lt;/p&gt;    &lt;p&gt;It was called &lt;a href=&quot;http://www.slumsurvivor.org/&quot;&gt;Slum Survivor&lt;/a&gt;, and
it helped me change some of my thinking about urban and rural poverty.&lt;/p&gt;
&lt;p&gt;For about 70 hours, we inhabited our own little slum town. 1 set of clothes,
1 water source, no showers, 2 meals a day (of rice + daal) , sleeping on wooden
pallets and cardboard. That's regular life for about 1 billion people - 1
person in 6 - on this planet. We did it for a few days and then got to go home,
but 80,000 people live &lt;em&gt;permanently&lt;/em&gt; in a garbage dump in Manila.&lt;/p&gt;
&lt;p&gt;The UN estimates that by 2030, &lt;strong&gt;2 billion&lt;/strong&gt; people will be
living in slums. That's 100 times the population of Australia. And today, as I
write this, for every man, woman and child in Australia there are 50 people in
the world without access to clean drinking water. 3,900 children &lt;em&gt;every
day&lt;/em&gt;, due to lack of clean drinking water and sanitation.&lt;/p&gt;
&lt;p&gt;Before &lt;a href=&quot;http://www.slumsurvivor.org/&quot;&gt;Slum Survivor&lt;/a&gt; those were
just numbers to me, but after a few days of having to live in our little slum,
it means a heck of a lot more to me now.&lt;/p&gt;</description>
    
    
    
      </item>
    
</channel>
</rss>