<?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>devgrind &#187; java</title>
	<atom:link href="http://devgrind.com/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://devgrind.com</link>
	<description>thinking outside the { }</description>
	<lastBuildDate>Fri, 04 Nov 2011 10:42:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Dirty Source Code</title>
		<link>http://devgrind.com/2008/10/29/dirty-source-code/</link>
		<comments>http://devgrind.com/2008/10/29/dirty-source-code/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 12:55:06 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[humor]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://devgrind.com/?p=55</guid>
		<description><![CDATA[Why, oh why do classes, which have the purpose to remove something from documents, always have to be named &#8220;XYZStripper&#8221;? As a programmer faithful to the (often unwritten) coding conventions, I have to name instances of such classes of course &#8211; &#8220;stripper&#8220;. Unfortunately the names of those stripping methods do not quite match the juicyness [...]]]></description>
			<content:encoded><![CDATA[<p>Why, oh why do classes, which have the purpose to remove something from documents, always have to be named &#8220;XYZStripper&#8221;? As a programmer faithful to the (often unwritten) coding conventions, I have to name instances of such classes of course &#8211; &#8220;<strong>stripper</strong>&#8220;. Unfortunately the names of those stripping methods do not quite match the juicyness of the class name. I would like to code things like stripper.renderNaked() or stripper.undoClips().</p>
<blockquote><p>And with a swing of her hips<br />
She started to strip<br />
To tremendous applause<br />
She took of her drawers</p>
<p>And with a lick of her lips<br />
She undid all her clips<br />
And threw it all in the air<br />
And everybody stared</p>
<p style="text-align: right;">Chris de Burgh: Patricia the Stripper</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2008/10/29/dirty-source-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Documentation Note</title>
		<link>http://devgrind.com/2008/07/23/documentation-note/</link>
		<comments>http://devgrind.com/2008/07/23/documentation-note/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 15:24:45 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[documentation]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://devgrind.com/?p=45</guid>
		<description><![CDATA[If you are documenting Java methods, try to fit everything really important (like constraints for the method) into the first sentence of the javadoc. This sentence is displayed along wiht the overview of the class method. Everything after the first sentence vanishes in the distance where no-one will ever read it.]]></description>
			<content:encoded><![CDATA[<p>If you are documenting Java methods, try to fit everything really important (like constraints for the method) into the first sentence of the javadoc. This sentence is displayed along wiht the overview of the class method.</p>
<p>Everything after the first sentence vanishes in the distance where no-one will ever read it.</p>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2008/07/23/documentation-note/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ultimate Code Browser</title>
		<link>http://devgrind.com/2008/06/10/the-ultimate-code-browser/</link>
		<comments>http://devgrind.com/2008/06/10/the-ultimate-code-browser/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 19:55:29 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://devgrind.com/?p=43</guid>
		<description><![CDATA[I want a Firefox Plugin that recognizes that the page I&#8217;m looking at contains Java, does syntax highlighting and, most of all, inserts links to the classes and methods referenced in the code. The plugin (or a server it can ask) should know where the source code of a class like org.springframework.beans.factory.BeanFactory can be found. [...]]]></description>
			<content:encoded><![CDATA[<p>I want a Firefox Plugin that recognizes that the page I&#8217;m looking at contains Java, does syntax highlighting and, most of all, inserts links to the classes and methods referenced in the code. The plugin (or a server it can ask) should know where the source code of a class like <a href="http://springframework.cvs.sourceforge.net/springframework/spring/src/org/springframework/beans/factory/BeanFactory.java?view=co">org.springframework.beans.factory.BeanFactory</a> can be found.</p>
<p>First I thought that such a plugin would need (or could at least profit from) <em>sem***ic web</em> technologies (no dirty words on this blog, please), but it probably wouldn&#8217;t. All we need is a global registry that maps package names to the URLs of the web interfaces of the respective source repositories. (Maybe <a href="http://www.google.com/codesearch">Google Code Search</a> could be such a repository, but its results are often pretty bad.) The plugin would also have to include a reasonably good Java parser, and maybe a heuristic to distinguish betweeen Java and non-Java text.</p>
<p>Why would I want such a thing? Well, I often have to dig through the code of some open source library in order to understand a bug, or just to figure out what I can do with it, and how, because the documentation is incomplete or wrong. Usually I create an Eclipse project and import the code from the source repository, but that&#8217;s quite a lot of overhead if I just need to browse the code for ten minutes or so. On the other hand, digging through source code on web pages, without the help of links between the pages, is just a nuisance.</p>
<p>And wouldn&#8217;t it just be so cool to have one of the most important features of an IDE as a browser plugin, enhanced by the power of the world wide web?</p>
<p>P.S.: Or maybe I don&#8217;t want a browser plugin &#8211; maybe I just want Google to put some more effort into Code Search? Come on, guys, you&#8217;ve got all it takes &#8211; the global repository, the parsers, the heuristics&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2008/06/10/the-ultimate-code-browser/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ActiveRecord and Hibernate &#8211; Friends or Foes?</title>
		<link>http://devgrind.com/2008/01/25/activerecord-and-hibernate-friends-or-foes/</link>
		<comments>http://devgrind.com/2008/01/25/activerecord-and-hibernate-friends-or-foes/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 11:00:33 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://devgrind.com/2008/01/25/activerecord-and-hibernate-friends-or-foes/</guid>
		<description><![CDATA[Currently, I am in the nice situation to decide for myself with which framework I will build a demonstration portal. So, as I want to profit from the fast-paced development processes (at least the Ruby aficionados say so) and the lightweightiness of Rails, I decided to go the Rail(s)Way. Problem is, that I have to [...]]]></description>
			<content:encoded><![CDATA[<p>Currently, I am in the nice situation to decide for myself with which framework I will build a demonstration portal. So, as I want to profit from the fast-paced development processes (at least the Ruby aficionados say so) and the lightweightiness of Rails, I decided to go the Rail(s)Way.</p>
<p>Problem is, that I have to use a legacy database in PostgreSQL where I am not allowed to tinker with the structure, but I am forced to insert data into the tables. The database was created using Hibernate, which means an overall database sequence is used to generate the unique IDs. Unfortunately my new pal ActiveRecord does not know anything about global Postgres sequences, so I had to figure out a way to use the hibernate sequence in a hack to get my unique IDs.</p>
<p>What I did was to use the hook  <code>before_validation_on_create </code> in the ActiveRecord table model to create an ID. This looks like this:</p>
<p>[ruby]<br />
class Term < ActiveRecord::Base<br />
  before_validation_on_create :generate_id</p>
<p>  private<br />
    # use the hibernate sequence to generate the next id<br />
    def generate_id<br />
      self.id = Term.connection,execute(&#8220;select nextval(&#8216;hibernate_sequence&#8217;)&#8221;).result[0][0]<br />
    end<br />
end<br />
[/ruby]</p>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2008/01/25/activerecord-and-hibernate-friends-or-foes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developer Coffee Mug</title>
		<link>http://devgrind.com/2008/01/11/developer-coffee-mug/</link>
		<comments>http://devgrind.com/2008/01/11/developer-coffee-mug/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 12:42:39 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://devgrind.com/2008/01/11/developer-coffee-mug/</guid>
		<description><![CDATA[I need a coffee mug with all the nifty regular expression constructs on it. Especially the java character classes would be nice to have.]]></description>
			<content:encoded><![CDATA[<p>I need a coffee mug with all the nifty regular expression constructs on it. Especially the java character classes would be nice to have.</p>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2008/01/11/developer-coffee-mug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pandora&#8217;s Box</title>
		<link>http://devgrind.com/2007/09/13/pandoras-box/</link>
		<comments>http://devgrind.com/2007/09/13/pandoras-box/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 14:00:08 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://devgrind.com/2007/09/13/pandoras-box/</guid>
		<description><![CDATA[Even a simple HTML parser library today comes with hundreds of dependent archives, adding up to a nice 4 MB download. Which should be no problem, but at home I am blessed with an ISDN connection. Is there anything as a library package management system like in Python, Perl or Ruby for Java? If anyone [...]]]></description>
			<content:encoded><![CDATA[<p>Even a simple HTML parser library today comes with hundreds of dependent archives, adding up to a nice 4 MB download. Which should be no problem, but at home I am blessed with an ISDN connection. Is there anything as a library package management system like in Python, Perl or Ruby for Java? If anyone has seen this, let me know. If there is none, this would be the time to stand up and implement!</p>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2007/09/13/pandoras-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quite Groovy</title>
		<link>http://devgrind.com/2007/07/07/quite-groovy/</link>
		<comments>http://devgrind.com/2007/07/07/quite-groovy/#comments</comments>
		<pubDate>Sat, 07 Jul 2007 11:51:54 +0000</pubDate>
		<dc:creator>Arne</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://devgrind.com/2007/07/07/quite-groovy/</guid>
		<description><![CDATA[In the recent weeks, both of my co-bloggers told me independently of each other about Groovy, the new hipster language which brings the scripting goodness of dynamic languages like Ruby and Smalltalk to the JVM Sweet JVM, so I finally couldn&#8217;t resist but take a look at it. To be honest, I didn&#8217;t like its [...]]]></description>
			<content:encoded><![CDATA[<p>In the recent weeks, both of my co-bloggers told me independently of each other about <a href="http://groovy.codehaus.org/">Groovy</a>, the new hipster language which brings the scripting goodness of dynamic languages like Ruby and Smalltalk to the <em>JVM Sweet JVM</em>, so I finally couldn&#8217;t resist but take a look at it. To be honest, I didn&#8217;t like its Java-like syntax from the beginning, with all the parentheses, lowerCamelCaseIdentifiers and such, but that was just because I prefer Ruby&#8217;s very lean syntax. Its concepts are very close to Ruby (modification of objects and classes at runtime, blocks/closures, etc.) and of course it integrates well with the Java platform and its rich libraries, since this is the purpose for which it was created, to add a scripting facility to the Java platform. Groovy scripts are compiled into bytecode before execution and thus run on a normal JVM.</p>
<p>A crucial part for dynamic languages today (at least in my eyes) is the creation of domain-specific language, which Groovy also supports. <a href="http://groovy.codehaus.org/Gant">Gant</a>, for example, is a Groovy DSL for Ant scripts. Another example (take from the Tutorial <a href="glaforge.free.fr/groovy/QCon-Tutorial-Groovy-DSL-2-colour.pdf">Domain-Specific Languages in Groovy</a>, PDF) I find very practical is a DSL for creating query criteria for Hibernate in the <a href="http://grails.codehaus.org/">Grails</a> framework (formerly known as Groovy on Rails, so its purpose should be clear):</p>
<pre>
def c = Account.createCriteria()
def results = c {
  like("holderFirstName", "Fred%")
  and {
    between("balance", 500, 1000)
    eq("branch", "London")
  }
  maxResults(10)
  order("holderLastName", "desc")
}</pre>
<p>A good thing, but looks too java-y for my taste, I miss the feeling I get when using a Ruby DSL, such as <a href="http://sqldsl.rubyforge.org/">SQL-DSL</a>, for example:</p>
<pre>
statement = Select[:column1, 'book', 10].from[:table1, :table2].where do
  equal :column1, 99
  not_equal :column1, 100
  less_than :column2, 'foo'
  less_than_or_equal :column3, :column4
  greater_than :column1, 0
  greater_than_or_equal :column2, 'bar'
  like :column1, 'any'
  is_not_null :column1
  is_in :column1, [1,2]
  is_not_in :column2, [3, 4]
  exists 0
  not_exists 0
end</pre>
<p>But maybe that&#8217;s just personal preference.</p>
<p>From a few first glance I get the impression, that Groovy is quite successful as a scripting sidekick to Java and I&#8217;m curious to learn more about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2007/07/07/quite-groovy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparing Web Development Platforms</title>
		<link>http://devgrind.com/2007/06/20/comparing-web-development-platforms/</link>
		<comments>http://devgrind.com/2007/06/20/comparing-web-development-platforms/#comments</comments>
		<pubDate>Wed, 20 Jun 2007 12:20:58 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://devgrind.com/2007/06/20/comparing-web-development-platforms/</guid>
		<description><![CDATA[I would like to point you to a study a professor of my university (i.e. my workplace) did with his team. One goal, nine teams, thirty hours, three platforms &#8211; J2EE, Perl and PHP. Why they did not evaluate Ruby or Python is far out of my knowledge (and why anyone would do actually web [...]]]></description>
			<content:encoded><![CDATA[<p>I would like to point you to a study a professor of my university (i.e. my workplace) did with his team. One goal, nine teams, thirty hours, three platforms &#8211; J2EE, Perl and PHP. Why they did not evaluate Ruby or Python is far out of my knowledge (and why anyone would do actually web devopment in Perl), but the setting is interesting enough. A rather lengthy report <a href="http://www.plat-forms.org/2007/documents/platformsTR.pdf">can be found here</a>.</p>
<p><strong>Update</strong>: I did not read the document thoroughly enough. The answers to my questions:</p>
<blockquote><p>&#8220;We had some contact with potential teams from the Python arena, but there were not sufficiently many who were qualified enough. In the end, only one formal request for participation was submitted, so we did not admit Python into the contest.&#8221;<br />
&#8220;It was impossible to find Ruby-on-Rails teams (â€œwe are too busyâ€?). &#8220;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2007/06/20/comparing-web-development-platforms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java and/or Ruby</title>
		<link>http://devgrind.com/2007/03/22/java-andor-ruby/</link>
		<comments>http://devgrind.com/2007/03/22/java-andor-ruby/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 14:59:36 +0000</pubDate>
		<dc:creator>Magnus</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://devgrind.com/2007/03/22/java-andor-ruby/</guid>
		<description><![CDATA[Currently I am working on a small prototypical application involving lots of webscraping, a database and some sophisticated term indexing and search query expansion. Since some parts of the app are quite independent from the others, sharing data only via the database, I decided to code as much as I could in Ruby. There is [...]]]></description>
			<content:encoded><![CDATA[<p>Currently I am working on a small prototypical application involving lots of webscraping, a database and some sophisticated term indexing and search query expansion. Since some parts of the app are quite independent from the others, sharing data only via the database, I decided to code as much as I could in Ruby. There is nothing better for getting into a new language than working on a real project.</p>
<p>For web scraping (which I always did with <a href="http://www.python.org">Python</a>, my absolutely favourite scripting language to date, and the fabulous BeautifulSoup library) I decided to switch to Hpricot (silly name), which does the job of scraping untidy HTML pages good enough for me.</p>
<p>So, what do I use as a cost-effective, well-maintained search and indexing framework? Of course Lucene, because I have grown up with Java and the bold faith that there is a library for everything under the sun &#8211; written in Java. But lately I found that there is in fact a Lucene-lookalike implementation for Ruby named <em>Ferret</em>. And it is even faster than Lucene. So off to new pastures.</p>
<p>All that is left in Java will be the RDF handling, because there is nothing as sophisticated for RDF/OWL ontology handling as the Jena library in Ruby.</p>
<p>Tune in next time to hear me talk about the pitfalls of weakly-typed scripting languages &#8230;</p>
<p><strong>Links:</strong></p>
<ul>
<li><a href="http://www.python.org">The Python Language</a></li>
<li><a href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> &#8211; a &#8220;dirty&#8221; HTML parser for Python</li>
<li><a href="http://www.ruby-lang.org">The Ruby Language</a></li>
<li><a href="http://code.whytheluckystiff.net/hpricot/">Hpricot</a> &#8211; a &#8220;dirty&#8221; HTML parser for Ruby</li>
<li><a href="http://lucene.apache.org/">Apache Lucene</a> &#8211; the de-facto open source searching standard</li>
<li><a href="http://ferret.davebalmain.com/trac">Ferret</a> &#8211; Lucene for Ruby</li>
<li><a href="http://jena.sourceforge.net/">Jena</a> &#8211; a semantic web framework for Java</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2007/03/22/java-andor-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Departed</title>
		<link>http://devgrind.com/2007/03/13/the-departed/</link>
		<comments>http://devgrind.com/2007/03/13/the-departed/#comments</comments>
		<pubDate>Tue, 13 Mar 2007 21:52:35 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://devgrind.com/2007/03/13/the-departed/</guid>
		<description><![CDATA[Back in July 2004, I was shocked to hear that Josh Bloch and Neal Gafter had left Sun. A few months ago, in October 2006, another shock came &#8211; Gilad Bracha has left Sun as well. Not many big names are left at the home of Java. Bill Joy already went away in September 2003. [...]]]></description>
			<content:encoded><![CDATA[<p>Back in July 2004, I was shocked to hear that <a href="http://en.wikipedia.org/wiki/Joshua_Bloch">Josh Bloch</a> and <a href="http://www.gafter.com/~neal/">Neal Gafter</a> had <a href="http://www.theserverside.com/news/thread.tss?thread_id=27163">left Sun</a>. A few months ago, in October 2006, another shock came &#8211; <a href="http://bracha.org">Gilad Bracha</a> <a href="http://blogs.sun.com/gbracha/entry/and_now_for_something_completely">has left Sun</a> as well.</p>
<p>Not many big names are left at the home of Java. Bill Joy already <a href="http://money.cnn.com/magazines/fortune/fortune_archive/2003/10/13/350901/index.htm">went away</a> in September 2003. How long will <del datetime="2010-04-29T18:18:07+00:00"><a href="/2010/04/29/javagotterdammerung/">James Gosling</a></del> and Guy Steele stick around? Makes me wonder what the future will bring for Sun and Java. Especially considering Bracha&#8217;s ominous farewell <em>Good luck to you all &#8211; you&#8217;ll need it</em>. Am I just being paranoid, or do these words and these events forecast a gloomy future for Sun, Java, and everyone involved, that is, me and you, my fellow programmers?</p>
<p>(In case you don&#8217;t know, Gilad, Josh, and Neal are Java Gods. Josh wrote the <a href="http://java.sun.com/j2se/1.5.0/docs/guide/collections/reference.html">Java Collections Framework</a> and <a href="http://java.sun.com/docs/books/effective/"><em>Effective Java</em></a>, one of the best books about Java. Neal Gafter was in charge of Sun&#8217;s Java compiler. Together they wrote <a href="http://www.javapuzzlers.com/">Java Puzzlers</a>, another great book. Gilad Bracha was heavily involved in the specification of Java itself, the JVM, Generics&#8230; you name it.)</p>
]]></content:encoded>
			<wfw:commentRss>http://devgrind.com/2007/03/13/the-departed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

