<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Todd Costella</title>
	<atom:link href="http://blog.toddcostella.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.toddcostella.com</link>
	<description>Crafting code.  bits at a time</description>
	<lastBuildDate>Wed, 16 Sep 2009 18:52:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GriffonCast</title>
		<link>http://blog.toddcostella.com/2009/09/griffoncast/</link>
		<comments>http://blog.toddcostella.com/2009/09/griffoncast/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 18:52:23 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[groovy]]></category>
		<category><![CDATA[griffon]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=117</guid>
		<description><![CDATA[My new GriffonCast project has been launched.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started a new project with the purpose of promoting the <a href="http://griffon.codehaus.org/">Griffon framework</a> and helping build the community around the project. The <a href="http://www.griffoncast.com">GriffonCast</a> is a screencast that I hope to produce at least once a month. </p>
<p>Griffon is a framework for building rich desktop applications. It leverages the Groovy programming language and a number of the key features of Groovy including builders. It&#8217;s a fantastic effort and while it&#8217;s still fairly early days, the team is making great headway with the <a href="http://griffon.codehaus.org/Road+Map">roadmap</a>. The <a href="http://www.griffoncast.com/episode-1/">first episode</a> of the GriffonCast is available for viewing and/or downloading. If you have any comments or would like to see specific topics covered drop me a note or post your thoughts on the Griffon <a href="mailto:user@griffon.codehaus.org">mailing list</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/09/griffoncast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java One 2009 &#8211; Online Resources</title>
		<link>http://blog.toddcostella.com/2009/06/java-one-2009-online-resources/</link>
		<comments>http://blog.toddcostella.com/2009/06/java-one-2009-online-resources/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 15:01:21 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=113</guid>
		<description><![CDATA[The slides for all the technical sessions have been posted at JavaOne Online Technical Sessions and Labs. You&#8217;ll need to be a SDN member but it&#8217;s free to sign up.
The Keynote videos are also available at General Session Details and Video Replays
There are also a number of audio interviews available at Java One Radio Podcast [...]]]></description>
			<content:encoded><![CDATA[<p>The slides for all the technical sessions have been posted at <a href="http://developers.sun.com/learning/javaoneonline/index.jsp">JavaOne Online Technical Sessions and Labs</a>. You&#8217;ll need to be a SDN member but it&#8217;s free to sign up.</p>
<p>The Keynote videos are also available at <a href="http://java.sun.com/javaone/2009/general_sessions.jsp">General Session Details and Video Replays</a></p>
<p>There are also a number of audio interviews available at <a href="http://www.apple.com/search/ipoditunes/?q=javaone+radio">Java One Radio Podcast</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/06/java-one-2009-online-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java One 2009 &#8211; Summary</title>
		<link>http://blog.toddcostella.com/2009/06/java-one-2009-summary/</link>
		<comments>http://blog.toddcostella.com/2009/06/java-one-2009-summary/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 04:03:55 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=109</guid>
		<description><![CDATA[Summary
In the blink of an eye the 2009 edition of Java One is over. It was a good conference. Not the best Java One I&#8217;ve been to but still very much worth the trip down to San Francisco. The biggest unknown is what impact Oracle&#8217;s purchasing of Sun will have on Sun&#8217;s direction of Java. [...]]]></description>
			<content:encoded><![CDATA[<h3>Summary</h3>
<p>In the blink of an eye the 2009 edition of Java One is over. It was a good conference. Not the best Java One I&#8217;ve been to but still very much worth the trip down to San Francisco. The biggest unknown is what impact Oracle&#8217;s purchasing of Sun will have on Sun&#8217;s direction of Java. There is a ton of momentum in Sun and in the community that Oracle would do well to respect initially. Seeing Larry Ellision on stage speaking with Scott McNealy about investing in the platform is a very good thing. On this, only time will tell. As expected Java/FX featured prominently in many of the sessions. I think this technology has some potential if Sun (and Oracle) stick with it. Sun has a habit of taking things to almost complete and then letting it languish. In many cases the community picks up the loose ends and tries to add libraries, frameworks etc. but that is getting old. There is a lot of engineering resources being placed on Java/FX right now and it looks like it&#8217;s tracking pretty well. I&#8217;m cautiously optimistic that they can pull this off.</p>
<p>I continue to be very excited about the momentum behind Groovy and related projects (Grails and Griffon). If nothing else, I came away from this year&#8217;s Java One with a renewed sense of optimism about the direction of this language and the community behind it. I got to meet a few people that I&#8217;ve only &#8216;met&#8217; through twitter from the Groovy and Griffon community and that&#8217;s great.</p>
<h3>Areas I&#8217;ll be digging into further in the coming days/weeks/months</h3>
<p>Teracotta&#8217;s Hibernate caching</p>
<p>JIRA</p>
<p>Hudson</p>
<p>Google Collections</p>
<p>Ribbon Component and the Substance Look and Feel</p>
<p>Griffon</p>
<h3>Areas that I&#8217;ll be keeping my eye on</h3>
<p>Java/FX, specifically components and layout managers.</p>
<p>Language Workbench from JetBrains</p>
<h3>Here are a few stats:</h3>
<p>3 Keynote presentations attended</p>
<p>15 Technical Sessions</p>
<p>7 Birds of a Feather Sessions</p>
<p>Visited with a &#8216;bunch&#8217; of vendors including a great hour with the guys at Atlassian talking about Jira, Clover and Bamboo</p>
<p>Met up and visited with a number of aquaintences and friends that I&#8217;ve me over the years at Java One, Java Posse Roundup and now on Twitter.</p>
<blockquote>
<p>Ken, Joe, Carl, Dick, Brendan, Pete, Stefan, Andres, Dave and Fred.</p>
</blockquote>
<p>Java One for me is more about the community and the conversation than it is about the technical content. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/06/java-one-2009-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java One 2009 &#8211; Day 4</title>
		<link>http://blog.toddcostella.com/2009/06/java-one-2009-day-4/</link>
		<comments>http://blog.toddcostella.com/2009/06/java-one-2009-day-4/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 03:59:17 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=106</guid>
		<description><![CDATA[Friday Keynote &#8211; The &#34;Toy Show&#34;
In what has become an anual tradition, James Gosling hosted a two hour session in which he highlights some of his favorite things by the Java community. It&#8217;s a good show and well worth a watch. I was pretty happy to see Brendan Humpries of Atlassian get a Dukie award [...]]]></description>
			<content:encoded><![CDATA[<h3>Friday Keynote &#8211; The &quot;Toy Show&quot;</h3>
<p>In what has become an anual tradition, James Gosling hosted a two hour session in which he highlights some of his favorite things by the Java community. It&#8217;s a good show and well worth a <a href="http://java.sun.com/javaone/2009/articles/toyshow.jsp">watch</a>. I was pretty happy to see Brendan Humpries of Atlassian get a Dukie award from James for his fine <a href="http://www.atlassian.com/software/clover/">Clover</a> product. Well deserved indeed. Other highlights for me included seeing a sneak preview of the Java/FX designer tool that Tor (and no doubt a cast of tens) have been working on for a while. The <a href="http://www.usfirst.org/">FIRST</a> robotic competition was also very interesting as well. Nice to see an organization working to give kids access to building cool things and learning about engineering and programming disciplines in a fun environment. As well the work being done by <a href="http://www.mifos.org/developers">Mifos</a> in the realm of Micro Financing (like <a href="http://kiva.org">kiva.org</a>) is very inspiring.</p>
<h3>Getting Started with WidgetFX: Open-Source Widget Desktop Platform </h3>
<p>WidgetFX is the widget desktop platform developed by Stephen Chin. I&#8217;m not 100 percent sure but I think 	Joshua Marinacci is involved with the project a bit. This widget platform was at least inspired from Josh&#8217;s AB5K/Glassitope swing based widget framework. It sounds like the Java/FX implementation makes this sort of thing easier to do than the Swing equivilant. Looks like an interesting project but to be honest I&#8217;m not a big user of Google gadgets/Apple&#8217;s Dashboard etc. I suppose if there was a bunch of cool widgets that would make my life easier then maybe I would be a bigger fan but it&#8217;s not one of those things that I&#8217;m that interested in. I do need to have a closer look at the Nabaztag rabbit he had wired up to a widget. Would make a great build monitor.</p>
<h3>Defective Java Code: Mistakes That Matter</h3>
<p>Bill Pugh, the creator of the findbugs project has presented at a number of Java Ones in previous years. He&#8217;s always entertaining and has a ton of great content. He&#8217;s currently on sabatical at Google and had a few observations about some patterns that he found. Find Bugs is one of those tools that I&#8217;ve looked at a few times but haven&#8217;t really done much with. It&#8217;s something I want to integrate into our incremental build process but there is the potential of sending the team off into bug fixing mode without any direction.</p>
<p>Bill had some good advice that would make this process easier I think.</p>
<ul>
<li>Start with new code. Changes will be fresh in the developers mind and the chance of introducing a side effect into working code is zero.</li>
<li>As a team, identify the types of bugs you want to concentrate on. We wouldn&#8217;t be worried about SQL injection bugs for example but might be very interested in threading issues.</li>
<li>One approach that worked at Google was after identifying the bugs you want to concentrate on, have a bug fixing day or two or three. Make it a fun experiment with the goal of keeping unit tests running and squishing as many bugs as the team can in a short period of time.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/06/java-one-2009-day-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java One 2009 &#8211; Day 3</title>
		<link>http://blog.toddcostella.com/2009/06/java-one-2009-day-3/</link>
		<comments>http://blog.toddcostella.com/2009/06/java-one-2009-day-3/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 03:54:28 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=103</guid>
		<description><![CDATA[The New World: JavaFX™ Technology-Based UI Controls,Breathe in JavaFX™ Technology,Flamingo: Bringing the Ribbon Component to Swing,This Is Not Your Father’s Von Neumann Machine; How Modern Architecture Impacts Your Java™ Apps,JideFX: Bringing Desktop Richness to the Internet,The Groovy and Grails BOF: With Live Grails Podcast Recording!]]></description>
			<content:encoded><![CDATA[<h3> The New World: JavaFX™ Technology-Based UI Controls</h3>
<p>Just prior to Java One the Java/FX team released version 1.2 which includes some of the basic UI components that applications use. (Buttons, textfields, radio buttons, sliders etc.) This session went over the list of implemented components and introduced project Caspian which is the intial look and feel/theme/skin that these components can use out of the box. The session also went into a bit of detail of how some of the new layout managers are implemented. It&#8217;s still very early days and the team knows full well that the components they released just before Java One is not a comprehensive list (there is no table, combo boxes etc) and the layout managers implemented are pretty simplistic. There is so much work to do to round this implementation out it&#8217;s not funny but there appears to be a huge engineering effort behind this implementation so I echo that I&#8217;m cautiously optimistic about this. Sun appears to have their A-Team working on all aspects of this implementation including the designer tool which was previewed this week as well. </p>
<h3>Breathe in JavaFX™ Technology</h3>
<p>Of all the years I&#8217;ve been to Java One, I&#8217;ve never taken advantage of any of the Hands-on-Labs. To be honest in previous years there really hasn&#8217;t been that much that interested me. I decided this year to change that and sit through a Java/FX one. I figured 90 minutes of going through a tutorial would be a good use of time and if nothing else would give me a bit of expsoure to the language and implementation that up until this point has been mostly theoretical. This was a Bring your own laptop tutorial which required the installation of the latest NetBeans IDE preconfigured with version 1.1.1 of Java/FX. The presenter introduced the three different tutorials that were included, stepped folks through the first few steps and then let folks proceed at their own pace. There were a number of helpers available if participants needed a hand or couldn&#8217;t get something working. </p>
<p>The first tutorial was a photo viewer application that displayed a number of photos with buttons to navigate forwards and backwards through the photos. We added various kinds of transitions using Timelines with KeyFrames. The tutorial was really well done but like most tutorials the reasons why a particular implementation was chosen was not explained. It does provide a good set of examples though to dig further into. The NetBeans implementation of drag and drop coding with the Java/FX elements was interesting to see. Code completion needs a bit of work still and as I&#8217;ve mentioned I&#8217;m not a heavy NetBeans user so some of time was spent just trying to figure out how to do common things in the IDE.</p>
<p>I have the content from the tutorials so it will be something I have a look at in the coming weeks/months to continue getting some exposure to this fast moving addition to the Java platform.</p>
<h3>Flamingo: Bringing the Ribbon Component to Swing</h3>
<p>Of all the sessions I attended, I think I was most surprised by this one. Don&#8217;t get me wrong there was a ton of great content in a lot of the sessions but I guess for this one I didn&#8217;t really have any sort of expectations going into it and came away with a sense of ok, here is something I really need to look at.</p>
<p> The Ribbon Component was introduced by Microsoft in the latest version of Office after conducting a huge amount of User Interaction studies. It&#8217;s quite a huge change for Microsoft and there have been some negative reactions from users but they believe that this metaphor makes learning and using their products much easier. Kirill Grouchnikov, who is probably most known for his fabulous work with the Substance Look and Feel has been implementing a Swing incarnation of the Ribbon Component. He spent quite bit of time talking about the various elements of the ribbon component (tasks, bands, application menu button, taskbar panel etc.) and how they work together to convey meaning and more important context to the user as they are using the application. He pointed out a blog by <a href="http://blogs.msdn.com/jensenh">Jensen Harris</a> at Microsoft that  details the evolution of their implementation. I haven&#8217;t had a chance to look at it yet but it sounded very interesting.</p>
<p>Additionally he showed an implementation of KeyTips which, when invoked, show shortcut keys to the components in the Ribbon control. It&#8217;s really well done and something that has been missing from the Desktop world for a while. </p>
<p>This one has the potential of changing our UI implementation substantially. It of course needs some careful thought and consideration but I like it and if we can perhaps add it as an adjunct to our current UI implementation that might be the best path forward. </p>
<p>&nbsp;</p>
<h3>This Is Not Your Father’s Von Neumann Machine; How Modern Architecture Impacts Your Java™ Apps</h3>
<p>This session was done by was Cliff Click and Brian Goetz key guys in implementing the JVM. They spoke at break neck speed about the evolution of CPU and Memory architectures over the years and how developers need to be aware of how hardware implementation may impact their code from a performance and reliability point of view. A lot of the content was really only applicable if you&#8217;re writing your own compiler/VM but it&#8217;s still good to have an idea what is going on under the hood as it were. There was a reference to a paper that sounds interesting called <a href="http://people.redhat.com/drepper/cpumemory.pdf">What every programmer should know about memory</a>. </p>
<h3>JideFX: Bringing Desktop Richness to the Internet</h3>
<p>David Qiao the CTO for JideSoft presented a few ideas about how they hope to bring their excellent set of Jide components to the JavaFX world. He didn&#8217;t really have much to show aside from a couple of examples that are very much works in progress. I&#8217;m sure it&#8217;s hard for component writers at the moment given the pace of development and missing bits with the Java/FX platform but in all honesty I don&#8217;t know why he presented anything. It&#8217;s much too early.</p>
<h3>The Groovy and Grails BOF: With Live Grails Podcast Recording!</h3>
<p>Sven Haiges and Glen Smith of the Grails Podcast hosted a panel with Scott Davis, Dierk König, Andres Almiray, James Williams and Danno Ferrin. They took questions from Sven and Glen as well as from the audience. It was very entertaining well worth a <a href="http://www.grailspodcast.com/blog/id/252">listen</a>.  I discovered <a href="http://code.google.com/p/spock/">Spock</a> which is a fairly new unit testing framework that sounds very interesting and bears some closer investigation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/06/java-one-2009-day-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java One 2009 &#8211; Day 2</title>
		<link>http://blog.toddcostella.com/2009/06/java-one-2009-day-2/</link>
		<comments>http://blog.toddcostella.com/2009/06/java-one-2009-day-2/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 03:44:15 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=100</guid>
		<description><![CDATA[Java One 2009 - Day 2. Extreme GUI Makeover (Hybrid Swing and JavaFX™ Technology), Move Your Users: Animation Principles for Great User Experiences,The Magic of the JXLayer Component,JavaFX™ Programming Language + Groovy = Beauty + Productivity,Hudson Community Meet-Up and Griffon in Depth]]></description>
			<content:encoded><![CDATA[<h3>Extreme GUI Makeover (Hybrid Swing and JavaFX™ Technology)</h3>
<p>In this session, Amy Fowler, Jasper Potts, Paru Somasheka and David Grieve all from Sun took the Swing application that was written  for <a href="http://developers.sun.com/learning/javaoneonline/j1sessn.jsp?sessn=TS-1548&amp;yr=2006&amp;track=desktop">last year&#8217;s installment</a> of the GUI Makeover and added a bit of Java/FX. The idea is that there is a bit of a migration path for existing swing applications to Java/FX.</p>
<p>javafx.ext.swing.SwingComponent is the Java/FX component that can be used to wrap any existing swing component. The resultant object is a Node object that can be added to the FX scene graph. This is a decent approach but the biggest drawback is that none of the core elements for Java/FX (like transitions) can be applied to the contents of these kinds of nodes. They showed the CSS skinning approach that can be taken with Java/FX applications. It&#8217;s a good idea to separate the style (colour, font, size etc) from the actual components. Lastly Jasper showed an illustration of a an annimation on the Scene Graph. </p>
<p>It was pretty impressive all in all.</p>
<h3>Move Your Users: Animation Principles for Great User Experiences</h3>
<p>This session was presented by Chet Haas and Romain Guy. They introduced 12 animation principals that are documented in the book. The principals are related to traditional animation (cartoons) but they are very applicable to computer animation as well. They followed up a description of each of the principals with it&#8217;s application in building rich user interfaces on desktop applications. They did a great job. The content is something folks should consider when they&#8217;re implementing any sort of animation in their applications even things as simple as a fade transition or a scale. It&#8217;s really easy to get this stuff wrong and learning from the masters of animation who have been thinking about this stuff for almost a century could make a huge difference in your application.</p>
<p>The 12 principals are:</p>
<ul>
<li>Squash and Stretch</li>
<li>Anticipation</li>
<li>Staging (poses, camera angle, focus)</li>
<li>Straight ahead vs. pose to pose (related to transitions)</li>
<li>Follow through and overlapping action (objects should obey physical reality)</li>
<li>Slow in and out (non linear timing)</li>
<li>Arcs (things generally don&#8217;t move in a perfectly straight line)</li>
<li>Secondary Action (an additional action that gives context to the main action)</li>
<li>Timing </li>
<li>Exaggeration</li>
<li>Solid Drawing</li>
<li>Appeal</li>
</ul>
<p>One of the sources for their presentation was <a href="http://www.amazon.com/Illusion-Life-Disney-Animation/dp/0786860707/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1244404789&amp;sr=8-1">The Illusion of Life: Disney Animation</a></p>
<h3>The Magic of the JXLayer Component</h3>
<p>This session introduced the JXLayer component which is currently a <a href="https://jxlayer.dev.java.net/">java.net project</a>. JXLayer is a wrapper or more precisely implements the decorator pattern for Swing Components. It has a bunch of different uses including a very lightweight way of disabling compound components, implementing mouse wheel scrolling as well a many other uses. We use this component in our framework quite a bit mostly in and around our UI security implementation. It&#8217;s great and if you write any Swing code and don&#8217;t know about this component go have a look. It was also announced in this session that this component is being promoted into  JDK 7.</p>
<h3>JavaFX™ Programming Language + Groovy = Beauty + Productivity</h3>
<p>Dierk König author of Groovy in Action (still the best book on Groovy written to date in my opinion), presented a couple of different approaches to integrate groovy with Java/FX. One strategy is to use Java/FX for client code and then use a REST layer to have the Java/FX client talk to a back end written in Groovy (or Grails for that matter). This approach is pretty clean but you don&#8217;t get to take advantage of any Groovy code on the client.</p>
<p>Both Java/FX and Groovy are JVM languages and ultimately emit bytecode from their respective compilers. It is possible to reference Java/FX components from within Groovy but it&#8217;s messy. Andres Almiray has a JavaFX builder in the Griffon Project that begins to make this integration easier but it&#8217;s still early days.</p>
<p>The short answer is that true integration at this point in time is hard and will get better as Java/FX matures.</p>
<h3>Hudson Community Meet-Up</h3>
<p>I&#8217;ve been looking into <a href="http://hudson.dev.java.net">Hudson</a> for a few months now and it just keeps getting better and better. The project lead (Kohsuke Kawaguchi) gave a bit of background and some of the current trends of Hudson. The growth of the product and the community surrounding it since last Java One is very impressive. Plugins for Hudson are one of the distinguishing features. Tom Huybrechts from AGFA Healthcare demoed a new plugin he wrote that implements the JBoss Rules Engine (drools) within Hudson. Layered on top of it is a graphical builder for building workflow steps, gathering input at various points in the workflow and a ton of other cool stuff. It was very impressive and something I want to take a closer look at.</p>
<p>Netbeans project integration was also demoed (actually talked about as there was a technical glitch with the netbeans machine/projector combo). It would be interesting to monitor builds from within Netbeans, kick them off etc. but given that we&#8217;re an IntelliJ shop it&#8217;s not that relevant. There may be some form of plugin for IntelliJ but the web interface is great so I&#8217;m not sure we would even look at it.</p>
<h3>Griffon in Depth</h3>
<p> Danno Ferrin and James Williams gave an introduction to <a href="http://griffon.codehaus.org/">Griffon</a> which is a <a href="http://grails.codehaus.org/">Grails</a> inspired framework for building Swing applications in Groovy. It&#8217;s still very early days with the project however the project team has leveraged all of the great work from the Grails project in bootstrapping the Griffon project. This is one technology that I&#8217;m quite excited about. Writing swing apps in Groovy is possible (see <a href="http://blog.toddcostella.com/2009/03/groovyswingyqlgoogle-maps-lightning-talk/">this post</a> for an example) however writing a big Swing app would be quite a lot of work. The idea behind Griffon is to put a framework in place to support building Swing applications with the same sort of velocity the web guys are seeing with frameworks like Grails and Ruby on Rails. The fellows demoed a few applications written in Griffon the most impressive one was Greet which is a Twitter client written in Griffon. I wish the fellows much luck with this project and I&#8217;m trying to figure out a way I can help in some small way. Swing and Groovy in the same stack makes me very happy <img src='http://blog.toddcostella.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/06/java-one-2009-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java One 2009 &#8211; Day 1</title>
		<link>http://blog.toddcostella.com/2009/06/java-one-2009-day-1/</link>
		<comments>http://blog.toddcostella.com/2009/06/java-one-2009-day-1/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 23:28:25 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=91</guid>
		<description><![CDATA[General Session

Pretty typical of previous years. Billions of devices, millions of developers blah blah blah.
Java Store introduced. Strikes me a bit of me too wrt to the Apple App Store. No relevance for Entero.
Scott McNally and Larry Ellison talk about the future of the platform (with all sorts of caveats about future looking statements). Said [...]]]></description>
			<content:encoded><![CDATA[<h2>General Session</h2>
<ul>
<li>Pretty typical of previous years. Billions of devices, millions of developers blah blah blah.</li>
<li><a href="http://store.java.com/">Java Store</a> introduced. Strikes me a bit of me too wrt to the Apple App Store. No relevance for Entero.
<li>Scott McNally and Larry Ellison talk about the future of the platform (with all sorts of caveats about future looking statements). Said most of the right things. Look to keep investment up in R&amp;D plus continue with Java/FX. Cautiously optimistic here.</li>
<li>Lots of partner demos, nothing too exciting.</li>
</ul>
<h3>Deploying Java™ Technology to The Masses: How Sun Deploys The JavaFX™ Runtime</a></h3>
<p>Good first session. Interesting to see that Sun has the same sort of problems as everyone else wrt deploying content to the desktop. There were a few good practical tips that I&#8217;ll want to dig into.</p>
<ul>
<li>Pack200</li>
<li>JNLP additional tags.</li>
</ul>
<h3>Extreme Swing Debugging: The Fast and the Furious</h3>
<p>This was an introduction to the java.net <a href="https://swingexplorer.dev.java.net/">Swing Explorer</a> project. This is a project that I&#8217;m familiar with but it was good to see the EDT violations feature as well as using the &#8220;Player&#8221; feature to find painting issues. It&#8217;s a great tool to have in your swing debugging arsenal. </p>
<h3>Tuesday Afternoon Technical General Session</h3>
<ul>
<li><a href="http://openjdk.java.net/projects/jdk7/milestones/">Roadmap for JDK 7</a></li>
<li>Modularity</li>
<li>Project Coin (small language changes)</li>
<li>EE 6</li>
</ul>
<h3>Extending Java™ Technology and Developing DSLs with the JetBrains MPS Open-Source Language Workbench</h3>
<p>This was an interesting session for sure. The folks at JetBrains have a tool<br />
they call <a href="http://www.jetbrains.com/mps/index.html">Meta Programming System Workbench</a> that is used for designing and working with domain specific languages. It built on the core IntelliJ platform and has a lot of really great features. I was thinking we could use it for embedding in our application for our users to build scripts initially. Longer term I&#8217;m thinking that implementing our formula pricing model in a DSL is the way to go but am still not sure about that. Regardless, this may be a tool that might make that easier.</p>
<ul>
<li>Development environment for building domain specific languages</li>
<li>Handles compiling and parsing</li>
<li>Works directly on the AST</li>
</ul>
<h3>An Introduction to Complex Event Processing on the Java™ Platform</h3>
<p>This is an area I know nothing about. Complex Event Processing deals with the query and visualization of huge data volumes. Real time systems for things like stock trades or perhaps data that comes from SCADA systems. There is a branch of Computer research that deals with this sort of volume. There is a query language called CQL that is like SQL but has a temporal component to the query language. It also has specific constructs for filtering and aggregation of massive datasets. This content was presented by Oracle/BEA where they touched on their <a href="http://www.oracle.com/technologies/soa/complex-event-processing.html">product</a>.</p>
<h3>Toward a Renaissance VM</h3>
<p>This was a fascinating session by John Rose and Brian Geotz of Sun. They dove into some of the very nasty problems that modern compiler writers are grappling with. The JVM hosts a number of languages and has for quite some time. <a href="http://jcp.org/en/jsr/detail?id=292">JSR-292</a> (Supporting Dynamically Typed Languages on the Java Platform) is the JSR under which this work is being done. I left this session feeling very humbled and grateful that there are some very smart guys working on new VM extensions that are going to make my life easier in the future.</p>
<h3>Creating Java™ Technology-Based Applications for Mac OS X: Is It Cocoa or Is It Java Technology?</h3>
<p>I love my Mac but am a little frustrated with Apple in the pace that they implement the JVM on OS/X. They are on 1.6 finally but Apple took a long time to get there. Regardless, there are a bunch of folks in the Java community that have stepped in to help making Java Swing apps on OS/X easier. In this session, Deane Richan from the <a href="http://xito.org">Xito</a> project spoke about a number of strategies for improving the integration of a Java Swing application on OS/X such that the swing app looks closer to a native OS/X application. Good session and a project I want to take a closer look at.</p>
<h3>The Collections Connection (Gala Tenth Edition)</h3>
<p>Josh Bloch, the creator of the Java collections library has been doing this Birds of a Feather Session for about 12 years (I think he missed a couple along the way which is why this is the tenth one). I&#8217;ve been to a bunch of them and always come away learning something new. Josh left Sun to work at Goggle a couple years ago. He is still very active in the Java community and continues to make huge contributions to the platform. This year he brought along a couple of his colleagues from Google; Martin Buchholz and Kevin Bourrillion. They spoke of a few things that might be coming in JDK7 but more interesting (from my point of view) is they also touched on the <a href="http://code.google.com/p/google-collections/">Google Collections</a> package which adds a number of &#8216;missing&#8217; collection implementations. It&#8217;s something I&#8217;ve wanted to take a look at for a while and even more so after hearing about some of the implementations in this framework.</p>
<h3>Meet the Java Posse</h3>
<p>Of course I&#8217;m going to pop in and see the guys do their third annual <a href="http://javaposse.com/index.php?post_id=487315">Podcast</a> from Java One. It was a packed room and the fellows didn&#8217;t disappoint. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/06/java-one-2009-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java One 2009 &#8211; Day 0</title>
		<link>http://blog.toddcostella.com/2009/06/java-one-2009-day-0/</link>
		<comments>http://blog.toddcostella.com/2009/06/java-one-2009-day-0/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 17:59:26 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=82</guid>
		<description><![CDATA[Registration and Visiting the Vendor Pavilion at Java One 2009 ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in San Francisco this week for <a href="http://java.sun.com/javaone/">Java One</a>. This may be the last Java One with Oracle buying Sun. Too early to speculate on that but regardless things will be different next year.</p>
<p>I&#8217;m down here with a couple of fellows from work, Glen and Shawn. It&#8217;s the first time I&#8217;ve had any one from Entero down  here with me so that&#8217;s pretty cool. There is always way to much to see so perhaps with the three of us, we&#8217;ll get a chance to cover more content.</p>
<p>We registered (a process that Sun and the conference organizers have pretty much nailed), picked up our conference materials and walked around getting the lay of the land. When the vendor pavilion floor opened, we wandered around there for a bit, picked up a few T-Shirts and bumped into Glen. </p>
<p>The thing I noticed walking around the show floor was the number of larger companies missing that were there in previous years. Oracle had a huge presence last year, this year nothing (probably related to the merger). IBM is not here (sour grapes re:merger ?), Google, not here. There is some alternate universe thing going on as Microsoft is here with a pretty large presence. It&#8217;s a bit odd compared to previous years.</p>
<h3>Ice Soft</h3>
<p>The fellows from <a href="http://www.icesoft.com/">Ice Soft</a> are here. My friend Ken is one of the dev leads so it&#8217;s always good to catch up with them. He did a demo of some of the new gear they have on the go for their IceFaces product. They stuff they do is pretty cool however it&#8217;s all web/ajax/Java Server Faces which is a technology stack we don&#8217;t dabble in.</p>
<h3>Terracotta</h3>
<p>Shawn and I also had a great discussion with a couple of developers from <a href="http://www.terracotta.org/">Terracotta</a>. We need to do some serious R&#038;D into a second level cache for our domain layer and Terracotta is probably the way we&#8217;re going to go. They are implementing their own hibernate caching strategy within their clustering technology. It has some monitoring and configuration tools that look pretty impressive. Shawn put his name in for the beta program so we&#8217;ll take some time in the coming weeks to put Terracotta through it&#8217;s paces.</p>
<h3>Atlassian</h3>
<p>The other company I want to spend some time with is <a href="http://www.atlassian.com">Atlassian</a>. We use a bunch of their products including Crucible, FishEye and Confluence. Pete and Brendan (two fellows I&#8217;ve met at the Java Posse Roundup) have pretty senior development/management positions at Atlassian but they were over at the Atlassian summit. I&#8217;ll hopefully get a chance to meet up with them later in the week and catch up.</p>
<h2>First Impressions</h2>
<p>I&#8217;m of a bit of mixed mind about Java One this year. On the one hand, it&#8217;s great to be in San Francisco, getting a chance to hang out with folks that I&#8217;ve come to know over the years. There is always a cool vibe around the conference. It is different though. There does seem to be a certain pall though. Major change is afoot and it seems like there is a lot of uncertainty about the future. I am looking forward to the week though.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/06/java-one-2009-day-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java One 2009 &#8211; What I&#8217;m Looking Forward to</title>
		<link>http://blog.toddcostella.com/2009/04/java-one-2009-what-im-looking-forward-to/</link>
		<comments>http://blog.toddcostella.com/2009/04/java-one-2009-what-im-looking-forward-to/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 15:02:07 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=75</guid>
		<description><![CDATA[I&#8217;ll be heading to San Francisco in the first week of June for the 2009 edition of Java One. I&#8217;ve been fortunate to attend something like eight or nine years and find it interesting to see the trends and how things like the economy affect attendance and the type of folks that come.
Java FX
I&#8217;m sure [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be heading to San Francisco in the first week of June for the 2009 edition of <a href="http://java.sun.com/javaone/">Java One</a>. I&#8217;ve been fortunate to attend something like eight or nine years and find it interesting to see the trends and how things like the economy affect attendance and the type of folks that come.</p>
<h3>Java FX</h3>
<p>I&#8217;m sure this year will be all about the Desktop (again) with <a href="http://www.sun.com/software/javafx/">Java FX</a>. I&#8217;m mildly interested to see what all the hype is about. I&#8217;ve been a Swing guy for most of my Java life and while I am excited about seeing some of the new shiny tools and techniques (Scene Graph being very high up there), part of me is sad to see so much engineering time and resources being focused on this. Amy Fowler is doing a session entitled <a href="http://www28.cplan.com/cc230/session_details.jsp?isid=305575&#038;ilocation_id=230-1&#038;ilanguage=english">Extreme GUI Makeover (Hybrid Swing and JavaFX™ Technology)</a> which promises to be a Pimp my Swing App with Java/FX. </p>
<h3>Groovy</h3>
<p>I first learned about Groovy at Java One in 2004 where James Strachan gave an introduction and overview of the language. This was the first time I had considered using anything else except for Java on the JVM and I remember having one of those &#8216;light bulb&#8217; moments in the session. It&#8217;s totally changed the way I think about the JVM and languages in general. We&#8217;re a pretty heavy user of groovy in our application and I&#8217;m quite excited to see a number of Groovy sessions at Java One this year.</p>
<p>Some of the sessions that have caught my eye are:<br />
<a href="http://www28.cplan.com/cc230/session_details.jsp?isid=304215&#038;ilocation_id=230-1&#038;ilanguage=english">What&#8217;s New in Groovy 1.6?</a> with Guillaume Laforge<br />
<a href="http://www28.cplan.com/cc230/session_details.jsp?isid=305189&#038;ilocation_id=230-1&#038;ilanguage=english">Griffon in Depth</a> with Danno Ferrin and James Williams<br />
<a href="http://www28.cplan.com/cc230/session_details.jsp?isid=304961&#038;ilocation_id=230-1&#038;ilanguage=english">&#8220;Design Patterns&#8221; for Dynamic Languages on the JVM™ Machine</a> with Neal Ford<br />
<a href="http://www28.cplan.com/cc230/session_details.jsp?isid=303979&#038;ilocation_id=230-1&#038;ilanguage=english">The Groovy and Grails BOF: With Live Grails Podcast Recording!</a> with Sven Haiges and Glen Smith of <a href="http://grailspodcast.com/">The Grails Podcast</a></p>
<h3>Java EE</h3>
<p>Not nearly as sexy as Java/FX, the Java EE space will probably see some new announcements and updates on some of the key JSRs. I haven&#8217;t really been following the progress of the JCP that closely and can usually get all I need to satisfy my curiosity at Java One.</p>
<h3>Summary</h3>
<p>I&#8217;m really looking forward to it. San Francisco is one of my favorite cities and having been there a few times I&#8217;m starting to have a few favorite haunts including a <a href="http://en.wikipedia.org/wiki/Tadich_Grill">new one</a> I found last year. If you&#8217;re going to Java One this year, drop me a note on <a href="http://twitter.com/ToddCostella">Twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/04/java-one-2009-what-im-looking-forward-to/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Groovy/Swing/YQL/Google Maps Lightning Talk</title>
		<link>http://blog.toddcostella.com/2009/03/groovyswingyqlgoogle-maps-lightning-talk/</link>
		<comments>http://blog.toddcostella.com/2009/03/groovyswingyqlgoogle-maps-lightning-talk/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 04:34:31 +0000</pubDate>
		<dc:creator>todd</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://blog.toddcostella.com/?p=41</guid>
		<description><![CDATA[I decided to write a little Groovy app that displayed a few participants from the roundup and their origin airports on a Google map.  I wanted to illustrate a few common Groovy idioms and illustrate how easy it is to create a pretty functional app in just a few lines of code. ]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Lightning_Talk">Lightning talks</a> are another very cool aspect to the Java Posse Roundup. The lightning talks we do are five minutes long and they cover a wide range of topics. All the lightning talks are posted on the Java Posse <a href="http://www.youtube.com/javaposse">YouTube Chanel</a>.  The recording for this lightning talk (of which the rest of this post describes) is here.</p>
<p><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/CgEbyZc68Qw&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/CgEbyZc68Qw&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object><br />
</br></br><br />
If you would rather not hear me blather on describing this code, you can see a quick 20 second demo of the running application here.<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/vXZqSXVDxaw&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vXZqSXVDxaw&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>I decided to write a little groovy app that displayed a few participants from the roundup and their origin airports on a Google map.  I wanted to illustrate a few common Groovy idioms and illustrate how easy it is to create a pretty functional app in just a few lines of code.<br />
</br></p>
<p>The first thing of note in the script is a small class that represents an Attendee. Notice there is no constructor, no getters or setters. The only method in the class is the toString method. This method isn&#8217;t actually called in the script but I wanted to illustrate what a simple Groovy String (GString) looks like. The method has an implicit return (as the string is the last statement in the method). The String has references to the properties in the class. These properties are enclosed by ${}.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Attendee <span style="color: #66cc66;">&#123;</span>
  <span style="color: #aaaadd; font-weight: bold;">String</span> name
  <span style="color: #aaaadd; font-weight: bold;">String</span> lastName
  <span style="color: #aaaadd; font-weight: bold;">String</span> email
  <span style="color: #aaaadd; font-weight: bold;">String</span> origin
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #aaaadd; font-weight: bold;">String</span> toString<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">&quot;Name:${name} Last name:${lastName} eMail:${email} origin:${origin}&quot;</span><span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The next few lines of code construct new instances of our Attendee class, one for each attendee. Normally these would come from some sort of datasource like a database or something but to keep this example simple, they are just hardcoded here. There are a few things of interest in this code. The first thing to note is that the attendees variable is dynamically typed. It is constructed using an ArrayList that is typed. This is really just to illustrate that Groovy does support Java generics. A typical declaration of a list in groovy would be <strong>def attendees = []</strong> the [] are shorthand for new empty ArrayList().<br />
</br></br><br />
The next interesting feature is the &lt;&lt; construct. This is the equivalent of attendees.add().<br />
</br></br><br />
The last thing to note in this example is the way we&#8217;re constructing the Attendee class. We have a comma separated list of values that are prefixed by property names. Notice that in our class definition we don&#8217;t have a constructor. This is one of the nice features of Groovy, named parameters.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">def</span> attendees <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #66cc66;">&lt;</span>Attendee<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Peter&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Pilgrim&quot;</span>, email: <span style="color: #ff0000;">&quot;pp@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;IAD&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Joel&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Neely&quot;</span>, email: <span style="color: #ff0000;">&quot;jn@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;MEM&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Dianne&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Marsh&quot;</span>, email: <span style="color: #ff0000;">&quot;dm@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;DTW&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Carl&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Quinn&quot;</span>, email: <span style="color: #ff0000;">&quot;cq@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;SJC&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Dick&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Wall&quot;</span>, email: <span style="color: #ff0000;">&quot;dw@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;SJC&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Joe&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Nuxoll&quot;</span>, email: <span style="color: #ff0000;">&quot;jn@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;SJC&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Bill&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Pugh&quot;</span>, email: <span style="color: #ff0000;">&quot;pp@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;SJC&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Dave&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Briccetti&quot;</span>, email: <span style="color: #ff0000;">&quot;db@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;SFO&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Todd&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Costella&quot;</span>, email: <span style="color: #ff0000;">&quot;tc@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;YYC&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Ståle&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Undheim&quot;</span>, email: <span style="color: #ff0000;">&quot;su@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;FRA&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Eirik&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Bjørsnøs&quot;</span>, email: <span style="color: #ff0000;">&quot;eb@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;MUC&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Andrew&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Harmel-Law&quot;</span>, email: <span style="color: #ff0000;">&quot;al@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;EDI&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Oliver&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Gierke&quot;</span>, email: <span style="color: #ff0000;">&quot;og@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;ORD&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Joe&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Sondow&quot;</span>, email: <span style="color: #ff0000;">&quot;js@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;LGA&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Fred&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Simon&quot;</span>, email: <span style="color: #ff0000;">&quot;fs@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;ORD&quot;</span><span style="color: #66cc66;">&#41;</span>
attendees <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Attendee<span style="color: #66cc66;">&#40;</span>name: <span style="color: #ff0000;">&quot;Daniel&quot;</span>, lastName: <span style="color: #ff0000;">&quot;Watson&quot;</span>, email: <span style="color: #ff0000;">&quot;dw@example.com&quot;</span>, origin: <span style="color: #ff0000;">&quot;ATL&quot;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>The next section is an implementation of a SwingBuilder. Builders are a pretty common idiom in Groovy. There are MarkupBuilders, AntBuilders and others including a SwingBuilder. The SwingBuilder abstracts a lot of the nasty complex requirements for building a rich user interface in Java. Swing is the desktop UI library. It&#8217;s very powerful but can also be very complex to use. The SwingBuilder provides a very elegant abstraction on what turns out to be a complex model. One of the great things about the SwingBuilder (and all Builders for that matter) is that in just reading the code, it&#8217;s quite apparent what the user interface is going to look like. We start with a Frame. Within the Frame we have a panel and within the panel we have a button and a label. We have a second panel that contains a table and thrid panel that contains the Google Map wiget. The equivalent swing code to implement this would be many more lines of code probably two or three times the amount of code I would guess. The other thing is that it would be harder to visualize the layout of the application with standard swing code. With the builder implementation, we can see how the components are nested within each other.<br />
</br></br><br />
I&#8217;ll talk about the {&#8230;} code behind the Refresh Button and the table in a second. Before we leave this code I wanted to talk a bit about the Map component. The Google Map component is based on some fine work by Josh Marinacci that can be found at java.net <a href="http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-app-with-jxmapviewer.html">JXMapViewer</a>.The interesting thing with respect to this example is that any Swing component can be wrapped by a widget call in the builder. This provides a very nice mechanism for reusing existing swing classes within the builder pattern.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">def</span> swing <span style="color: #66cc66;">=</span> SwingBuilder.<span style="color: #006600;">build</span> <span style="color: #66cc66;">&#123;</span>
  frame<span style="color: #66cc66;">&#40;</span>title: <span style="color: #ff0000;">&quot;Java Posse Roundup 2009&quot;</span>, pack: <span style="color: #000000; font-weight: bold;">true</span>, show: <span style="color: #000000; font-weight: bold;">true</span>, defaultCloseOperation: EXIT_ON_CLOSE, id: <span style="color: #ff0000;">&quot;frame&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    borderLayout<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    panel<span style="color: #66cc66;">&#40;</span>constraints: NORTH<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      boxLayout<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
      button<span style="color: #66cc66;">&#40;</span>text: <span style="color: #ff0000;">&quot;Refresh&quot;</span>, actionPerformed: <span style="color: #66cc66;">&#123;</span>
        doOutside <span style="color: #66cc66;">&#123;</span>...<span style="color: #66cc66;">&#125;</span>
      <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>
      label<span style="color: #66cc66;">&#40;</span>id:<span style="color: #ff0000;">&quot;status&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#125;</span>
    panel<span style="color: #66cc66;">&#40;</span>constraints: CENTER<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      borderLayout<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
      table<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>...<span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
    panel<span style="color: #66cc66;">&#40;</span>constraints: SOUTH<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      borderLayout<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
      scrollPane<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        widget<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> JXMapKit<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, defaultProvider: JXMapKit.<span style="color: #006600;">DefaultProviders</span>.<span style="color: #006600;">OpenStreetMaps</span>, dataProviderCreditShown: <span style="color: #000000; font-weight: bold;">true</span>, id: <span style="color: #ff0000;">&quot;map&quot;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p></br></br><br />
Aside from the structure of our application, the most interesting code in the builder can be found in the actionPerformed closure. This closure will be called when the Refresh button is clicked. There is quite a bit going on in a very few lines of code. The first thing of note is the doOutside method that takes a closure. Quite simply the code in the closure will get executed in a separate thread. How cool is that? Within the closure we iterate over the attendees collection. For each entry in the collection we make a call to the <a href="http://developer.yahoo.com/yql/console/">Yahoo Geo Service</a>. Many thanks to my friend <a href="http://idojava.blogspot.com/">Ido Green</a> for introducing me to YQL via his <a href="http://www.youtube.com/watch?v=nnks7HovnUo">lightning talk</a>. The XmlSlurper class is a handy means for parsing XML content. The query we&#8217;re composing takes the origin airport {it.origin} and returns an xml document that contains a bunch of geographical information for the airport. In our case, we&#8217;re only interested in the latitude and logitude. We pull those values out of the resulting document and then construct a WayPoint. The WayPoint object is present in the JXMapViewer package and is relly the only thing we need to construct a pin point on the map.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;">      button<span style="color: #66cc66;">&#40;</span>text: <span style="color: #ff0000;">&quot;Refresh&quot;</span>, actionPerformed: <span style="color: #66cc66;">&#123;</span>
        doOutside <span style="color: #66cc66;">&#123;</span>
          <span style="color: #000000; font-weight: bold;">def</span> waypoints <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashSet<span style="color: #66cc66;">&lt;</span>Waypoint<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
          attendees.<span style="color: #663399;">each</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">def</span> url <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20text%3D%22${it.origin}%22&amp;format=xml&quot;</span>
            status.<span style="color: #006600;">text</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;Looking up Airport: ${it.origin}&quot;</span>
            <span style="color: #000000; font-weight: bold;">def</span> doc <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XmlSlurper<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">parse</span><span style="color: #66cc66;">&#40;</span>url<span style="color: #66cc66;">&#41;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>doc.<span style="color: #006600;">results</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
              <span style="color: #000000; font-weight: bold;">def</span> latitude <span style="color: #66cc66;">=</span> doc.<span style="color: #006600;">results</span>.<span style="color: #006600;">place</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">centroid</span>.<span style="color: #006600;">latitude</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
              <span style="color: #000000; font-weight: bold;">def</span> longitude <span style="color: #66cc66;">=</span> doc.<span style="color: #006600;">results</span>.<span style="color: #006600;">place</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">centroid</span>.<span style="color: #006600;">longitude</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
              waypoints <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #000000; font-weight: bold;">new</span> Waypoint<span style="color: #66cc66;">&#40;</span><span style="color: #aaaadd; font-weight: bold;">Double</span>.<span style="color: #006600;">valueOf</span><span style="color: #66cc66;">&#40;</span>latitude<span style="color: #66cc66;">&#41;</span>, <span style="color: #aaaadd; font-weight: bold;">Double</span>.<span style="color: #006600;">valueOf</span><span style="color: #66cc66;">&#40;</span>longitude<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#125;</span>
          <span style="color: #66cc66;">&#125;</span>
          WaypointPainter painter <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WaypointPainter<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
          painter.<span style="color: #006600;">setWaypoints</span><span style="color: #66cc66;">&#40;</span>waypoints<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
          map.<span style="color: #006600;">getMainMap</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setOverlayPainter</span><span style="color: #66cc66;">&#40;</span>painter<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
          status.<span style="color: #006600;">text</span> <span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span>
        <span style="color: #66cc66;">&#125;</span>
      <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>The last thing of note is the table entry. The table has a tablemodel which is constructed using the list of attendees. The model itself is very simple and consists of a propertyColumn that has a constructor that takes the column title and the name of the property to display. If you&#8217;ve attempted to implement a tablemodel in java (even a read only one like this one), I&#8217;m sure you can appreciate the brevity and cleanliness of this implementation.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;">      table<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
          tableModel<span style="color: #66cc66;">&#40;</span>list: attendees<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            propertyColumn<span style="color: #66cc66;">&#40;</span>header: <span style="color: #ff0000;">'Name'</span>, propertyName: <span style="color: #ff0000;">'name'</span><span style="color: #66cc66;">&#41;</span>
            propertyColumn<span style="color: #66cc66;">&#40;</span>header: <span style="color: #ff0000;">'Last Name'</span>, propertyName: <span style="color: #ff0000;">'lastName'</span><span style="color: #66cc66;">&#41;</span>
            propertyColumn<span style="color: #66cc66;">&#40;</span>header: <span style="color: #ff0000;">'EMail'</span>, propertyName: <span style="color: #ff0000;">'email'</span><span style="color: #66cc66;">&#41;</span>
            propertyColumn<span style="color: #66cc66;">&#40;</span>header: <span style="color: #ff0000;">'Origin'</span>, propertyName: <span style="color: #ff0000;">'origin'</span><span style="color: #66cc66;">&#41;</span>
          <span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>That&#8217;s it. 87 lines of Groovy goodness that renders a Google Map in a swing app, utilizes YQL to resolve geo location information for airports.</p>
<p>The source and external libraries that are required to run this application are available here. You&#8217;ll need <a href="http://groovy.codehaus.org">Groovy</a> installed. This archive has idea project files included. If you use eclipse or netbeans you&#8217;ll have to add the three external libraries to your project manually.</p>
<p><a href="/jpr09/jpr09.zip">jpr09.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.toddcostella.com/2009/03/groovyswingyqlgoogle-maps-lightning-talk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
