<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>JavaWorld's Daily Brew</title>
  <subtitle>Starting conversations in the Java developer community</subtitle>
  <link rel="alternate" type="text/html" href="http://www.javaworld.com/community"/>
  <link rel="self" type="application/atom+xml" href="http://www.javaworld.com/community/atom/feed"/>
  <id>http://www.javaworld.com/community/atom/feed</id>
  <updated>2009-11-06T02:41:48-05:00</updated>
  <entry>
    <title>Don&#039;t trust Cookie setMaxAge</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3673" />
    <id>http://www.javaworld.com/community/node/3673</id>
    <published>2009-11-07T11:10:06-05:00</published>
    <updated>2009-11-07T18:55:35-05:00</updated>
    <author>
      <name>Oleg Mikheev</name>
    </author>
    <category term="cookie" />
    <category term="cookie expiration" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>I've just run into the issue with misleading, or at least incomplete documentation related to HTTP Cookie representation in J2EE. Cookie class JavaDoc states that <a href="http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/Cookie.html#setMaxAge(int)" title="Cookie.setMaxAge(int)">Cookie.setMaxAge(int)</a> method "<em>Sets the maximum age of the cookie in seconds.</em>"<br />
That's not true, unfortunately. Cookies, as we know, don't hold info about their max age. They hold the date/time value of their expected expiration.</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>I've just run into the issue with misleading, or at least incomplete documentation related to HTTP Cookie representation in J2EE. Cookie class JavaDoc states that <a href="http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/Cookie.html#setMaxAge(int)" title="Cookie.setMaxAge(int)">Cookie.setMaxAge(int)</a> method "<em>Sets the maximum age of the cookie in seconds.</em>"<br />
That's not true, unfortunately. Cookies, as we know, don't hold info about their max age. They hold the date/time value of their expected expiration.</p>
<p>So, instead of setting the max age for a cookie, this setMaxAge method adds the int parameter seconds to the current <strong>SERVER</strong> date/time and puts this new date/time value to a cookie as its expiration time. Later, when this cookie is sent to the browser, this expiration date is compared to the <strong>CLIENT</strong> date/time, and cookie gets expired if its expiration date is in past.</p>
<p>All this means that setMaxAge method description is valid in just one case: all clients are run on the same machine with the server, or at least have their system time synchronized with the server. Rather idealistic, isn't it. There are lots of computers with system time that is in the past.</p>
<p>If you'd really like to rely on a cookie expiring after a defied period then a different approach should be taken, the brand new System and Method for Defining a Cookie Max Age :-)</p>
<p>So, if you'd like your cookie to expire in definite time you will need another cookies to hold the cookie 'meta-information'. To make sure that cookie 'cookie1' having value 'someValue' will expire in, say, 20 seconds, in your servlet or servlet filter you could do:<br />
<div class="codeblock"><code>	response.addCookie(new Cookie(&quot;cookie1Name&quot;,&quot;cookie1&quot;));<br />	response.addCookie(new Cookie(&quot;cookie1Value&quot;,&quot;someValue&quot;));<br />	response.addCookie(new Cookie(&quot;cookie1Timeout&quot;,&quot;20&quot;));</code></div></p>
<p>Then, add the next JavaScript on the page that the servlet produces:</p>
<p><div class="codeblock"><code>&lt;script type=&quot;text/javascript&quot;&gt;<br />	// Original JavaScript code by Chirp Internet: <a href="http://www.chirp.com.au<br />" title="www.chirp.com.au<br />">www.chirp.com.au<br /></a>	// Please acknowledge use of this code by including this header.<br />	function getCookie(name) {<br />		var re = new RegExp(name + &quot;=([^;]+)&quot;);<br />		var value = re.exec(document.cookie);<br />		return (value != null) ? unescape(value[1]) : null;<br />	}<br /><br />	function setCookie(name, value, expiry) {<br />		document.cookie = name + &quot;=&quot; + escape(value) + &quot;; expires=&quot; + expiry.toGMTString() + &quot;; path=/&quot;;<br />	}<br />	<br />	var cookie1Name = getCookie(&#039;cookie1Name&#039;);<br />	var cookie1Value = getCookie(&#039;cookie1Value&#039;);<br />	var cookie1Timeout = Math.abs(getCookie(&#039;cookie1Timeout&#039;)) * 1000; // converting to milliseconds<br />	setCookie(cookie1Name, cookie1Value, new Date((new Date()).getTime()+cookie1Timeout));<br />&lt;/script&gt;</code></div></p>
<p>This will result in a cookie1 to expire in 20 seconds. </p>
<p>Awkward, but it works.</p>
<p>Unfortunately this approach will not work for Cookies that are set during AJAX calls, as there will be no possibility to run a custom JavaScript in this case.</p>
    ]]></content>
  </entry>
  <entry>
    <title>The merger drama continues</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3669" />
    <id>http://www.javaworld.com/community/node/3669</id>
    <published>2009-11-06T03:19:37-05:00</published>
    <updated>2009-11-06T03:14:23-05:00</updated>
    <author>
      <name>Josh Fruhlinger</name>
    </author>
    <category term="drama" />
    <category term="EU" />
    <category term="merger" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>Some people just don't have much patience!  For instance, the big news in the snack food world this month was that Utz and Snyder's of Hanover were going to merge -- except then the two companies called it off, citing the <a href="http://www.baltimoresun.com/business/bal-utz-hanover-1105,0,4312683.story" target="_blank">protracted review process</a> that they had to endure.  The total time they were held in limbo by regulators?  15 days.</p>    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>Some people just don't have much patience!  For instance, the big news in the snack food world this month was that Utz and Snyder's of Hanover were going to merge -- except then the two companies called it off, citing the <a href="http://www.baltimoresun.com/business/bal-utz-hanover-1105,0,4312683.story" target="_blank">protracted review process</a> that they had to endure.  The total time they were held in limbo by regulators?  15 days.</p>

<p>By contrast, Oracle and Sun have endured regulatory delays for <em>months</em> now, and it looks like the merger won't clear until January at the earliest.  And scuttlebutt has it that the European Commission will be raising some sort of <a href="http://www.ft.com/cms/s/0/653e8e88-c8ba-11de-8f9d-00144feabdc0.html?nclick_check=1" target="_blank">formal objection to the process</a>, which Oracle would have to address.  And many clearly pro-Oracle anonymous sources <a href="http://www.itworld.com/legal/83568/oracle-plans-aggressive-fight-eu-over-sun-takeover" target="_blank">quoted in this story</a> say that Oracle will unleash a war if that happens, calling on allies in the U.S. government -- including House Speaker Nancy Pelosi, whose San Francisco district is just a few miles from the headquarters of both companies -- to put pressure on the Europeans on behalf of the merger.</p>

<p>If the merger doesn't happen, the consequences are probably pretty dire for Sun; Oracle would lose face pretty publicly, but wouldn't be in a terrible position, as Sun would be back to its previous status as a rival, and <a href="http://www.forbes.com/2009/11/04/sun-microsystems-oracle-business-wall-street-sun-deal.html" target="_blank">much weakened</a>.  In all probability, the company would end up shedding most of its business piecemeal, and Oracle could snap up the bits it wanted at a discount -- all the bits other than MySQL, anyway, as that's the sticking point for the Europeans.</p>

<p>Which leads to the question of how important Java is to this whole thing after all.  I at least have been working on the assumption that Java is what Oracle is really after in this whole adventure; but if that's so, why is it so grimly refusing to consider leaving MySQL out of the equation, even if that puts the whole transaction in jeopardy?  Is MySQL the real prize after all?  Or does Oracle's macho attitude mean that no compromises are possible once a course has been set?</p>     ]]></content>
  </entry>
  <entry>
    <title>RMOUG Training Days 2010 Agenda</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3671" />
    <id>http://www.javaworld.com/community/node/3671</id>
    <published>2009-11-06T01:19:00-05:00</published>
    <updated>2009-11-06T03:37:18-05:00</updated>
    <author>
      <name>dmarx</name>
    </author>
    <category term="Dustin" />
    <category term="Publications" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>An early version of the <a href="http://www.technicalconferencesolutions.com/pls/caat/caat_abstract_reports.schedule?conference_id=62">agenda for RMOUG Training Days 2010</a> is <a href="http://www.technicalconferencesolutions.com/pls/caat/caat_abstract_reports.schedule?conference_id=62">now available</a>.  The agenda currently shows six University Sessions, ten 90 minute sessions, ten 30 minute sessions, and then many of the typical 60 minute sessions.</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>An early version of the <a href="http://www.technicalconferencesolutions.com/pls/caat/caat_abstract_reports.schedule?conference_id=62">agenda for RMOUG Training Days 2010</a> is <a href="http://www.technicalconferencesolutions.com/pls/caat/caat_abstract_reports.schedule?conference_id=62">now available</a>.  The agenda currently shows six University Sessions, ten 90 minute sessions, ten 30 minute sessions, and then many of the typical 60 minute sessions.  As usual, many of the presentations are focused on <a href="http://www.oracle.com/database/index.html">Oracle database</a> development and <a href="http://www.oracle.com/technology/documentation/database.html">administration</a>.  However, there are several presentations likely to appeal to those who have little or no interest in the database.</p>
