<?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>ThotSpots &#187; software engineering</title>
	<atom:link href="http://www.thotspots.com/tag/software-engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thotspots.com</link>
	<description>Agile Software Development</description>
	<lastBuildDate>Wed, 09 Sep 2009 18:13:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Removing Code Generators from the Build Process</title>
		<link>http://www.thotspots.com/removing-code-generators-from-the-build-process/</link>
		<comments>http://www.thotspots.com/removing-code-generators-from-the-build-process/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 17:04:16 +0000</pubDate>
		<dc:creator>Craig Jones</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[code generators]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.maximsc.com/removing-code-generators-from-the-build-process/</guid>
		<description><![CDATA[I&#8217;m a huge fan of code generators.  I&#8217;ve seen them used successfully in many different ways.  In the Java world, for example, the Xdoclet parser is commonly used to generate object code and ORM mappings based on database schema &#8212; a huge timesaver.  I&#8217;ve also seen creative uses of XSTL transforms and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a huge fan of code generators.  I&#8217;ve seen them used successfully in many different ways.  In the Java world, for example, the Xdoclet parser is commonly used to generate object code and ORM mappings based on database schema &#8212; a huge timesaver.  I&#8217;ve also seen creative uses of XSTL transforms and Velocity templates for handily generating all kinds of program code.  There are generally two ways to take advantage of code generators.  One is for software developers to invoke the code generators on demand, as they program.   The other is to incorporate code generators as part of a &#8220;daily build&#8221; (i.e. some automated build process using Ant, Maven, another build tool, or handcrafted scripts/batch files).  Lately, I&#8217;ve gotten soured on the latter.<span id="more-35"></span></p>
<p>Case in point: On a project where we were upgrading a system from Java 1.4 to Java 5, I happened to be the first developer to check in code with Java 5 type safety notation (which uses angle brackets) in a file that happened to be processed by a Hibernate 2 Xdoclet parser during the build process (if necessary).  I didn&#8217;t realize that the Xdoclet parser didn&#8217;t know how to handle those angle brackets.  Furthermore, I didn&#8217;t notice the problem because of the way the Ant script was set up, it didn&#8217;t manifest until after running a CLEAN task, but I had no reason to run CLEAN (just BUILD). So, instead, an unsuspecting developer on the East Coast was made to suffer, puzzling over the problem until I came online three hours later and realized what had happened.</p>
<p>So, in my experience, code generators seem to be much more successful when used as tools that are invoked on demand by the developers.  The key distinction is whether or not the generated code is committed to version control.  Looking back over the last seven projects that I&#8217;ve been involved with that made heavy use of code generators, three of them did so with post-commit generation.  The four projects that used on-demand generation always seems to work out much better.  On-demand generation simplifies much:</p>
<ol>
<li>The build process is faster and more direct, with less to go wrong at build time, which is beyond the control of the committing developer.  This is especially important when automating the build process to be unattended, with tools like Cruise Control.</li>
<li>Newbie developers do not need to be aware of the existence of the code-generation tools at all (until their first assignment that requires one).  That&#8217;s less to go wrong when setting up a new development environment.</li>
<li>Exceptions to the rule can be handled manually.  No need to spend hours perfecting rickety RegEx replacement tasks in Ant.  (By all means, utilize RegEx replacement tasks when it is cost effective to spend the time writing them, but this way you get to choose when that is, rather than being forced into it.  Also, this way it won&#8217;t kill you if the transform is not perfect.)</li>
<li>There is high visibility of the generated code.  What&#8217;s checked in to version control is what you get.  The exact changes are logged and can be easily differenced/compared/branched/tagged, just like any other code.  There&#8217;s no question as to what the compiler is &#8220;really&#8221; going to compile and deploy.</li>
<li>By putting the developer in the loop between the code generation and the commit, it gives Eclipse a chance to chime in about errors and warnings.<br />
Also, if Eclipse can see the generated code, that means that all the power and might of the searching, navigating, and refactoring tools come into play.</li>
<li>When the code generators make bad decisions (e.g. when presented with a new kind of input), the results are more easily noticed because the developer facing the problem is the one who just did the on-demand code generation.  Chances are, the problem will manifest as a blatant error, warning, or hint, or as unit test failure.  Even if not, the committing developer might catch it still if he/she is disciplined in comparing the differences of every single file that he/she is about to check in (a good practice anyway for catching things like typos, unaddressed TODO&#8217;s, and extraneous debugging logic).</li>
<li>It&#8217;s easer for developers to mix and match tools, applying them in any arbitrary order, as opposed to the ones that are programmed in to the build process always having to be last.</li>
</ol>
<p>I admit there are some downsides:</p>
<ol>
<li>Having to make sure the developers know when and how they are supposed to use the tools, at the risk of them thinking they need to do the work by hand.</li>
<li>Remembering to revisit previously generated code whenever a code generator process changes, and either manually affecting the changes, or regenerating that code and merging back in any modifications that were done by hand.  (Fortunately tools like WinMerge and Beyond Compare make this easier.)</li>
</ol>
<p>There are undoubtedly more cons (as well as pros), but I&#8217;m convinced that the cons are easily managed and that the &#8220;low road&#8221; is the easier route.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thotspots.com/removing-code-generators-from-the-build-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Archeology Using Rsync</title>
		<link>http://www.thotspots.com/software-archeology-using-rsync/</link>
		<comments>http://www.thotspots.com/software-archeology-using-rsync/#comments</comments>
		<pubDate>Sat, 03 Mar 2007 04:09:03 +0000</pubDate>
		<dc:creator>Craig Jones</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[searching code]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.thotspots.com/?p=24</guid>
		<description><![CDATA[The most powerful tool in the knapsack of a software archeologist/maintainer, is the grep search.  Unfortunately the signal-to-noise ratio for grep search results can often be quite low.  This happens when the project source files are intermingled with other artifacts such as generated files, raw templates, library/framework documentation files and examples.

One trick to filtering out the noise is to define a shell script that uses Rsync to create/update a searchable shadow copy of the working folder, and then to search that copy...]]></description>
			<content:encoded><![CDATA[<p>The most powerful tool in the knapsack of a software archeologist/maintainer, is the grep search.  Unfortunately the signal-to-noise ratio for grep search results can often be quite low.  This happens when the project source files are intermingled with other artifacts such as generated files, raw templates, library/framework documentation files and examples.</p>
<p>One trick to filtering out the noise is to define a shell script that uses Rsync to create/update a searchable shadow copy of the working folder, and then to search that copy&#8230;<span id="more-24"></span>  In case you&#8217;re not familiar with Rsync, it is a tool intended to keep two remote file systems synchronized.  Rsync&#8217;s main claim to fame is that it&#8217;s fast because it only transmits the differences, but Rsync is also quite powerful when it comes to specifying exactly which files and folders are to be synchronized and how.  It&#8217;s this secondary feature of Rsync that allows us to filter out the noise.  There are two parts to this solution: the actual shell script, and a file that lists all of the inclusion and exclusion patterns.  (This example uses CygWin, running on a Windows box.)</p>
<h3>Here is the (entire) shell script (C:workcmdsearchcopy.sh):</h3>
<pre>
 #!/bin/sh
 pushd /cygdrive/c/work
 mkdir -p /cygdrive/e/work_search
 rsync -vrut --filter='. /cygdrive/c/work/cmd/searchcopy_filelist.txt' alpha bravo charlie /cygdrive/e/work_search
 popd</pre>
<ul>
<li>/cygdrive/c/work is your working folder (that&#8217;s CygWin speak for C:work).</li>
<li>Alpha, bravo, and charlie are the folder names of the projects that you are interested in.</li>
<li>/cygdrive/e/work_search is the name of the searchable shadow copy you want to create/update (over on your E: removable USB drive).</li>
</ul>
<h3>Here is (an abbreviated version of) the filter file (C:workcmdsearchcopy_filelist.txt), to give you an idea:</h3>
<pre>
 - .svn/
 - bin/
 - build*/
 - deployment/
 - lib/
 - log/
 - .#*
 - *.[ehjstw]ar
 - *.[Bb][Aa][Kk]
 - *.doc
 - *.[Ee][Xx][Ee]
 - *.gif
 - *.httpunit
 - *.ico
 - *.jasper
 - *.jpg
 - *.library
 - *.log
 - *.[Oo][Ll][Dd]
 - *.pdf
 - *.[Zz][Ii][Pp]</pre>
<p>In this case, they are all exclusions (leading minus sign),  Thus, everything in the alpha, bravo, and charlie folders will be copied, except files or subfolders matching these patterns.</p>
<h3>Tips for using Rsync:</h3>
<ul>
<li>Don&#8217;t waste time with the &#8211;include and &#8211;exclude switches, they are merely dumbed-down versions of the &#8211;filter switch, so just use the &#8211;filter switch right off.</li>
<li>Avoid the &#8211;cvs-exclude switch, if you can, and pay close attention to what it ignores if you can&#8217;t.  For example, it ignores any file or folder named &#8220;core&#8221;, and it ignores *.script files; both of which burned me when I tried using it on a certtain Tapestry application.</li>
<li>Most implementations of Rsync are case sensitive, including CygWin&#8217;s!  So if there is a possibility of filenames that exist with multiple casings, then you either have to repeat the pattern or use the square bracket notation:
<pre>
 - *.EXE
 - *.Exe
 - *.exe</pre>
<p>or</p>
<pre>
 - *.[Ee][Xx][Ee]</pre>
</li>
<li>Pay close attention to the man pages that describe other aspects of the pattern matching algorithm.  For example, leading and trailing slashes each have special significance.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.thotspots.com/software-archeology-using-rsync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Head First&#8221; Book Sometimes Makes My Head Hurt</title>
		<link>http://www.thotspots.com/head-first-book-sometimes-makes-my-head-hurt/</link>
		<comments>http://www.thotspots.com/head-first-book-sometimes-makes-my-head-hurt/#comments</comments>
		<pubDate>Sat, 17 Feb 2007 01:17:19 +0000</pubDate>
		<dc:creator>Craig Jones</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[design principles]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.thotspots.com/?p=23</guid>
		<description><![CDATA[[This review originally appeared in my personal blog on Sept 8, 2005.  I'm reposting it by request.]

IÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢m helping out with a study group for "Head First Design Patterns," which just finished chapter 6. On the whole, itÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢s a pretty good introduction to software design patterns ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Å“ way more accessible than the seminal work by the Gang of Four; however, the examples sometimes make my head hurt. I canÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢t imagine what theyÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢re doing to the heads of the beginners in the group. Coming up with decent examples is the hardest thing to do in expository writing, and]]></description>
			<content:encoded><![CDATA[<p>[This review originally appeared in my personal blog on Sept 8, 2005.  I'm reposting it by request.]</p>
<p>I&#8217;m helping out with a study group for &#8220;Head First Design Patterns,&#8221; which just finished chapter 6. On the whole, it&#8217;s a pretty good introduction to software design patterns &#8212; way more accessible than the seminal work by the Gang of Four; however, the examples sometimes make my head hurt. I can&#8217;t imagine what they&#8217;re doing to the heads of the beginners in the group. Coming up with decent examples is the hardest thing to do in expository writing, and I certainly give the authors an E for effort in creativity, but I wish they had been a little less concerned with making their examples &#8220;hip&#8221; and a little more concerned with making them appropriate.<br />
<span id="more-23"></span><br />
To wit, the whole pizza store analogy in chapter 4 (to illustrate factory method and abstract factory) is flawed. For one thing, that&#8217;s just not the way you&#8217;d model a pizza business in any actual software that I can imagine. For another, the differences between a New York pizza factory and a Chicago pizza factory are too subtle/trivial to make for an effective illustration of why you would need to subclass anything (much less use a factory to manage the subclasses). A much better example, as everyone in my group agreed, would have been an application that needs to offer up a consistent set of functionality to users who are accessing it in wildly different ways: one&#8217;s in a web browser on a desktop, another is running a cell phone app, another is using a touch-tone phone, and yet another is using a voice-activated headset. All the client code knows is that, for example, it needs to ask a multiple-choice question and obtain the answer. It&#8217;s up to an abstract factory to provide the client with a set of classes that can do that, in the context of the selected user-interface, in whatever way is necessary.</p>
<p>To a lesser degree, the Starbucks coffee example at the beginning of the book suffers from the same too-hip-to-be-effective syndrome, although I do think that the remote-control example for the Command pattern in chapter six is dead on.</p>
<p>For any novice who is reading this book without the benefit of a study group, I highly suggest that you find at least one other programmer who is experienced in design patterns to explain why/if/how the examples are lacking.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thotspots.com/head-first-book-sometimes-makes-my-head-hurt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
