<?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>SteveX Compiled &#187; Java</title>
	<atom:link href="http://blog.stevex.net/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stevex.net</link>
	<description>Software development and other notes.</description>
	<lastBuildDate>Tue, 07 Feb 2012 19:52:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Aggregation vs Inheritance</title>
		<link>http://blog.stevex.net/2005/11/aggregation-vs-inheritance/</link>
		<comments>http://blog.stevex.net/2005/11/aggregation-vs-inheritance/#comments</comments>
		<pubDate>Sat, 19 Nov 2005 22:34:50 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/11/19/aggregation-vs-inheritance/</guid>
		<description><![CDATA[Anyone remember the war between Microsoft and IBM over aggregation versus inheritance? It was basically the COM vs CORBA war. The Workplace Shell in OS/2 was based on inheritance &#8211; if you wanted to extend the shell, you subclassed one of the shell objects and overrode functions. Explorer, in Windows, being based on COM, went [...]]]></description>
			<content:encoded><![CDATA[<p>Anyone remember the war between Microsoft and IBM over aggregation versus inheritance?</p>
<p>It was basically the COM vs CORBA war.  The <a href="http://toastytech.com/guis/os220.html">Workplace Shell</a> in OS/2 was based on inheritance &#8211; if you wanted to extend the shell, you subclassed one of the shell objects and overrode functions.  Explorer, in Windows, being based on COM, went the other way &#8211; aggregation.  The shell defined interfaces, and you implemented those interfaces.</p>
<p>A quote from the IBM side:</p>
<blockquote><p>
   &#8220;Inheritance is dangerous, so Microsoft&#8217;s COM won&#8217;t support it.<br />
   It&#8217;s like saying divide-by-zero is dangerous, so let&#8217;s remove<br />
   the divide operation from our microprocessors.&#8221;<br />
             &#8212; Cliff Reeves, IBM Director of Objects
</p></blockquote>
<p>I wonder if IBM still has a Director of Objects.  Anyway, I was reading <a href="http://safari.oreilly.com/JVXSL.asp?x=1&#038;mode=section&#038;sortKey=rank&#038;sortOrder=desc&#038;view=section&#038;xmlid=0-201-31005-8&#038;k=10&#038;g=&#038;srchText=effective+java&#038;code=&#038;h=0&#038;m=&#038;l=1&#038;j=list&#038;catid=&#038;s=1&#038;b=1&#038;f=1&#038;t=1&#038;c=1&#038;u=1&#038;r=&#038;o=1&#038;n=1&#038;d=1&#038;p=1&#038;a=0&#038;page=0">Effective Java on Safari</a> and I ran across this statement:</p>
<blockquote><p>
The main disadvantage of static factory methods is that classes without public or protected constructors cannot be subclassed. The same is true for nonpublic classes returned by public static factories. For example, it is impossible to subclass any of the convenience implementation classes in the Collections Framework. Arguably this can be a blessing in disguise, as it encourages programmers to use composition instead of inheritance
</p></blockquote>
<p>For some reason I guess I assumed Java would have gone the IBM way (which seemed to be the anti-Microsoft way, and Sun is all about choosing the anti-Microsoft way whenever they can) but fortunately it seems everyone agreed that COM&#8217;s model of aggregation (composition) works better in the real world, and that adding functionality by subclassing and multiple inheritance wasn&#8217;t the way to build a system.  Cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/11/aggregation-vs-inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tomcat Tip</title>
		<link>http://blog.stevex.net/2005/11/tomcat-tip/</link>
		<comments>http://blog.stevex.net/2005/11/tomcat-tip/#comments</comments>
		<pubDate>Thu, 10 Nov 2005 22:55:28 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/11/10/tomcat-tip/</guid>
		<description><![CDATA[When you first install Tomcat, there doesn&#8217;t seem to be any account configured with admin rights. This keeps the default install secure, but of course the first thing you&#8217;re going to want to do is log in to your new installation with admin rights. To grant the tomcat user admin rights, edit conf/tomcat-users.xml. It starts [...]]]></description>
			<content:encoded><![CDATA[<p>When you first install <a href="http://tomcat.apache.org">Tomcat</a>, there doesn&#8217;t seem to be any account configured with admin rights.  This keeps the default install secure, but of course the first thing you&#8217;re going to want to do is log in to your new installation with admin rights.  </p>
<p>To grant the tomcat user admin rights, edit conf/tomcat-users.xml.  It starts out looking like this:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;?xml version='1.0' encoding='utf-8'?&gt;<br />
&lt;tomcat-users&gt;<br />
&nbsp; &lt;role rolename=&quot;tomcat&quot;/&gt;<br />
&nbsp; &lt;role rolename=&quot;role1&quot;/&gt;<br />
&nbsp; &lt;user username=&quot;tomcat&quot; password=&quot;tomcat&quot; roles=&quot;tomcat&quot;/&gt;<br />
&nbsp; &lt;user username=&quot;role1&quot; password=&quot;tomcat&quot; roles=&quot;role1&quot;/&gt;<br />
&nbsp; &lt;user username=&quot;both&quot; password=&quot;tomcat&quot; roles=&quot;tomcat,role1&quot;/&gt;<br />
&lt;/tomcat-users&gt;</div></td></tr></tbody></table></div>
<p>Edit it to add the admin and manager roles to the tomcat user:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;?xml version='1.0' encoding='utf-8'?&gt;<br />
&lt;tomcat-users&gt;<br />
&nbsp; &lt;role rolename=&quot;tomcat&quot;/&gt;<br />
&nbsp; &lt;role rolename=&quot;role1&quot;/&gt;<br />
&nbsp; &lt;role rolename=&quot;manager&quot;/&gt;<br />
&nbsp; &lt;role rolename=&quot;admin&quot;/&gt;<br />
&nbsp; &lt;user username=&quot;tomcat&quot; password=&quot;tomcat&quot; roles=&quot;tomcat,admin,manager&quot;/&gt;<br />
&nbsp; &lt;user username=&quot;role1&quot; password=&quot;tomcat&quot; roles=&quot;role1&quot;/&gt;<br />
&nbsp; &lt;user username=&quot;both&quot; password=&quot;tomcat&quot; roles=&quot;tomcat,role1&quot;/&gt;<br />
&lt;/tomcat-users&gt;</div></td></tr></tbody></table></div>
<p>If you use exactly this, you could then log in as username tomcat, password tomcat.  But do yourself a favour and use a real password.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/11/tomcat-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple J2EE Application in 105 Easy Steps</title>
		<link>http://blog.stevex.net/2005/10/a-simple-j2ee-application-in-105-easy-steps/</link>
		<comments>http://blog.stevex.net/2005/10/a-simple-j2ee-application-in-105-easy-steps/#comments</comments>
		<pubDate>Wed, 05 Oct 2005 11:50:51 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/10/05/a-simple-j2ee-application-in-105-easy-steps/</guid>
		<description><![CDATA[Continuing my quest to understand J2EE, I Googled for &#8220;simple j2ee&#8221;. I found &#8220;A Simple J2EETM Application that Uses the JMS API&#8220;. By my count there are 105 steps to follow to create your simple application.]]></description>
			<content:encoded><![CDATA[<p>Continuing my quest to understand J2EE, I Googled for &#8220;simple j2ee&#8221;.  I found &#8220;<a href="<br />
http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/j2eeapp1.html">A Simple J2EETM Application that Uses the JMS API</a>&#8220;.  </p>
<p>By my count there are 105 steps to follow to create your simple application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/10/a-simple-j2ee-application-in-105-easy-steps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java XML vs .NET Framework</title>
		<link>http://blog.stevex.net/2005/09/java-xml-vs-net-framework/</link>
		<comments>http://blog.stevex.net/2005/09/java-xml-vs-net-framework/#comments</comments>
		<pubDate>Sun, 11 Sep 2005 14:57:45 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/09/11/java-xml-vs-net-framework/</guid>
		<description><![CDATA[The Java framework feels like a low level .NET framework. .NET has a lot of convenience functions that make doing common things easy, and the more I work with Java, the more I yearn for that. Today&#8217;s example: I want to load some XML and extract some text from a node. .NET code: 1234XmlDocument doc [...]]]></description>
			<content:encoded><![CDATA[<p>The Java framework feels like a low level .NET framework.</p>
<p>.NET has a lot of convenience functions that make doing common things easy, and the more I work with Java, the more I yearn for that.  </p>
<p>Today&#8217;s example:  I want to load some XML and extract some text from a node.</p>
<p>.NET code:</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">XmlDocument doc = new XmlDocument();<br />
doc.Load(&quot;myFile.xml&quot;);<br />
XmlNode node = doc.SelectNode(&quot;/item/description&quot;);<br />
string description = node.InnerText;</div></td></tr></tbody></table></div>
</pre>
<p>The equivalent Java code:</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();<br />
Document doc = builder.parse(&quot;myFile.xml);<br />
XPath xpath = XPathFactory.newInstance().newXPath();<br />
Node node = (Node)xpath.evaluate(&quot;/item/description&quot;, doc, XPathConstants.NODE);<br />
String description = node.getTextContent();</div></td></tr></tbody></table></div>
</pre>
<p>Which of these two APIs would you rather work with?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/09/java-xml-vs-net-framework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress, PHP, dateCreated</title>
		<link>http://blog.stevex.net/2005/09/wordpress-php-datecreated/</link>
		<comments>http://blog.stevex.net/2005/09/wordpress-php-datecreated/#comments</comments>
		<pubDate>Fri, 09 Sep 2005 12:04:22 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/09/09/wordpress-php-datecreated/</guid>
		<description><![CDATA[So back to my trying to post all my old blog entries. It&#8217;s important that they come over with the dates intact. The MetaWeblogAPI uses a hashtable of RSS keys to describe the blog entry, so the obvious way to do it would be to have the pubDate RSS item as one of the keys, [...]]]></description>
			<content:encoded><![CDATA[<p>So back to my trying to post all my old blog entries.  It&#8217;s important that they come over with the dates intact.</p>
<p>The MetaWeblogAPI uses a hashtable of RSS keys to describe the blog entry, so the obvious way to do it would be to have the pubDate RSS item as one of the keys, but that&#8217;s not how it works.</p>
<p>Instead, you have to supply a dateCreated, which they describe as an <a href="http://www.cl.cam.ac.uk/~mgk25/iso-time.html">ISO.8601</a> date.</p>
<p>Read the description of an ISO 8601 date, and look at the examples.  Now look at the PHP code that parses this date (from <a href="http://redalt.com/xref/trunk/nav.htm?_classes/index.htm">here</a>):</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$this-&gt;year = substr($iso, 0, 4);<br />
$this-&gt;month = substr($iso, 4, 2);<br />
$this-&gt;day = substr($iso, 6, 2);<br />
$this-&gt;hour = substr($iso, 9, 2);<br />
$this-&gt;minute = substr($iso, 12, 2);<br />
$this-&gt;second = substr($iso, 15, 2);<br />
$this-&gt;timezone = substr($iso, 17);</div></td></tr></tbody></table></div>
</pre>
<p>Not quite an ISO 8601 date parser is it?  Turns out you have to specify the date in exactly the format it wants, which is:</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">20050905T12:00:00Z</div></td></tr></tbody></table></div>
</pre>
<p>So now I can control the date I post with.  Another little hurdle crossed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/09/wordpress-php-datecreated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML Editor written in Java</title>
		<link>http://blog.stevex.net/2005/09/html-editor-written-in-java/</link>
		<comments>http://blog.stevex.net/2005/09/html-editor-written-in-java/#comments</comments>
		<pubDate>Mon, 05 Sep 2005 15:09:14 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/09/05/html-editor-written-in-java/</guid>
		<description><![CDATA[This looks impressive: kafenio.]]></description>
			<content:encoded><![CDATA[<p>This looks impressive:  <a href="http://editor.kafenio.org/">kafenio</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/09/html-editor-written-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress, MetaWeblogAPI</title>
		<link>http://blog.stevex.net/2005/09/wordpress-metaweblogapi/</link>
		<comments>http://blog.stevex.net/2005/09/wordpress-metaweblogapi/#comments</comments>
		<pubDate>Mon, 05 Sep 2005 16:15:13 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/09/05/wordpress-metaweblogapi/</guid>
		<description><![CDATA[Back to my project to migrade my blog posts from Community Server to WordPress. WordPress supports the MetaWeblogAPI.&#160; This API uses XML-RPC.&#160; I started out looking for&#160;a Java wrapper for the MetaWeblogAPI, but couldn&#8217;t find anything useful. I found a content management system named Jahai that has a MetaWeblogAPIImpl class, but it doesn&#8217;t look like [...]]]></description>
			<content:encoded><![CDATA[<p>Back to my project to migrade <a href="http://www.stevex.org/rssitems">my blog posts</a> from <a href="http://www.communityserver.org/">Community Server</a> to <a href="http://www.wordpress.org/">WordPress</a>. </p>
<p>WordPress supports the <a href="http://www.xmlrpc.com/stories/storyReader$2509">MetaWeblogAPI</a>.&nbsp; This API uses <a href="http://www.xmlrpc.com/spec">XML-RPC</a>.&nbsp; I started out looking for&nbsp;a Java wrapper for the MetaWeblogAPI, but couldn&rsquo;t find anything useful.</p>
<p>I found a content management system named <a href="http://www.jahia.org/jahia/Jahia">Jahai</a> that has a <a href="http://www.jahia.org/javadoc-dev/org/jahia/blogs/MetaWeblogAPIImpl.html">MetaWeblogAPIImpl</a> class, but it doesn&rsquo;t look like it&rsquo;s meant to be used standalone.&nbsp; </p>
<p>There&rsquo;s a com.sun.labs.tools.blog namespace with some useful classes with names like Blog and MetaWeblogPublisher, which I found in the bloged jar file, but I can&rsquo;t find any documentation or information on these classes&nbsp;at all.</p>
<p>So what I&rsquo;ve ended up doing is using the <a href="http://ws.apache.org/xmlrpc/client.html">Apache XML-RPC client classes</a> to talk XML-RPC rather than trying to find a higher level interface to it.&nbsp; It&rsquo;s a pretty simple protocol, so no big deal.</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">URL blogUrl = new URL(&quot;http://my.blog/path.to/xmlrpc.php);<br />
XmlRpcClient xmlrpc = new XmlRpcClient (blogUrl);<br />
Vector params = new Vector ();<br />
params.addElement(&quot;blogid&quot;);<br />
params.addElement(&quot;username&quot;);<br />
params.addElement(&quot;password&quot;);<br />
Object o = xmlrpc.execute (&quot;metaWeblog.getCategories&quot;, params);</div></td></tr></tbody></table></div>
</pre>
<p>That gets back an object (a Vector I believe) that contains the categories on my blog.</P><br />
<P></P><br />
<P>Next step:&nbsp; Post something.</P></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/09/wordpress-metaweblogapi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing for Vista</title>
		<link>http://blog.stevex.net/2005/08/developing-for-vista/</link>
		<comments>http://blog.stevex.net/2005/08/developing-for-vista/#comments</comments>
		<pubDate>Wed, 31 Aug 2005 15:54:21 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/08/31/developing-for-vista/</guid>
		<description><![CDATA[Vista, to the end user, will probably look a lot like Windows XP with a bit of a UI refresh, but there&#8217;s a whole lot going on under the scenes that only developers will appreciate. Win32 has been how you write Windows software since Windows 95 (and that was based on Win16) &#8211; from the [...]]]></description>
			<content:encoded><![CDATA[<p>Vista, to the end user, will probably look a lot like Windows XP with a bit of a UI refresh, but there&#8217;s a whole lot going on under the scenes that only developers will appreciate. </p>
<p>Win32 has been how you write Windows software since Windows 95 (and that was based on Win16) &#8211; from the very first version of Windows to today, you&#8217;re creating HWNDs and sending messages to them, and calling CreateFile when you want a file and so on.</p>
<p>But now Vista is delivering on a whole lot of strategies at the same time.</p>
<p>Avalon / <a href="http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/wcp_conceptual/html/0ff5f36e-dd84-44d1-aa3e-5bb4f147b169.asp">Xaml</a> replaces how you create user interfaces.</p>
<p>Indigo replaces how you do communications.</p>
<p>WinFS (which will probably get rolled into Vista at some point, now that it&#8217;s gone from vaporware to betaware) replaces a lot of how you manage your data.</p>
<p>The rest of the .NET Framework (which will finally come with the OS so you can depend on it being there, assuming you&#8217;re targetting Vista) replaces just about everything else.</p>
<p>It probably won&#8217;t be for another 5 years or so, when developers can start thinking about depending on this stuff, that things will really change, but for Windows developers, it is a pretty big change.</p>
<p>The Mac of course has made these kinds of &#8220;forget everything you know and start over with this new technology&#8221; changes many times.  It&#8217;s the courage to do this that has kept the Mac alive, and I think shows that Microsoft is on the right track.</p>
<p>Unfortunately, both companies are radically changing how you develop software for their platforms, and they&#8217;re completely different.</p>
<p>As a developer, will I ever get to use Avalon in a real app?  I&#8217;m guessing not.  Making a portability abstraction for Avalon and Xaml is a lot different than wrapping a button or a listbox with a generic API.  Every platform has buttons and listboxes; no other platform has a Xaml equivalent yet.</p>
<p>The days of writing software for a single platform are coming to an end.  The Mac is selling well and trending up.  There&#8217;s a real need for a truly cross platform desktop software development environment.</p>
<p>Rich Internet Applications is one way this is heading.  Strangely enough, the Flash runtime is one of the best technologies out there for it, since it&#8217;s on all the major desktop platforms, and is rich enough to write real apps in.  But it&#8217;s got a significant &#8220;not for serious work&#8221; stigma to get over.</p>
<p>I think Java has the potential to be the cross platform rich client platform, but it seems like everyone has forgotten Java on the client.  Where&#8217;s the Xaml equivalent for Java?</p>
<p>(After writing all this, I found <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=19461">this post</a> that says the same stuff.  It&#8217;s good to see I&#8217;m not the only one thinking this way).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/08/developing-for-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog Post File Format</title>
		<link>http://blog.stevex.net/2005/08/blog-post-file-format/</link>
		<comments>http://blog.stevex.net/2005/08/blog-post-file-format/#comments</comments>
		<pubDate>Tue, 30 Aug 2005 03:30:32 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/08/29/blog-post-file-format/</guid>
		<description><![CDATA[I decided previously to use an RSS &#60;item&#62; as the file format for a blog post.&#160; Looking into the MetaWeblogAPI, it seems like that was a good move, since posting with MetaWeblogAPI involves simply sending&#160;the &#60;item&#62; to post.&#160; So there&#8217;s two things to do: Figure out the SQL query to use with Community Server to [...]]]></description>
			<content:encoded><![CDATA[<p>I decided <a href="http://blog.stevex.net/index.php/2005/08/26/blog-item-format/">previously</a> to use an RSS &lt;item&gt; as the file format for a blog post.&nbsp; Looking into the MetaWeblogAPI, it seems like that was a good move, since posting with MetaWeblogAPI involves simply sending&nbsp;the &lt;item&gt; to post.&nbsp; </p>
<p>So there&rsquo;s two things to do: </p>
<ul>
<li>Figure out the SQL query to use with Community Server to get the data I need out</li>
<li>Write some XML code to take this data and write it to disk as an XML file</li>
</ul>
<p>The SQL Query looks like this:</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SELECT cs_Posts.PostDate, cs_Posts.Subject, cs_Posts.Body<br />
FROM cs_Posts INNER JOIN cs_Sections <br />
&nbsp; ON cs_Posts.SectionID = cs_Sections.SectionID <br />
LEFT OUTER JOIN cs_weblog_Weblogs<br />
&nbsp;ON cs_Posts.SectionID = cs_weblog_Weblogs.SectionID <br />
LEFT OUTER JOIN cs_Threads <br />
&nbsp;ON cs_Posts.ThreadID = cs_Threads.ThreadID <br />
LEFT OUTER JOIN cs_weblog_Posts <br />
&nbsp;ON cs_Posts.PostID = cs_weblog_Posts.PostID<br />
WHERE <br />
&nbsp;(cs_Posts.PostLevel = 1) AND (cs_Sections.Name = N'steve''s blog')</div></td></tr></tbody></table></div>
</pre>
<p>This gets me 3 output columns:&nbsp; PostDate, Subject, and Body.&nbsp; Perfect.&nbsp;&nbsp;Substitute my blog name for yours if you&rsquo;re going to reuse this query.</p>
<p>Populating a DOM with these is a simple matter:</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Element rootNode = xmlDoc.createElement(&quot;item&quot;);<br />
xmlDoc.appendChild(rootNode);<br />
<br />
Element titleNode = xmlDoc.createElement(&quot;title&quot;);<br />
titleNode.setTextContent(subject);<br />
rootNode.appendChild(titleNode);<br />
<br />
Element bodyNode = xmlDoc.createElement(&quot;description&quot;);<br />
bodyNode.setTextContent(body);<br />
rootNode.appendChild(bodyNode);<br />
<br />
Element dateNode = xmlDoc.createElement(&quot;pubDate&quot;);<br />
dateNode.setTextContent(date.toString());<br />
rootNode.appendChild(dateNode);</div></td></tr></tbody></table></div>
</pre>
<p>Now I want to figure out what the common way to write out XML with Java is.&nbsp; I found <a href="http://www.cafeconleche.org/books/xmljava/chapters/ch03s02.html">the wrong way to do it</a>.&nbsp; Actually that page says &ldquo;<!--StartFragment -->Serialization has been left as a task for vendor specific classes&rdquo;.&nbsp; It&rsquo;s hard to believe that something as core as writing XML would be left out of the framework.</p>
<p>Fortunately Sun has a page that shows <a href="http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/xslt/2_write.html">how to write out a DOM as an XML file</a> (as part of their XSLT tutorial, strangely enough).&nbsp; </p>
<p>Where in C# you&rsquo;d simply write:</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">doc.Save(&quot;MyFile.xml&quot;);</div></td></tr></tbody></table></div>
</pre>
<p>The equivalent in Java is something like this:</p>
<pre>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">TransformerFactory tFactory = TransformerFactory.newInstance();<br />
Transformer transformer = tFactory.newTransformer();<br />
File f = new File(&quot;MyFile.xml&quot;);<br />
DOMSource source = new DOMSource(doc);<br />
StreamResult result = new StreamResult(f);<br />
transformer.transform(source, result);</div></td></tr></tbody></table></div>
</pre>
<p>I&rsquo;m not sure why Java is so needlessly obtuse, but there it is.</p>
<p>But now that this part is done, I have a directory containing an xml file containing an &lt;item&gt; for every blog posting I wrote with .Text over the last few years.&nbsp; 391 items.&nbsp; I&rsquo;ve&nbsp;put the raw items <a href="http://www.stevex.org/rssitems/">here</a>.</p>
<p>An idea I&rsquo;ve been working on lately is using OPML to identify collections of things like mail messages and blog posts, and having web tools work with those collections, wherever they may be, rather than managing their own private copy of the data.&nbsp; It&rsquo;d be great to be able to refer to the Flickr metadata they manage for my photos directly, rather than having to do it through their API.&nbsp; But that&rsquo;s another story.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/08/blog-post-file-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse, Run Configurations</title>
		<link>http://blog.stevex.net/2005/08/eclipse-run-configurations/</link>
		<comments>http://blog.stevex.net/2005/08/eclipse-run-configurations/#comments</comments>
		<pubDate>Fri, 26 Aug 2005 12:02:01 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/index.php/2005/08/26/eclipse-run-configurations/</guid>
		<description><![CDATA[In our last episode, I managed to connect to the database.&#160; Now what I want to do is extract&#160;data&#160;from the database and write it out as standalone XML files, one XML file per item. I&#8217;m not going to go through every step of the process since I&#8217;m not really writing a tutorial here, just covering [...]]]></description>
			<content:encoded><![CDATA[<p>In our <a href="http://blog.stevex.net/index.php/2005/08/24/eclipse-database-explorer/">last episode</a>, I managed to connect to the database.&nbsp; Now what I want to do is extract&nbsp;data&nbsp;from the database and write it out as standalone XML files, one XML file per item.</p>
<p>I&rsquo;m not going to go through every step of the process since I&rsquo;m not really writing a tutorial here, just covering the stuff I&rsquo;m doing so I&rsquo;ve got a log of any problems I run into, so I can refer to this the next time.&nbsp; Getting started doing Java development in Eclipse is something that&rsquo;s generally covered pretty well elsewhere.</p>
<p>One difference between Eclipse and Visual Studio took a little figuring out is that with Visual Studio, you say Start and it starts the active project, where Eclipse doesn&rsquo;t have an active project concept.&nbsp; You can say Run last launched, or you can select a configuration to run.&nbsp; If you&rsquo;ve not run your app yet, then you need to create a configuration before you can run it (by selecting Run&hellip;, clicking Java Application in the list, clicking New, and picking the class to start).&nbsp; </p>
<p>Where this is an improvement over Visual Studio is when you&rsquo;re running the same binary in multiple contexts.&nbsp; The most obvious place where you&rsquo;d do this is unit testing &ndash; you can create a run configuration for Java Application, one for JUnit, and run either one without needing to change any settings.</p>
<p>Anyway <a href="http://www.heimetli.ch/jdbc/JDBCQuery.html">this example</a> was easy to modify into something I could use to read the cs_Posts table out of Community Server.&nbsp; The only changes were to the connection string, driver class name, and the SQL query text.</p>
<p>Next step:&nbsp; Writing the records out as XML.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2005/08/eclipse-run-configurations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