<p>The following are some of the sessions that I think look interesting based on their titles and abstracts.  There are more attractive sessions than I will list here.</p>
<p>There is only one session (Session 4, Wednesday, 17 February 2010, 2:45 pm - 3:15 pm) with 30 minute presentations, but there are many potentially interesting presentations during that session.  These include <strong>Using SQL to Generate SQL</strong> (likely to be particularly useful for those new to <a href="http://en.wikipedia.org/wiki/SQL">SQL</a>), <strong>Java 6 and Java 5 New Features</strong> (likely to be particularly useful for those new to <a href="http://java.sun.com/j2se/1.5.0/">J2SE 5</a> or <a href="http://marxsoftware.blogspot.com/search/label/Java%20SE%206">Java SE 6</a>), and <strong>10 Things I Did Not Learn from SQL Class</strong> (very specific how-tos listed in this abstract).</p>
<p><a href="http://jacksonsoftware.blogspot.com/">Bill Jackson</a>'s 60-minute presentation <strong>10 Easy Ways to Build a Better Graphic User Interface</strong> is scheduled for Session 7 (Thursday, 18 February 2010, 9 am - 10 am).  My first presentation, <strong>RESTful Java</strong> is scheduled for Session 8 (Thursday, 18 February 2009, 10:15 am - 11:15 am) and <strong>Oracle Fusion Design Fundamentals</strong> is offered in that same session.  My second presentation, <strong>Applied Groovy: Scripting for Java Development</strong>, is scheduled for Session 11 (Thursday, 18 February 2009, 2:45 pm - 3:45 pm).</p>
<p>There are multiple presentations on <a href="http://en.wikipedia.org/wiki/Service-oriented_architecture">Service Oriented Architecture</a> (SOA) including <strong>SOA Today</strong> during Session 9 (Thursday, 17 February 2009, 11:45 am - 12:45 pm).  Other SOA presentations include <strong>Problems and Solutions Facing SOA Implementations</strong> and <strong>Using Agile Approaches and Techniques for Rapid SOA Implementations</strong> (both Session 11) and <strong>Agile SOA: Is It Possible?</strong> (Session 7).</p>
<p>Although <a href="http://www.oracle.com/index.html">Oracle</a> is pursuing acquisition of <a href="http://www.sun.com/">Sun Microsystems</a>, <a href="http://www.java.com/">Java</a> and Sun products play a relatively minor role at Training Days 2010.  There are three presentations with "Java" in the title, which are my two presentations ("RESTful Java" and "Applied Groovy: Scripting for Java Development") and the above-cited <a href="http://www.kingtraining.com/">John King</a> presentation "Java 6 and Java 5 New Features."  There are additional presentations that are Java-related such as presentations on <a href="http://www.oracle.com/technology/products/adf/index.html">Application Development Framework</a> (ADF) and <a href="http://www.oracle.com/technology/products/middleware/index.html">Fusion</a>.</p>
<p>Several of the speakers scheduled for <a href="http://rmougtd.blogspot.com/">RMOUG Training Days</a> 2010 are very well-known in the Oracle community.  These include <a href="http://robertgfreeman.blogspot.com/">Robert Freeman</a>, <a href="http://www.oracle.com/technology/pub/columns/plsql/index.html">Steven Feuerstein</a>, and <a href="http://groundside.com/blog/DuncanMills.php">Duncan Mills</a>.  There are also several speakers who frequently present at RMOUG Training Days as well as some speakers that are new to Training Days.</p>
<p>I always start to get more excited about attending a conference once its agenda has been posted.  I am looking forward to presenting at and attending RMOUG Training Days 2010.</p>
    ]]></content>
  </entry>
  <entry>
    <title>XML verification just got easier with easyb</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3667" />
    <id>http://www.javaworld.com/community/node/3667</id>
    <published>2009-11-05T13:57:52-05:00</published>
    <updated>2009-11-06T02:41:48-05:00</updated>
    <author>
      <name>Andrew Glover</name>
    </author>
    <category term="agile" />
    <category term="Andy" />
    <category term="bdd" />
    <category term="Developer Testing" />
    <category term="easyb" />
    <category term="groovy" />
    <category term="java" />
    <category term="JUnit" />
    <category term="open source" />
    <category term="programming" />
    <category term="TDD" />
    <category term="testing" />
    <category term="unit testing" />
    <category term="xunit" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>There&#8217;s myriad ways to validate XML these days; in fact, with Groovy, the mechanics of parsing XML with <code>&amp;lt;a href=&amp;quot;http://groovy.codehaus.org/Reading+XML+using+Groovy%27s+XmlSlurper&amp;quot;&amp;gt;XMLSlurper&amp;lt;/a&amp;gt;</code> couldn&#8217;t be easier! Nevertheless, from time to time, because it&#8217;s my bag, baby, I&#8217;ve found that I&#8217;ve needed an easy way to validate XML documents without having to actually parse them myself.</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>There&#8217;s myriad ways to validate XML these days; in fact, with Groovy, the mechanics of parsing XML with <code>&lt;a href=&quot;http://groovy.codehaus.org/Reading+XML+using+Groovy%27s+XmlSlurper&quot;&gt;XMLSlurper&lt;/a&gt;</code> couldn&#8217;t be easier! Nevertheless, from time to time, because it&#8217;s my bag, baby, I&#8217;ve found that I&#8217;ve needed an easy way to validate XML documents without having to actually parse them myself. Thus, <a href="http://www.ibm.com/developerworks/java/library/j-cq121906.html">XMLUnit</a> has been a handy <a href="http://thediscoblog.com/2009/08/11/xml-validation-is-easyb/">framework today</a> as it has been for years. </p>
<p>While XMLUnit is a hip JUnit-style framework, you can certainly leverage it outside of JUnit. What&#8217;s more, via <a href="http://code.google.com/p/easyb/wiki/PluginAPI">easyb&#8217;s plug-in framework</a>, using XMLUnit just got a lot easier! For instance, leveraging XMLUnit without the new plug-in required a bit of manual manipulation of XMLUnit&#8217;s <code>Diff</code> class and then a <code>boolean</code> verification like so:</p>
<p>import org.custommonkey.xmlunit.XMLUnit<br />
import org.custommonkey.xmlunit.Diff</p>
<p>XMLUnit.setIgnoreWhitespace(true)</p>
<p>scenario &quot;the XMLRepresentationBuilder should build XML&quot;, {</p>
<p> given &quot;a table name and collection of name value pairs&quot;, {<br />
   lst = [new ColumnNameValue(&quot;LN_ID&quot;, 10002130),<br />
     new ColumnNameValue(&quot;NIBA&quot;, &quot;99.99&quot;),<br />
     new ColumnNameValue(&quot;EFF_DATE&quot;, &quot;2009-04-01&quot;)]<br />
   map = [&quot;LN_ID&quot;:&quot;id&quot;, &quot;NIBBA&quot;:&quot;nb&quot;,&quot;EFF_DATE&quot;:&quot;effectiveDate&quot;]<br />
 }</p>
<p> then &quot;the XML produced should be valid&quot;, {<br />
   rep = new DatabaseTableResource()<br />
   rep.columnNameValues = lst<br />
   rep.columnNameMappings = map<br />
   rep.identifiers = [&quot;LN_ID&quot;]<br />
   out = XMLRepresentationBuilder.buildRepresentation(rep)</p>
<p>   control = &quot;&quot;&quot;&lt;cmnres id='10002130'&gt;<br />
      &lt;nib&gt;99.99&lt;/nib&gt;&lt;effectiveDate&gt;2009-04-01&lt;/effectiveDate&gt;<br />
      &lt;/cmnres&gt;&quot;&quot;&quot;					 </p>
<p>   diff = new Diff(control, out)<br />
   diff.identical().shouldBe true<br />
 }<br />
}</p>
<p>Note how in this code it&#8217;s necessary to:</p>
<ul>
<li>Ensure white space doesn&#8217;t cause comparison errors via the <code>XMLUnit.setIgnoreWhitespace(true)</code> call</li>
<li>Use XMLUnit&#8217;s <code>Diff</code> class to compare two documents and then call the <code>identical</code> (or <code>similar</code>) method to actually verify the documents</li>
</ul>
<p>With easyb&#8217;s XMLUnit plug-in, things are a lot simpler! All you need to do is insert a <code>using</code> clause and ensure the plug-in is in your classpath. Watch:</p>
<p>using &quot;xmlunit&quot;</p>
<p>scenario &quot;XML documents are compared easier via xml unit plug-in&quot;, {  </p>
<p>  given &quot;some xml document&quot;, {<br />
    control = &quot;&quot;&quot;&lt;account&gt;&lt;id&gt;3A-00&lt;/id&gt;&lt;name&gt;acme&lt;/name&gt;&lt;/account&gt;&quot;&quot;&quot;<br />
  }</p>
<p>  then &quot;the plugin should enable easy comparisons&quot;, {<br />
    testXML = &quot;&quot;&quot;&lt;account&gt;&lt;id&gt;3A-00&lt;/id&gt;&lt;name&gt;acme&lt;/name&gt;&lt;/account&gt;&quot;&quot;&quot;<br />
    testXML.shouldBeIdenticalTo control<br />
    testXML.shouldBeIdenticalWith control  //same behavior different call<br />
    testXML.shouldBeIdentical control      //ditto<br />
    testXML.identical control              //ditto<br />
  }</p>
<p>  and &quot;the instance of XMLUnit should be available for use&quot;, {<br />
    XMLUnit.version.shouldBe &quot;1.3alpha&quot;<br />
    XMLUnit.getIgnoreWhitespace().shouldBe true<br />
  }<br />
}</p>
<p>Notice that there isn&#8217;t any need to alter the white space setting (it&#8217;s been done for you in the plug-in &#8212; yo can undo it easily too &#8212; see the <code>and</code> clause?), nor is it necessary to use XMLUnit&#8217;s <code>Diff</code> class &#8212; it&#8217;s all done under the covers. While this story uses the <code>identical</code> call, there is a corresponding <code>similar</code> call (and related pattern &#8212; that is, <code>shouldBeSimilarTo</code> and the like). </p>
<p>Also, the initialized instance of <code>XMLUnit</code> is available should you need further configurations, etc &#8212; the plug-in inserts the copacetic instance into the binding available to your behaviors as shown in the <code>and</code> phrase above.</p>
<p>As you can see, the XMLUnit plug-in for easyb makes <a href="http://www.ibm.com/developerworks/java/library/j-pg05199/">workin with xml</a> (that is, comparing documents) a lot easier. While there&#8217;s plenty of ways to skin a cat, so to speak, this is just one of them &#8212; I&#8217;ve certainly found it handy from time to time &#8212; I think you will too! </p>
<p>You can download the current version of the plug-in at <a href="http://code.google.com/p/easyb/downloads/list">easyb&#8217;s Google code site</a> along with a few other hip gems like <a href="http://easyb.org/dbunit.html">easyb&#8217;s DbUnit plug-in</a>.</p>
<p>You can now follow <a href="http://twitter.com/thediscoblog">The Disco Blog on Twitter</a>, baby!</p>
    ]]></content>
  </entry>
  <entry>
    <title>Effective Enterprise Java at Öredev</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3640" />
    <id>http://www.javaworld.com/community/node/3640</id>
    <published>2009-11-03T12:40:37-05:00</published>
    <updated>2009-11-03T12:40:38-05:00</updated>
    <author>
      <name>jhannes</name>
    </author>
    <category term="English" />
    <category term="java" />
    <category term="Software Development" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>Just three weeks ago, I was asked to step in for Ted Neward to give a tutorial at Öredev on <a href="http://www.oredev.org/Prod/Oredev/site.nsf/docsbycodename/session?opendocument&amp;sid=2DDB2738A9A84259C125765D006D06EA&amp;day=2&amp;track=E92AC6A14535633BC12575A5004943A0">Effective Enterprise Java</a>. As I did not have time to get the tutorial materials printed, I present them here on the web for the participants and others.</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>Just three weeks ago, I was asked to step in for Ted Neward to give a tutorial at Öredev on <a href="http://www.oredev.org/Prod/Oredev/site.nsf/docsbycodename/session?opendocument&amp;sid=2DDB2738A9A84259C125765D006D06EA&amp;day=2&amp;track=E92AC6A14535633BC12575A5004943A0">Effective Enterprise Java</a>. As I did not have time to get the tutorial materials printed, I present them here on the web for the participants and others.</p>
