<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>scompt.com &#187; java</title>
	<atom:link href="http://scompt.com/blog/archives/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://scompt.com</link>
	<description>The website of Edward Dale</description>
	<lastBuildDate>Sun, 04 Sep 2011 15:54:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Book Review: Play Framework Cookbook</title>
		<link>http://scompt.com/blog/archives/2011/09/04/book-review-play-framework-cookbook</link>
		<comments>http://scompt.com/blog/archives/2011/09/04/book-review-play-framework-cookbook#comments</comments>
		<pubDate>Sun, 04 Sep 2011 15:54:07 +0000</pubDate>
		<dc:creator>Edward Dale</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[play]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://scompt.com/?p=367</guid>
		<description><![CDATA[The Play Framework is a Java web framework that disposes of much of the traditional Java dogma and strives to create a developer experience similar to that of more established frameworks in other languages such as Rails and Django. Gone are the routine getters and setters, replaced by public static fields. Similarly, controller methods are [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.playframework.org/">Play Framework</a> is a Java web framework that disposes of much of the traditional Java dogma and strives to create a developer experience similar to that of more established frameworks in other languages such as Rails and Django. Gone are the routine getters and setters, replaced by public static fields. Similarly, controller methods are implemented as public static methods. Once a seasoned Java developer has gotten over these shocking design decisions and actually written an application or two with Play, the <a href="http://www.packtpub.com/play-framework-cookbook/book">Play  Framework Cookbook</a> by <a href="http://twitter.com/spinscale">Alexander Reelsen</a> is a good next step to learning the full depth of the framework.</p>
<p><span id="more-367"></span></p>
<p>It took me about 50 pages to get into the Play Framework Cookbook. The stated goal of the book is to pick up where the beginner&#8217;s documentation leaves off. Having already written a couple applications using Play, I was hoping the book would jump right into some nice advanced topics that I wasn&#8217;t familiar with. Instead, the first chapter (Basics of the Play Framework) dealt with exactly the beginner issues that are better handled with a <a href="http://www.playframework.org/documentation/1.2.3/home#started">Getting Started</a> guide. If you&#8217;ve spent much time with the Play framework, you&#8217;ll probably be best served by jumping ahead to Chapter 2 (Using Controllers). Here, the author makes an emphasis on keeping your controllers lean by generous use of helper classes and methods. The <code>renderPDF</code> and <code>renderRSS</code> methods presented are good examples of this.</p>
<p>The similar concept that your application should remain lean and functionality should be extracted into modules is introduced in Chapter 3 (Leveraging Modules). The author shows a nice selection of built-in and downloadable modules that can be used to clean up your code (dependency injection), lock down your application (security), and interact with other databases (MongoDB). This would have been a nice place to jump right into writing your own modules, but first there&#8217;s the small interlude that is Chapter 4 (Creating and Using APIs). This chapter included a nice example for creating a custom tag to display charts from the Google Chart API, but it still seemed out of place.</p>
<p>Chapters 5 (Introduction to Writing Modules) and 6 (Practical Module Examples) provide a solid overview of the module system and how it can be used. Even more important, it discusses the limitations of Play modules and how they can be avoided. The author also gets his hands dirty with topic of bytecode enhancement, a technique that Play uses to provide the optimum developer experience. Writing the code to provide that experience (non-type-checked code in quotes, eek!) is something I&#8217;d like to avoid, but at least I know now how Play does it. Other examples include relevant topics such as indexing with Solr and interacting with ActiveMQ.</p>
<p>The final chapter (Running in Production) addresses some issues that pop up when moving from developer machine to the data center. A number of recipes demonstrate deployment with popular web servers (Apache, Nginx, Lighttpd) if you don&#8217;t want to use the built-in Play server in production. Integration with the Jenkens and Calimoucho continuous integration systems is also discussed in this chapter, although I think these topics would have been better suited to a separate chapter focusing on testing. Rounding out the production chapter are a number of topics related to monitoring and logging.</p>
<p>Overall, I think the Play Framework Cookbook would be a reasonable purchase for someone who&#8217;s written a couple smaller applications using Play and is looking towards something larger and more complex. The suggestions for keeping your classes and application lean will surely be useful. The <a href="http://www.packtpub.com/sites/default/files/5528OS-Chapter-2-Using-Controllers.pdf">second chapter</a> is available as a sample from the publisher&#8217;s website.</p>
<p><em>Disclosure</em>: I was provided with an eBook copy of the Play Framework Cookbook by <a href="http://www.packtpub.com/">Packt Publishing</a> for the purposes of this review.</p>
]]></content:encoded>
			<wfw:commentRss>http://scompt.com/blog/archives/2011/09/04/book-review-play-framework-cookbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lots of cgkit code</title>
		<link>http://scompt.com/blog/archives/2006/05/08/lots-of-cgkit-code</link>
		<comments>http://scompt.com/blog/archives/2006/05/08/lots-of-cgkit-code#comments</comments>
		<pubDate>Mon, 08 May 2006 23:59:39 +0000</pubDate>
		<dc:creator>scompt</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[school]]></category>

		<guid isPermaLink="false">http://scompt.com/?p=83</guid>
		<description><![CDATA[Almost all of the assignments I did for classes last quarter were done using the cgkit graphics library. I&#8217;ve posted all of the code that was written for these assignments. Maybe somebody will benefit from it. Here&#8217;s everything that&#8217;s there: A snowfall simulation for my Animation Algorithms class A keyframing system A billiards simulator A [...]]]></description>
			<content:encoded><![CDATA[<p>Almost all of the assignments I did for classes <a href="/academia/rit/classes/animation-algorithms">last</a> <a href="/academia/rit/classes/computer-graphics-2">quarter</a> were done using the <a href="http://cgkit.sf.net">cgkit</a> graphics library.  I&#8217;ve posted all of the code that was written for these assignments.  Maybe somebody will benefit from it.  Here&#8217;s everything that&#8217;s there:</p>
<ul>
<li>A <a href="/files/animation/snowfall.tar.gz">snowfall</a> simulation for my <a href="/academia/rit/classes/animation-algorithms">Animation Algorithms</a> class</li>
<li>A <a href="/academia/rit/classes/animation-algorithms/keyframing">keyframing system</a></li>
<li>A <a href="/academia/rit/classes/animation-algorithms/billiards">billiards simulator</a></li>
<li>A <a href="/academia/rit/classes/animation-algorithms/particle-system">particle system</a></li>
<li>An <a href="/academia/rit/classes/animation-algorithms/articulated-figure-motion">articulated figure motion</a> system using <a href="http://www.bvhfiles.com">BVH</a> files</li>
<li>A <a href="/files/cg2/snowballs.tar.gz">snowball</a> simulation that uses some of the <a href="http://www.ode.org/">ODE</a> stuff from <a href="http://cgkit.sf.net">cgkit</a></li>
<li>A <a href="/academia/rit/classes/computer-graphics-2">ray tracer</a> built using the cgtypes from cgkit.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://scompt.com/blog/archives/2006/05/08/lots-of-cgkit-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Renderpack</title>
		<link>http://scompt.com/blog/archives/2004/12/04/renderpack</link>
		<comments>http://scompt.com/blog/archives/2004/12/04/renderpack#comments</comments>
		<pubDate>Sun, 05 Dec 2004 03:14:45 +0000</pubDate>
		<dc:creator>scompt</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://scompt.com/wordpress/renderpack</guid>
		<description><![CDATA[After my commit of pipelines to the Renderpack project last week, Jesse Wilson, the project owner offered to pass the job along to me. I accepted, so I&#8217;m the project owner now. Woohoo!]]></description>
			<content:encoded><![CDATA[<p>After my commit of <a href="http://scompt.com/article/33/renderpack-pipelines">pipelines</a> to the <a href="https://renderpack.dev.java.net">Renderpack</a> project last week, <a href="http://publicobject.com">Jesse Wilson</a>, the project owner offered to pass the job along to me.  I accepted, so I&#8217;m the project owner now.</p>
<p>Woohoo!</p>
]]></content:encoded>
			<wfw:commentRss>http://scompt.com/blog/archives/2004/12/04/renderpack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Renderpack Pipelines</title>
		<link>http://scompt.com/blog/archives/2004/11/28/renderpack-pipelines</link>
		<comments>http://scompt.com/blog/archives/2004/11/28/renderpack-pipelines#comments</comments>
		<pubDate>Sun, 28 Nov 2004 23:22:18 +0000</pubDate>
		<dc:creator>scompt</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://scompt.com/wordpress/renderpack-pipelines</guid>
		<description><![CDATA[I just committed some files to the Renderpack project that let a developer define a pipeline renderer for use with Swing JTables or JLists (or anything that can use TableCellRenderers or ListCellRenderers). This pipeline consists of a number of RenderStages, each of which tweak the output of the rendered value. There are some sample RenderStages [...]]]></description>
			<content:encoded><![CDATA[<p>I just committed some files to the <a href="https://renderpack.dev.java.net">Renderpack</a> project that let a developer define a pipeline renderer for use with Swing <code>JTable</code>s or <code>JList</code>s (or anything that can use <code>TableCellRenderer</code>s or <code>ListCellRenderer</code>s).  This pipeline consists of a number of <code>RenderStage</code>s, each of which tweak the output of the rendered value.  There are some sample <code>RenderStage</code>s included in the package that show off the the possibilties (cell striping, rendering dates, etc.), but I believe the real power will come from creating a custom <code>RenderStage</code> that, for example, uses some business logic to change the text color of all unpaid invoice, for example.  <code>RenderStage</code>s are plugged into a <code>PipelineListCellRenderer</code> or <code>PipelineTableCellRenderer</code> and can be reused anywhere in an application&#8217;s <code>JTable</code>s or <code>JList</code>s.</p>
<p>Here&#8217;s a snippet from the demo application that shows how to render a date and stripe it with Christmas colors:</p>
<pre><code>
RenderStage[] listRenderers = new RenderStage[]{
     new DateRenderStage("yyyy"),
     new StripedRenderStage(Color.RED, Color.GREEN)
};
jList.setCellRenderer(new PipelineListCellRenderer( listRenderers ) );
</code></pre>
<p>The main benefit comes from the fact that you can reuse the <code>DateRenderStage</code> elsewhere completely seperate from the <code>StripedRenderStage</code> on either a <code>JTable</code> or <code>JList</code>.  Using stock Swing, you would have to create a subclass of <code>TableCellRenderer</code> that did the date rendering for <code>JTable</code>s and a subclass of <code>ListCellRenderer</code> for use on <code>JList</code>s and then add in striping logic if you wanted that too.</p>
<p>The initial idea for this came from <a href="http://www.clientjava.com/blog/2004/10/18/1098114835000.html">this post</a> at <a href="http://www.clientjava.com">ClientJava.com</a> which links to the HighlighterPipeline API from <a href="https://jdnc.dev.java.net">JDesktop Network Components</a>.  That API was too heavyweight for my uses because one must use a JDNC component (JXList, JXTable, etc.) to use a HighlighterPipeline whereas with renderpack pipelines, you&#8217;re dealing with normal Swing renderers that can be put on normalnormal Swing components.  The intention of JDNC Highlighters seems to be a bit different though in that they are meant to decorate existing renderers whereas renderpack pipelines <b>are</b> the renderer.</p>
<p>A <a href="https://renderpack.dev.java.net/files/documents/1747/4863/renderpack.jar">jar</a> that you can drop into your classpath and the <a href="https://renderpack.dev.java.net/files/documents/1747/4864/renderpack-source.zip">full source</a> are currently available from the <a href="https://renderpack.dev.java.net">renderpack</a> webpage in addition to being available from <a href="https://renderpack.dev.java.net/source/browse/renderpack">CVS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://scompt.com/blog/archives/2004/11/28/renderpack-pipelines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