<p>1. Effect Enterprise Java architecture in 2009</p>
<p>Since the Effective Enterprise Java book was written, many of the topics regarding transactions, concurrency and shared state have been resolved. Here are the basic guidelines of an enterprise application in Java as of 2009:</p>
<ol>
<li>All processing is triggered by an event, such as an http-request, a timer or an incoming message</li>
<li>Each processing event is handled in an isolated scope, never touching the data of another processing event. All coordination of data happens through the data layer. This means that objects are either stateful and short-lived or stateless and immortal.</li>
<li>Each processing event is either completed or aborted totally. Very few applications will benefit from trying to automatically recover from most problems.</li>
<li>Inconsistent updates are resolved when transactions are committed, usually through optimistic locking.</li>
</ol>
<p>Some things I told the attendants to consider: First, today most people consider EJBs to be more trouble than value (with the exception of Entity beans 3.0 which is JPA which is really mostly Hibernate, which really isn&#8217;t very much EJB). Second, all triggers can be forged. We return to the second issue when we discuss security.</p>
<p>2. Web integration testing</p>
<p>I showed a <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev/src/test/java/com/brodwall/kata/webcrud/PersonWebTest.java">practical demo using WebDriver and Jetty</a> to perform web integration tests as JUnit test. The remarkable things about this example is that it requires no installation of an app server (Jetty is installed as a Maven dependency), it requires no separate starting of an application server (Jetty can run embedded in the test) and it is very fast (Jetty starts up in about 200 milliseconds).</p>
<p>3. Hibernate integration testing</p>
<p>I showed a <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev/src/test/java/com/brodwall/kata/webcrud/HibernatePersonDaoTest.java">practical example of how to test a DAO implemented with Hibernate</a>. The remarkable things about this demonstration was that, again, no installation or startup is required (I use H2 as an in-memory database).</p>
<p>Hibernate is a power tool. I use the following analogy: If you&#8217;re building a tunnel and need to mine through a mountain, you want to use dynamite. If you want to remove a rock from you back yard, you may want to use dynamite. But if you don&#8217;t know what you&#8217;re doing, chances are you may blow your foot off.</p>
<p>Hibernate is like that dynamite. You need knowledge and safety measures to deal with it correctly, but when you do, it can save you a lot of effort. Creating JUnit tests for your Hibernate code is one such safety measure.</p>
<p>4. Security</p>
<p>Almost all the threats an application developer should be concerned with are in the same class, namely that of Injection attacks. An injection attack is when a client tricks another process into treating data as instructions. For example by using SQL meta-characters:</p>
<p></p>
<p>An important source of injection vulnerabilities is HTML injection, also known as Cross-Site Scripting (XSS).</p>
<p>In both situations, and in all others, there&#8217;s one important guideline: Data from the outside world should be considered &#8220;tainted&#8221;. Never use tainted data in unsafe ways. When reading input parameters, validate against malicious characters (but please don&#8217;t make poor &#8220;O&#8217;Reiley&#8221; unable to use your system). When writing HTML pages, always escape tainted data. When using tainted data during access to the database or with HSQL or JPAQL, always use PreparedStatement and send in data as parameters.</p>
<p>Another often overlooked exploit is request forgery, often used in combination with phishing attacks. To protect your users from request forgery, supply an authentication token as a hidden field with all forms. Or if you&#8217;re lazy: Make sure all operations have confirmation dialogs.</p>
<p>5. Continuous Deployment</p>
<p>Continuous Deployment is the practice of rolling out a deployment to a server after every successful build on your Continuous Integration server. I described two ways of doing Continuous Deployment during the tutorial, but I will restrict this discussion to the more modern one.</p>
<p>Most teams doing continuous deployment use Maven or Ant to invoke the deployment tools of their respective application servers. Many application servers make this pretty hard, but the hardest part of the battle if finding out what command needs to be invoked. The Continuous Integration server can be configured to run this task.</p>
<p>After doing deployment, it is a good idea to run some sort of system level integration tests. Teams use replay of production data, load generators like JMeter and webcrawlers that validate HTML and CSS to do automated non-functional integration tests. If you keep your logs clean, you can actually gain quite a bit of confidence just by looking at the logs after applying simulated load to your system.</p>
<p>Some projects take this even further, by continuously deploying to production. Both IMVU and Flickr are known to practice this.</p>
<p>At any rate, the practice of doing continuous deployment should lead you to consider how to simplify your deployment and runtime configuration, which will result in an easier installation procedure into production, even if it&#8217;s not automated.</p>
<p>Summary</p>
<p>Effective Enterprise Java development has progressed a lot since 2004. Much of the emphasis now is on how to improve testing in enterprise Java applications. The way applications usually process data has stabilized as well, with most application preferring each event to be processed in an isolated, transactional context with very little automated recovery.</p>
<p>In the end, Effective Enterprise Java is a lot simpler in 2009 than it was in 2004.</p>
<p>Material</p>
<ul>
<li><a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Effective%20Enterprise%20Java%20-%20%C3%98redev.ppt">My slides</a>, including topics that we didn&#8217;t discuss as well as code for all the examples</li>
<li>The complete source code for one iteration of my <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev">Enterprise Java Kata</a>, including a <a href="http://svn.brodwall.com/presentations/public/2009-11-03%20Enterprise%20Java%20Kata%20-%20%C3%98redev/pom.xml">pom.xml</a> file with all dependencies needed to get the tests running</li>
</ul>
    ]]></content>
  </entry>
  <entry>
    <title>Oracle: Your Java-related products are going to be fine, just fine</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3638" />
    <id>http://www.javaworld.com/community/node/3638</id>
    <published>2009-11-03T02:24:18-05:00</published>
    <updated>2009-11-03T02:30:08-05:00</updated>
    <author>
      <name>Josh Fruhlinger</name>
    </author>
    <category term="glassfish" />
    <category term="merger" />
    <category term="netbeans" />
    <category term="Oracle" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>Hey, Java fan, are you <a href="http://www.javaworld.com/community/node/3614" target="_blank">still anxious</a> about the fate of future Java-related technologies after the Oracle takeover?  Well, fear not, because Oracle has put an <a href="http://www.oracle.com/ocom/groups/public/documents/webcontent/038563.pdf" target="_blank">updated FAQ on the subject</a>!  They actually discuss two of the products people have been most agitated about -- GlassFish and NetBeans -- by name, with varying degrees of reassuringness.  The mentions are actually short enough to reproduce here in full.    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>Hey, Java fan, are you <a href="http://www.javaworld.com/community/node/3614" target="_blank">still anxious</a> about the fate of future Java-related technologies after the Oracle takeover?  Well, fear not, because Oracle has put an <a href="http://www.oracle.com/ocom/groups/public/documents/webcontent/038563.pdf" target="_blank">updated FAQ on the subject</a>!  They actually discuss two of the products people have been most agitated about -- GlassFish and NetBeans -- by name, with varying degrees of reassuringness.  The mentions are actually short enough to reproduce here in full.  First, on the GlassFish EE server:</p>

<p><em>Oracle plans to continue evolving GlassFish Enterprise Server, delivering it as the open source reference implementation (RI) of the Java Enterprise Edition (Java EE) specifications, and actively supporting the large GlassFish community. Additionally, Oracle plans to invest in aligning common infrastructure components and innovations from Oracle WebLogic Server and GlassFish Enterprise Server to benefit both Oracle WebLogic Server and GlassFish Enterprise Server customers.</em></p>

<p>Translation: GlassFish is kind of necessary as a reference implementation for Java EE, so we'll be keeping that around.  When it comes to the commercial offering, we'll still sell it for a while as we figure out if any of its components are better than their analogues in WebLogic.  Eventually we hope to sell some kind of Frankenstein combination of the best bits of the two.</p>

<p>And what of NetBeans?</p>

<p><em>Oracle has a strong track record of demonstrating commitment to choice for Java developers. As such, NetBeans is expected to provide an additional open source option and complement to the two free tools Oracle already offers for enterprise Java development: Oracle JDeveloper and Oracle Enterprise Pack for Eclipse. While Oracle JDeveloper remains Oracle's strategic development tool for the broad portfolio of Oracle Fusion Middleware products and for Oracle's next generation of enterprise applications, developers will be able to use whichever free tool they are most comfortable with for pure Java and Java EE development: JDeveloper, Enterprise Pack for Eclipse, or NetBeans.</em></p>

<p>Translation: We'll still host the NetBeans project on our servers, and certainly won't try to stop anyone from using it!  Just give us a call when you want to do serious work, and we'll get you set up with JDeveloper.</p>

<p>Reassuring, right?  Oracle also pledges to keep developing OpenOffice, which is relevant because it has a lot of Java dependencies, but mostly I just want to mention that the FAQ section on OpenOffice declares that "OpenOffice is expected to create a compelling desktop integration bridge for our enterprise customers," which is a hilarious statement that I have no idea what it means.</p>

<p>This, of course, assumes that the merger is still on!  Right now Sun stock is trading at <a href="http://www.google.com/finance?q=NASDAQ%3AJAVA" target="_blank">$8.25</a>, which is a good 13 percent less than Oracle's $9.50-a-share offer.  In other words, investors aren't entirely convinced Oracle will be able to close the deal, or that it will pay the full promised price if it does.</p>    ]]></content>
  </entry>
  <entry>
    <title>EC2 is easier than you think</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3635" />
    <id>http://www.javaworld.com/community/node/3635</id>
    <published>2009-11-02T11:22:41-05:00</published>
    <updated>2009-11-06T02:41:48-05:00</updated>
    <author>
      <name>Andrew Glover</name>
    </author>
    <category term="agile" />
    <category term="amazon" />
    <category term="amazon web services" />
    <category term="Andy" />
    <category term="Articles" />
    <category term="cloud" />
    <category term="Cloud Computing" />
    <category term="development 2.0" />
    <category term="Eclipse" />
    <category term="grails" />
    <category term="groovy" />
    <category term="Hibernate" />
    <category term="java" />
    <category term="open source" />
    <category term="programming" />
    <category term="software as a service" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>As I&#8217;ve written about before with respect to <a href="http://thediscoblog.com/2009/05/10/development-20/">Development 2.0</a>, the future of application infrastructures is already here: it&#8217;s the cloud.</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>As I&#8217;ve written about before with respect to <a href="http://thediscoblog.com/2009/05/10/development-20/">Development 2.0</a>, the future of application infrastructures is already here: it&#8217;s the cloud. Using the cloud to <a href="http://ciinabox.com/">spin up and wind down hardware</a> and software assets as needed turns out to be cost effective and rather easy to boot.  </p>
<p>For instance, provisioning an Amazon EC2 instance for hosting your super slick Java Web application is a snap, man! In this <a href="http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=Java+development+2.0">Java development 2.0 column</a> entitled &#8220;<a href="http://www.ibm.com/developerworks/java/library/j-javadev2-4/">Easy EC2</a>&#8221; from <a href="http://www.ibm.com/developerworks/">IBM developerWorks</a>, you&#8217;ll quickly build a Web application that leverages <a href="http://thediscoblog.com/category/dynamic-languages/groovy/">Groovy</a>, <a href="http://www.springsource.org/">Spring</a>, and <a href="https://www.hibernate.org/">Hibernate</a> (via the <a href="http://grails.org/">Grails framework</a>) and deploy it on an EC2 instance using <a href="http://javawebappsinabox.com/">Java Web Apps in a Box&#8217;s AMI</a>. </p>
<p>So what are you waiting for? Read this article and you&#8217;ll be floating on the clouds in no time! Also, while you are at it, don&#8217;t forget to read the other articles in the series:</p>
<ul>
<li><a href="http://thediscoblog.com/2009/10/01/you-can-borrow-ec2-too/">You can borrow EC2 too</a> (October 2009)</li>
<li><a href="http://thediscoblog.com/2009/08/20/hello-google-app-engine/">Hello Google App Engine</a> (August 2009)</li>
</ul>
<p>Next month&#8217;s article will feature <a href="http://couchdb.apache.org/">CouchDB</a> &#8212; stay tuned! </p>
<p>You can now follow <a href="http://twitter.com/thediscoblog">The Disco Blog on Twitter</a>, baby!</p>
    ]]></content>
  </entry>
  <entry>
    <title>Realizing That I Still Have Much to Learn</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3636" />
    <id>http://www.javaworld.com/community/node/3636</id>
    <published>2009-11-02T10:26:00-05:00</published>
    <updated>2009-11-06T03:37:18-05:00</updated>
    <author>
      <name>dmarx</name>
    </author>
    <category term="Dustin" />
    <category term="General Development" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>Several years ago, I was asked to rate myself on my level of expertise with different programming languages and frameworks.  Several people were surprised when I did not rank myself at the highest possible level for knowledge of <a href="http://java.com/">Java</a>, especially when several developers with far less <a href="http://en.wikipedia.org/wiki/Software_development">software development</a> in general and far less Java experience in particular rated their own Java skills at the maximum level.</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>Several years ago, I was asked to rate myself on my level of expertise with different programming languages and frameworks.  Several people were surprised when I did not rank myself at the highest possible level for knowledge of <a href="http://java.com/">Java</a>, especially when several developers with far less <a href="http://en.wikipedia.org/wiki/Software_development">software development</a> in general and far less Java experience in particular rated their own Java skills at the maximum level.  I explained to them that I too would have at one time ranked myself at the highest possible level but that I had learned enough since that time to realize how much I still needed to learn.  There was no way I could in good conscience rate myself at the highest level knowing how many areas of the Java ecosystem I lacked experience and depth of knowledge in.  I believe there are numerous advantages to always understanding what one doesn't know (or working to discover what one doesn't know) and will outline some of these advantages in this post.</p>
<p><strong>Ability to Consider New Options</strong></p>
<p>When one thinks he or she already knows everything, that person has no incentive or interest in considering anything new or different than what he or she has done before.  This can backfire because the same solution or approach rarely fits every problem a developer will encounter.  It might seem easiest to shoehorn a particular problem into the solution we know best, but that does not make it the best or even an appropriate solution.  By admitting that I may not know everything and have much still to learn, I will be more willing to listen to others' ideas and consider other perspectives.  I still may end up going with my initial solution, but I will have thought out its benefits and costs and weighed them against the benefits and costs of the alternatives.</p>
<p><strong>Ability to Learn New Things</strong></p>
<p>If I think I know everything already, I have no need to waste time learning anything new.  Learning new things can be tiring and even frustrating, but I am more apt to invest the time and effort in my own knowledge if I realize that there is so much still to learn.</p>
<p><strong>Ability to Challenge My Own Assumptions and Biases</strong></p>
<p>The person who knows everything (or at least thinks he or she is <a href="http://en.wikipedia.org/wiki/Omniscience">omniscient</a>) has no reason wonder if what he or she is doing is correct for a given situation.  The person who understands that he or she doesn't know everything is more willing to question his or her own actions and measure the results of those actions.  If a course change is necessary, the person who understands his or her limitations is more likely to identify that need and do something about it.  I have written before about the <a href="http://marxsoftware.blogspot.com/2008/12/confidence-important-software-developer.html">importance of confidence to a software developer</a>.  I think confidence is one of the most important traits of a successful software developer, but true confidence (as opposed to arrogance) does not preclude one from understanding that he or she is not necessarily always correct.</p>
<p><strong>The Cost of Not Realizing There is Much More to Learn</strong></p>
<p>I have seen many individuals who believe they have all the answers and make silly statements or, even worse, make unnecessarily costly decisions because of their arrogance and lack of understanding of their own limitations.  By not having at least an idea of what one doesn't know, one is not able to sufficiently consider other ideas, to question the correctness of one's own decisions, and to realize the importance of learning new things.</p>
<p><strong>The More We Learn, the More We Realize That We Don't Know</strong></p>
<p>I have found that the more I learn and understand a particular subject, the more I realize how much more I still have to learn.  It seems that I can only understand the bigger picture of a language or framework once I have begun to understand specific details of that language or framework.  As I immerse myself in a new language or framework, I'm more likely to notice relevant articles posted on <a href="http://www.dzone.com/links/index.html">DZone</a> or <a href="http://www.reddit.com/r/programming/">Reddit</a>.  Better yet, the more I learn about something, the more these blogs and articles make sense to me and the bigger the possibilities become.</p>
<p>As an example of this principle, consider a person learning the Java programming language.  He or she may at first think only of the <a href="http://java.sun.com/javase/">programming language itself</a> and focus on <a href="http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html">keywords</a>, <a href="http://java.sun.com/docs/books/jls/second_edition/html/syntax.doc.html">syntax</a>, and so forth.  As the person gains familiarity with Java SE, he or she may start to be more exposed to <a href="http://java.sun.com/javaee/">Java EE</a> principles.  Similarly, the developer may start to learn about other languages on the <a href="http://java.sun.com/docs/books/jvms/">JVM</a>.  In addition, that developer may start to learn about frameworks and libraries available for use.  During all this, that developer continues to learn the <a href="http://java.sun.com/javase/6/docs/api/">Java APIs</a> and how vast they are.  What seemed like a simple language turns out to be a complex, ever-changing ecosystem.</p>
<p>The interesting phenomenon here is that because I have repeatedly realized how much more I still have to learn after I have learned substantially new information, I assume that I will continue to realize that I have even more to learn as I continue to learn and gain experience.  In other words, the absolute amount of knowledge I would like to learn to be more effective is likely to only get larger, even as I learn new things.  It's not that I realize that I need to learn more despite my current learning; rather it's precisely because I'm learning that I realize how much more I still need to learn.</p>
<p><strong>Conclusion</strong></p>
<p>When one understands that he or she may not be always correct, he or she is more likely to catch their own mistakes early before they are most costly, is more likely to listen to and seriously consider alternative approaches, and is more likely to keep bettering himself or herself.  I am realizing that it is actually a good sign when I understand how much I still have to learn -- this often means that I'm starting to get a much better understanding of the big picture and how things fit together.</p>
    ]]></content>
  </entry>
  <entry>
    <title>Missed RubyConf? Attend Qcon&#039;s Ruby Track!</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3629" />
    <id>http://www.javaworld.com/community/node/3629</id>
    <published>2009-10-31T14:22:10-04:00</published>
    <updated>2009-11-01T02:37:37-05:00</updated>
    <author>
      <name>Charles Nutter</name>
    </author>
    <summary type="html"><![CDATA[<!--paging_filter--><p>This year, RubyConf reportedly reduced their attendee cap to 250 people (Update: actually 450 people), after hosting a 500 to 600-person conference last year. As you can imagine, this meant a lot of people that wanted to attend were not able to get tickets. To complicate matters, the RubyConf registration site happened to go live during the middle of the night EU time, and by the time most Europeans woke up it was already sold out. What's a Rubyist to do?</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>This year, RubyConf reportedly reduced their attendee cap to 250 people (Update: actually 450 people), after hosting a 500 to 600-person conference last year. As you can imagine, this meant a lot of people that wanted to attend were not able to get tickets. To complicate matters, the RubyConf registration site happened to go live during the middle of the night EU time, and by the time most Europeans woke up it was already sold out. What's a Rubyist to do?</p>
<p>Well there's another option. Working with Ryan Slobojan of InfoQ and the organizers of Qcon San Francisco, I'll be hosting a one-day Ruby track the day before RubyConf! Qcon's main conference runs Wednesday through Friday, with my track on Wednesday, November 18th.</p>
<p>And now the REALLY good news! Because we wanted this to be a fallback for folks that could not attend RubyConf, we realized that the full conference fee was simply too high (ranging from $1500 up). So to make it possible for people to attend just the one day Ruby track, you can register with the code "rubywednesday" to get a drastically reduced $350 one-day conference pass. And to sweeten the deal even more, you can pop over to other tracks and attend the keynotes that day. Yes Virginia, there is a Santa Claus!</p>
<p>Those of you attending RubyConf are also welcome to attend this one-day track as well; most of the presentations won't overlap. <a href="http://qconsf.com/sf2009/tracks/show_track.jsp?trackOID=318">Here's the lineup</a>, including a special opening presentation by Yukihiro Matsumoto himself!</p>
<p>10:20 - "The Many Facets of Ruby" track opening by me<br />Ruby has seen a dramatic growth in popularity over the last few years, and there are now many facets to the Ruby story - multiple implementations, game-changing web frameworks, and large-scale use in enterprise solutions. Join us as we explore many aspects of Ruby in today's world.<br />10:30 - "Why we love Ruby?" by Yukihiro Matsumoto<br />Why we love Ruby? I have asked myself this question repeatedly. In this presentation, I will disclose my answer as of 2009. The keyword is QWAN.<br />11:45 - "Basking in the Limelight" by Paul Pagel<br />Limelight is Ruby on the desktop.  Build applications with multiple windows, or just one window.  Take control of the desktop, or play nicely with the desktop.  Create fun animated games, or productive business apps.  Develop rich internet applications, or unwired apps to make you rich.  Publish your apps on the internet, or keep them for you and your friends.   Do all this, writing nothing but Ruby code, in Limelight.<br />13:45 - "You've Got Java in my Ruby" by Thomas Enebo<br />JRuby is now well-established as a popular alternative implementation of Ruby.But why would you want to use it? How can it help you? This talk will detail some of the more interesting differences and advantages of using JRuby. Expect to get a better understanding of how Java makes a faster and more stable Ruby as well as how you can leverage Java features as an extra set of tools for your project.<br />15:00 - "Rails 3" by Yehuda Katz<br />I don't have a full abstract for this, but it's what you might expect...an overview of why Rails 3 is really "growing up" the framework, making it more clearly componentized and easier to adapt to more complicated (dare I say "enterprise") applications in the future. In working with Yehuda I know he's also paid special attention to performance.. Rails 3 is going to be excellent.<br />16:30 - "Rails in the Large: How Agility Allows Us to Build One of the World's Biggest Rails Apps" by Neal Ford<br />While others have been debating whether Rails can scale to enterprise levels, we've been demonstrating it. ThoughtWorks is running one of the largest Rails projects in the world, for an Enterprise. This session discusses tactics, techniques, best practices, and other things we've learned from scaling rails development. I discuss infrastructure, testing, messaging, optimization, performance, and the results of lots of lessons learned, including killer rock-scissors-paper tricks to help you avoid babysitting the view tests!</p>
<p>I think it's going to an outstanding track, and I'd probably pay the $350 just to see Matz speak if I knew I wouldn't get another chance for a long time. Limelight looks like an outstanding way to build rich client apps using JRuby, and of course you know I like JRuby. Tom will show some of the latest advancements we've done in JRuby, including the ability to produce "real" Java classes at runtime for integrating with Java frameworks better. Rails 3 I've described above, but you really have to see Yehuda present it himself. And of course everyone would like to know how to scale Rails to the moon...Neal knows his stuff.</p>
<p>Here's the track page: <a href="http://qconsf.com/sf2009/tracks/show_track.jsp?trackOID=318">The Many Facets of Ruby</a></p>
<p>And the <a href="http://qconsf.com/sf2009/schedule/wednesday.jsp">full conference schedule for Wednesday</a>.</p>
<p>And finally, the <a href="http://qconsf.com/sf2009/registration/">registration page</a> (don't forget to use code "rubywednesday").</p>
<p>I really hope to see you all there, so you can get your Ruby conference fix this fall. Tell your friends and let me know if you have any questions!</p>
    ]]></content>
  </entry>
  <entry>
    <title>When Do You Have &quot;Enough&quot; Design Time?</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3625" />
    <id>http://www.javaworld.com/community/node/3625</id>
    <published>2009-10-30T09:33:28-04:00</published>
    <updated>2009-10-30T09:39:25-04:00</updated>
    <author>
      <name>Esther Schindler</name>
    </author>
    <category term="design" />
    <summary type="html"><![CDATA[<p>How do you know when it's time to stop staring out the window... and start coding?</p>
<p>The department had been given a new project. It was a bit like earlier projects, but had a few unique needs that made the application interesting. On the plus side, the software was built using the same framework that the team was used to. So the developers interviewed the users, gathered requirements... and that's when things went astray.</p>
<p>Maybe.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>How do you know when it's time to stop staring out the window... and start coding?</p>
<p>The department had been given a new project. It was a bit like earlier projects, but had a few unique needs that made the application interesting. On the plus side, the software was built using the same framework that the team was used to. So the developers interviewed the users, gathered requirements... and that's when things went astray.</p>
<p>Maybe.</p>
<p>One journeyman developer &mdash; I'll call him Paul, though names have been changed to protect identities &mdash; immediately gathered his tools around himself like a security blanket, and started writing code. His more senior colleague (whom I'll call Leo) took umbrage at this.</p>
<p>"You haven't thought this through," Leo told Paul. "There are a lot of ways we could address these needs. You thought of one, and you didn't consider whether another approach would be faster, or easier, or more robust. Or <em>anything</em>."</p>
<p>"But this <em>works</em>," said Paul. "I can always refactor it."</p>
<p>Perhaps Paul can. Perhaps he chose the best option (purely by luck). But Leo feels that Paul saying he'll "refactor" the design is an excuse for not-designing in the first place &mdash; throwing code against the wall and seeing what sticks. He believes Paul's "dive right in" approach is laziness that will eventually trip him up, and as a result will probably delay the team (and the project). It's one thing to re-think the way you wrote something, says Leo, but another to re-design a building after the foundation is poured.</p>
<p>Leo credits Paul's (and others') too-short design-time to early school training, when we were all criticized for "daydreaming," though the ability and willingness to daydream is a critical skill for anybody in a creative field. Leo himself says he spends at least 30% of his project-time creating the design before he starts to create the application; he tries out several designs in his head before he decides which one is right. Perhaps he expects others to do the same thing.</p>
<p>I don't think there's one right answer. Some people do design on-the-fly. Others construct an entire application in their head before they put hands to keyboard. I have a tropism to the latter mode myself, or at least I have learned to recognize the signs for when I've reached the end of my Research Phase and am ready to write. (My "notes" begin to look less like bullet points and turn into sentences, then paragraphs.)</p>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script><p>When I began thinking about this scenario, I started to put together a poll to ask you about the amount of time you spend on design, and a second one to ask how much your time you <em>wish</em> you could spend designing applications rather than writing, testing, or (ick) in meetings. But I could never find a way to phrase the question.</p>
<p>First, you might not identify your design time as such. When you're at your most creative, you probably aren't thinking about the process. Mihaly Csikszentmihalyi's <a href="http://www.amazon.com/gp/product/0060928204?ie=UTF8&amp;tag=thegroovycorpora&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0060928204"">Creativity: Flow and the Psychology of Discovery and Invention</a> goes into marvelous detail about "getting into flow" (the same process that <a href="http://www.amazon.com/gp/product/0932633439?ie=UTF8&amp;tag=thegroovycorpora&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0932633439">Peopleware</a> addressed by explaining the sin of calling a programmer on the phone, because it takes at least 15 minutes to get into a warm creative zone again.) Many of us get our best ideas in the shower, while riding a bike, driving. (Csikszentmihalyi offers an explanation why.) Design doesn't happen when you sit down at a desk with a pad of paper and a sharpened pencil, so how could I ask how much of your time is devoted to it?</p>
<p>Plus, the percentage of time you need to devote to designing one project isn't related to the time you spend on another. Not every application requires earth-shattering innovation. A smaller application probably (not always but probably) doesn't require as much design time as a mission critical corporate SOA project that touches every corner of the enterprise.</p>
<p>So then I thought I'd ask whether you felt that on a typical project, you spent enough time on design. But that doesn't work, either. Paul would say Yes, he spent enough time designing his software; Leo would object strenuously.</p>
<p>So much for the poll. But I think you know what I'm trying to get at: When do you know you're done with the design? By which I mean "the design for this piece;" if you use Agile, you're probably ready to tell me that you don't try to design everything up front. (Yeah yeah, I <em>know</em>.) But at some point you <em>do</em> stop staring out the window, and you reach for the keyboard. You're ready. How do you know when that happens? And how much of your time <em>do</em> you spend designing... at least compared to the other developers you know?</p>
<p><em>You probably should <a href="http://www.twitter.com/estherschindler">follow me on Twitter</a>. Because, y'know, you just should.</em></p>
    ]]></content>
  </entry>
  <entry>
    <title>Internet Archive WayBack Machine: Valuable Technical Reference</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3624" />
    <id>http://www.javaworld.com/community/node/3624</id>
    <published>2009-10-29T16:41:00-04:00</published>
    <updated>2009-11-06T03:37:18-05:00</updated>
    <author>
      <name>dmarx</name>
    </author>
    <category term="Dustin" />
    <category term="General Development" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>Have you ever bookmarked a really good technical resource, but were disappointed when you tried to access that page later and it was gone?  Have you ever seen what looks like the perfect linked resource in a blog post, article, or book, but then found the referenced URL to not work?  In short term cases such as an intermittent server issue or network problem, <a href="http://googlesystem.blogspot.com/2007/01/browsing-web-using-google-cache.html">Google Cache</a> can be an indispensable tool to see a cached version of the page.</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>Have you ever bookmarked a really good technical resource, but were disappointed when you tried to access that page later and it was gone?  Have you ever seen what looks like the perfect linked resource in a blog post, article, or book, but then found the referenced URL to not work?  In short term cases such as an intermittent server issue or network problem, <a href="http://googlesystem.blogspot.com/2007/01/browsing-web-using-google-cache.html">Google Cache</a> can be an indispensable tool to see a cached version of the page.  When a page has been completely removed for a long time, a web page archiving site is more helpful.</p>
<p>A particularly easy site archive tool to use is <a href="http://www.archive.org/index.php">Internet Archive</a>'s <a href="http://www.archive.org/web/web.php">WayBack Machine</a>.  This free online tool is very easy to use if you know the URL of the page you care about (which you would if the URL was part of a bookmark or if you clicked on a link to a site that was no longer present).  You can enter the URL in the form field at the <a href="http://www.archive.org/web/web.php">Wayback Machine page</a>, click on the button saying "Take Me Back."</p>
<p><a href="http://2.bp.blogspot.com/_sDOe5HxTdMk/Suo1hatAk7I/AAAAAAAABYk/-nJXlv3hXfE/s1600-h/waybackMachineTakeMeBackGeoCitiesCommonStrutsErrorsAndCauses.png"></a></p>
<p>After doing the above, you see a detailed history of changes to the page at that location.  This is demonstrated in the following screen snapshot.</p>
<p><a href="http://2.bp.blogspot.com/_sDOe5HxTdMk/SuolI65O9sI/AAAAAAAABYM/RaUGhAFVU4s/s1600-h/internetArchiveWayBackMachine-strutsCommonErrors.png"></a></p>
<p>The above screen snapshot demonstrates use of Internet Archive Wayback Machine to see a history of my page on <a href="http://sites.google.com/site/dustinmarx/home/struts_errors-html">Common Struts Errors and Their Causes</a> that was originally posted on GeoCities, but is no longer available due to the <a href="http://marxsoftware.blogspot.com/2009/10/impact-of-demise-of-geocities-on-online.html">demise of GeoCities</a>.</p>
<p>Even though the page is no longer available at the GeoCities URL, its archived versions can still be viewed via the Internet Archive WayBack Machine.  The following two images show what happens when one tries to access the page at its former GeoCities address and then what happens when using one of the <a href="http://www.archive.org/web/web.php">Internet Archive WayBack Machine</a>'s archived versions.</p>
<p><a href="http://2.bp.blogspot.com/_sDOe5HxTdMk/SuonwzVmz6I/AAAAAAAABYU/Y_ugLHg2fQY/s1600-h/cannotAccessCommonStrutsErrorsGeoCitiesPage.png"></a></p>
<p><a href="http://4.bp.blogspot.com/_sDOe5HxTdMk/SuoowpWR8bI/AAAAAAAABYc/rUbCWaZp6iQ/s1600-h/commonStrutsErrorsViaInternetArchiveWayBackMachine.png"></a></p>
<p>As the screen snapshots above indicate, the page that is no longer available on GeoCities is still available via Internet Archive WayBack Machine.  In my case, I have <a href="http://sites.google.com/site/dustinmarx/home/struts_errors-html">hosted this page</a> at <a href="http://www.google.com/sites/help/intl/en/overview.html">Google Sites</a> and there are many other mirrored copies of it on the web, but the Internet Archive can be useful for finding pages that don't get copied or hosted on alternative sites.  Because Internet Archive WayBack Machine also provides various versions of the same page, a history of a particular page can be seen.</p>
<p>The recent loss of GeoCities-hosted pages only one of many examples of original content being removed from the web.  A relatively recent well-known example of loss of original content was the sudden and somewhat surprising <a href="http://www.rubyinside.com/why-the-lucky-stiff-is-missing-2278.html">online disappearance</a> of <a href="http://en.wikipedia.org/wiki/Why_the_lucky_stiff">why the lucky stiff</a>.  The next two screen snapshots show a page from the popular Why's (poignant) Guide to Ruby.  The first snapshot indicates that the original page is no longer available at its original URL (<a href="http://www.poignantguide.net/ruby/chapter-1.html" title="http://www.poignantguide.net/ruby/chapter-1.html">http://www.poignantguide.net/ruby/chapter-1.html</a>), but the second snapshot indicates that it is archived and accessible with WayBack Machine (at <a href="http://web.archive.org/web/20080526095452/www.poignantguide.net/ruby/chapter-1.html">http://web.archive.org/web/20080526095452/www.poignantguide.net/ruby/chapter-1.html</a>).</p>
<p><a href="http://3.bp.blogspot.com/_sDOe5HxTdMk/Suo_rONKCJI/AAAAAAAABYs/ndEQJ3z1Fzs/s1600-h/noWhyPoignantGuideToRubyOriginalUrlChrome.png"></a></p>
<p><a href="http://3.bp.blogspot.com/_sDOe5HxTdMk/Suo_z4qL0RI/AAAAAAAABY0/Ck_LSPzypI0/s1600-h/whysPoigantGuideToRubyArchivedWeyBackMachine.png"></a></p>
<p>So far, I've only discussed the simple search implemented by providing the URL and clicking on the "Take Me Back" button.  There are many <a href="http://web.archive.org/collections/web/advanced.html">advanced search options</a> as well.  If you have an e-mail or bookmark with a URL that no longer works, you'll often have a date on the e-mail or a date on the bookmark property of when it was created.  You can use that date with WayBack Machine to find the page as of that date.  This is especially useful for an easy way to recollect history.</p>
<p>What was big in the world of Java in late 2004?  To find this out, I could look at archives for some major players in the Java world.  For example, the <a href="http://java.sun.com/">java.sun.com</a> page on the last day of 2004 looked like that shown in the next screen snapshot:</p>
<p><a href="http://2.bp.blogspot.com/_sDOe5HxTdMk/SupF8fxI6wI/AAAAAAAABY8/o1ZCzYC4hWQ/s1600-h/javaSunComEndOf2004ViaWayBackMachine.png"></a></p>
<p>We can see from the above screen snapshot (I had entered <a href="http://web.archive.org/web/20041231/java.sun.com/">http://web.archive.org/web/20041231/java.sun.com/</a> with a day but no time, but it resolved to <a href="http://web.archive.org/web/20041231092116/java.sun.com/">http://web.archive.org/web/20041231092116/java.sun.com/</a> with a day and appropriate time) that big topics at the end of 2004 included early access to binaries and source of <a href="http://java.sun.com/javase/6/">Java SE 6</a> (<a href="http://en.wikipedia.org/wiki/Java_version_history">then still called</a> as <a href="http://www.java.com/en/about/brand/naming.jsp">J2SE 6</a> or <a href="http://java.sun.com/javase/6/webnotes/version-6.html">Mustang</a>) and <a href="http://www.netbeans.org/">NetBeans</a> 4.0.</p>
<p>As a final example, I'll look at something from the very early days of Java.  The URL <a href="http://web.archive.org/web/19970211220056/www.sun.com/sunworldonline/swol-10-1995/swol-10-javadigest.html">http://web.archive.org/web/19970211220056/www.sun.com/sunworldonline/swol-10-1995/swol-10-javadigest.html</a> provides an interesting article from <a href="http://www.sparcproductdirectory.com/2000-12-3.html">SunWorld Online</a> called <a href="http://sunsite.uakom.sk/sunworldonline/swol-10-1995/swol-10-javadigest.html">Java users reveal their habit</a>.  This makes for very interesting historical perspective for those of us in the Java community.  For those of us who have been around since the public inception of Java, it is a reminder that <a href="http://java.sun.com/applets/">applets</a> were once the "big thing" in the Java world.  For those who are not familiar with the early days of Java, it can provide an interesting perspective on how far things have come (and how much some things are still the same).</p>
<p>Assuming that the deal for <a href="http://marxsoftware.blogspot.com/2009/04/oracle-buying-sun-not-that-big-of.html">Oracle to acquire Sun Microsystems</a> goes through, there is some question about what will happen to the wealth of Java resources available online at domains such as <a href="http://java.sun.com/">http://java.sun.com/</a> (such as the <a href="http://java.sun.com/javase/6/docs/">JDK 6 Documentation</a>).  These articles and other documents will almost assuredly continue to exist (even if at a different URL that includes "oracle" in its name), but it is still comforting to know that the archived versions should also be available via the WayBack Machine.</p>
<p>There are many valuable benefits to having old web pages still available after their deletion and having the ability to see older versions of a particular web page.  When one runs into the all-too-common frustration of finding a bookmark or link that is no longer valid, the Internet Archive WayBack Machine is a very welcome tool. However, such power can also be abused.  Some articles that talk about people who are not too happy with the power of the WayBack Machine include <a href="http://www.boingboing.net/2005/07/13/internet_archive_sue.html">Internet Archive Sued Over WayBack Machine</a> and <a href="http://news.cnet.com/8301-10784_3-6109451-7.html">Internet Archive Settles Suit Against WayBack Machine</a>.</p>
<p>As an interesting side note, there is a Java-based, open source implementation of the WayBack Machine called <a href="http://archive-access.sourceforge.net/projects/wayback/">wayback</a>.</p>
<p><strong>Conclusion</strong></p>
<p>There is no question that the ability to link documents via hyperlinks is one of the main reasons for the success of HTTP and the World Wide Web.  It is very convenient to click on links in bookmarks, e-mail messages, articles, blogs, and even type in URLs from books and go directly to the referenced site.  On the other hand, one of the greatest disappointments when using the web is when a hyperlink is no longer valid.  Although a search engine might be able to tell you a page's new location (or the location of a mirror or copy), or Google Cache might be used to see a cached version of a page that is temporarily down, a tool like the Internet Archive WayBack Machine is sometimes what is needed to see a page that is no longer otherwise available.  In cases where the page still exists, but information that was previously available has been removed, WayBack Machine's ability to see historical versions of that particular page is very useful.  In many ways, using WayBack machine definitely feels like <a href="http://science.howstuffworks.com/time-travel.htm">time travel</a>.</p>
    ]]></content>
  </entry>
  <entry>
    <title>Java Store limps to daylight</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3623" />
    <id>http://www.javaworld.com/community/node/3623</id>
    <published>2009-10-29T14:32:50-04:00</published>
    <updated>2009-10-29T14:25:14-04:00</updated>
    <author>
      <name>Josh Fruhlinger</name>
    </author>
    <category term="Java ME" />
    <category term="Java Store" />
    <category term="money-making schemes" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>While we all wait for the Sun-Oracle merger to wind its way to a close (by January, maybe?), let's pause to acknowledge what should be kind of big Java news: the advent of the Java Store, which should be open to shoppers "<a href="http://blogs.sun.com/theplanetarium/entry/java_store_readying_to_open" target="_blank">in the next week or so</a>"!   And if you're wondering about the selection, know that the number of apps on the shelves is already ... approaching <em>50!</em></p>    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>While we all wait for the Sun-Oracle merger to wind its way to a close (by January, maybe?), let's pause to acknowledge what should be kind of big Java news: the advent of the Java Store, which should be open to shoppers "<a href="http://blogs.sun.com/theplanetarium/entry/java_store_readying_to_open" target="_blank">in the next week or so</a>"!   And if you're wondering about the selection, know that the number of apps on the shelves is already ... approaching <em>50!</em></p>

<p>OK, forgive me for stifling a bit of laughter.  In my <a href="http://www.itworld.com/blog/43" target="_blank">other blogging life</a>, I cover Apple, and of course the iPhone App Store counts its offerings in the tens of thousands.  This is an unfair comparison -- the App Store is more mature, obviously -- but the Java Store strikes me as a fairly obvious copycat service, so I think it's sort of inevitable.</p>

<p>Of more fundamental concern is just what the <em>point</em> of the Java Store is.  The App Store economic equation goes something like this: Having lots of bits of specialized functionality makes the iPhone platform more attractive, and rather than writing all those Apps themselves, Apple is happy to provide a marketplace simple enough to provide economic incentive for programmers to do the work for them.  Apple takes its cut, of course, but that revenue isn't really the main purpose, and pales in comparison to the gobs of cash the company makes selling the phones (phones which, keep in mind, are easier to sell because "there's an app for that").</p>

<p>But what sort of money-making activities is the Java Store supposed to prompt?  The Java runtime is free to end users, so more downloads don't profit Sun (despite the fact that the company routinely trumpets the number of JRE downloads as relating to its health somehow).  If the store's a success (big if), it could provide an incentive to get more people writing Java apps, but again, why?  Is that going to sell more Sun servers or Oracle all-in-one enterprise appliances?</p>

<p>If there is something potentially profitable here, it's the possibility of mobile sales -- remember, Sun does charge (and turn a profit from) Java ME licensing on handsets.  It's important to note that the Java Store has two parts -- the Store, which is the front end, and the <a href="http://java.sun.com/warehouse/" target="_blank">Warehouse</a>, which is where all the apps are stored and organized.  My guess is that Sun is hoping that the Warehouse will be attractive as a ready-made backend for carriers who want to launch their own App Stores on their handsets (particularly their <a href="http://www.javaworld.com/community/node/3425" target="_blank">not-quite-smartphones</a>).  That's a real potential moneymaker for Java -- a shocker, I know!  We'll see if it takes off.</p>    ]]></content>
  </entry>
  <entry>
    <title>Reocities: GeoCities Rising from the Ashes</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3617" />
    <id>http://www.javaworld.com/community/node/3617</id>
    <published>2009-10-29T00:06:00-04:00</published>
    <updated>2009-11-06T03:37:18-05:00</updated>
    <author>
      <name>dmarx</name>
    </author>
    <category term="Dustin" />
    <category term="General Development" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>I <a href="http://marxsoftware.blogspot.com/2009/10/impact-of-demise-of-geocities-on-online.html">previously wrote</a> about the <a href="http://www.javaworld.com/community/node/3528">potential loss of historical technical details</a> as a result of the <a href="http://adactio.com/journal/1573/">demise of Yahoo! GeoCities</a>.  I listed several useful technical pages hosted on GeoCities that might be lost.  Others have also pointed out that GeoCities provided a perspective of the early days of personal web pages with profound value for those interested in studying the history of the web.</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>I <a href="http://marxsoftware.blogspot.com/2009/10/impact-of-demise-of-geocities-on-online.html">previously wrote</a> about the <a href="http://www.javaworld.com/community/node/3528">potential loss of historical technical details</a> as a result of the <a href="http://adactio.com/journal/1573/">demise of Yahoo! GeoCities</a>.  I listed several useful technical pages hosted on GeoCities that might be lost.  Others have also pointed out that GeoCities provided a perspective of the early days of personal web pages with profound value for those interested in studying the history of the web.</p>
<p>I read with interest <a href="http://mashable.com/author/jennifer-van-grove/">Jennifer Van Grove</a>'s post <a href="http://mashable.com/2009/10/28/reocities/">One Man's Quest to Bring GeoCities Back from the Dead</a>.  The endeavor she highlights, instantiated as the <a href="http://www.reocities.com/">ReoCities</a> site, is interesting enough because of the salvaged data of potentially significant value.  Perhaps even more interesting, though, is the technical challenge associated with this and the approach being used.  More details on this can be found in <a href="http://www.reocities.com/newhome/makingof.html">The Making Of, a story of stress and scripting</a>.</p>
<p>According to the <a href="http://en.wikipedia.org/">Wikipedia</a> <a href="http://en.wikipedia.org/wiki/GeoCities">entry for GeoCities</a>, other efforts to archive potentially valuable data hosted on GeoCities include <a href="http://www.archive.org/index.php">Internet Archive</a> and <a href="http://internetarchaeology.org/">InternetArchaeology</a>.</p>
    ]]></content>
  </entry>
  <entry>
    <title>Java speaking for itself</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3614" />
    <id>http://www.javaworld.com/community/node/3614</id>
    <published>2009-10-28T00:54:51-04:00</published>
    <updated>2009-10-28T00:51:27-04:00</updated>
    <author>
      <name>Josh Fruhlinger</name>
    </author>
    <category term="merger" />
    <category term="Oracle" />
    <category term="sun" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>In the light of the delayed Sun-Oracle merger (and see the <em>New York Times</em> Dealbook blog for a <a href="http://dealbook.blogs.nytimes.com/2009/10/22/weak-points-of-sun-deal-come-out-in-europe/" target="_blank">brutal analysis</a> of how the deal was structured to put Sun in a poor position in case of just such delays), there's been a lot of anxiety about Java's future.  With the companies unable to really comment on future plans, of course, this has led to anxious seizing on any little tidbit to guide the way.</p>    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>In the light of the delayed Sun-Oracle merger (and see the <em>New York Times</em> Dealbook blog for a <a href="http://dealbook.blogs.nytimes.com/2009/10/22/weak-points-of-sun-deal-come-out-in-europe/" target="_blank">brutal analysis</a> of how the deal was structured to put Sun in a poor position in case of just such delays), there's been a lot of anxiety about Java's future.  With the companies unable to really comment on future plans, of course, this has led to anxious seizing on any little tidbit to guide the way.</p>

<p>Take, for instance, <a href="http://blogs.infosupport.com/blogs/berte/archive/2009/10/14/impressions-from-oracle-openworld-is-oracle-good-for-java.aspx" target="_blank">this anxious piece from Bert Ertman</a>.  Ertman went to Oracle OpenWorld and saw attention being lavished on Sun's hardware and on Solaris and MySQL (despite the trouble the latter has caused) as future components of seamless Oracle appliances.  He's seized on a gnomic line from Larry Ellison -- "Java speaks for itself" -- as indicating that Java will get short shift.</p>

<p>I think he's probably right in his speculation that Oracle sees Java as a "product" from Sun that it can take advantage of.  But maybe we should wait until we see how this plays out before we start really panicking.</p>     ]]></content>
  </entry>
  <entry>
    <title>Grails hip tip: exporting schema DDLs</title>
    <link rel="alternate" type="text/html" href="http://www.javaworld.com/community/node/3611" />
    <id>http://www.javaworld.com/community/node/3611</id>
    <published>2009-10-27T16:05:57-04:00</published>
    <updated>2009-11-06T02:41:48-05:00</updated>
    <author>
      <name>Andrew Glover</name>
    </author>
    <category term="agile" />
    <category term="Andy" />
    <category term="development 2.0" />
    <category term="grails" />
    <category term="groovy" />
    <category term="Hibernate" />
    <category term="java" />
    <category term="open source" />
    <category term="programming" />
    <category term="Spring" />
    <summary type="html"><![CDATA[<!--paging_filter--><p>If you utilize <a href="http://grails.org/">Grails</a> out-of-the-box and don&#8217;t change any of the connection profiles, your hip application will be bound to an in memory instance of <a href="http://hsqldb.org/">HSQLDB</a> &#8212; this is fine and dandy for developmental purposes, but oftentimes, you&#8217;ll want to run Grails on top of a more permanent data store (keep in mind that you can operate in such a manner with HSQLDB&#8217;s file based persistence).</p>
    ]]></summary>
    <content type="html"><![CDATA[<!--paging_filter--><p>If you utilize <a href="http://grails.org/">Grails</a> out-of-the-box and don&#8217;t change any of the connection profiles, your hip application will be bound to an in memory instance of <a href="http://hsqldb.org/">HSQLDB</a> &#8212; this is fine and dandy for developmental purposes, but oftentimes, you&#8217;ll want to run Grails on top of a more permanent data store (keep in mind that you can operate in such a manner with HSQLDB&#8217;s file based persistence). For example, if it&#8217;s your bag, you might want to eventually deploy to an instance of <a href="http://www.mysql.com/">MySQL</a>, once your data model stabilizes somewhat &#8212; in that case, you&#8217;ll have to create a database in your MySQL instance. </p>
<p>In previous versions of Grails, this was challenging; however, in more recent versions, you can quickly understand the underlying schema definition via the <code>&lt;a href=&quot;http://grails.org/doc/1.1/ref/Command%20Line/schema-export.html&quot;&gt;schema-export&lt;/a&gt;</code> command. What&#8217;s more, with this command, you can create a new instance of a schema in your target database environment provided you take care to set the proper Hibernate <a href="https://www.hibernate.org/hib_docs/v3/api/org/hibernate/dialect/package-summary.html">dialect</a>.</p>
<p>The <code>schema-export</code> command works quite copacetically; indeed, it&#8217;ll generate a valid <a href="http://en.wikipedia.org/wiki/Data_Definition_Language">DDL</a> file for HSQLDB &#8212; that is, even if you change your <code>DataSource.groovy</code> file to point to MySQL, the DDL file will still be specific to HSQLDB, which, of course, can cause issues with MySQL. For instance, the SQL DDL</p>
<p><code>id bigint generated by default as identity (start with 1)</code></p>
<p>isn&#8217;t valid within MySQL; in fact, the same statement in MySQL parlance would be:</p>
<p><code>id bigint not null auto_increment</code></p>
<p>Thus, to force the <code>schema-export</code> command to generate a dialect (i.e. specific database DDL), you must set the <code>dialect</code> property inside the top <code>datasource</code> section of your <code>DataSource.groovy</code> file like so:</p>
<p><code>dialect=org.hibernate.dialect.MySQLDialect.class</code></p>
<p>In the case above, I&#8217;ve forced the dialect to be specific to MySQL; accordingly, when I execute the <code>schema-export</code> command (i.e. <code>%&amp;gt;grails schema-export</code>) I&#8217;ll have a DDL generated that is valid for MySQL (as opposed to HSQLDB). Of course, you can do the same for Oracle, DB2, etc. Can you dig it, man? </p>
<p>You can now follow <a href="http://twitter.com/thediscoblog">The Disco Blog on Twitter</a>, baby!</p>
    ]]></content>
  </entry>
</feed>
