<?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>Jeremy Smyth's Blog &#187; Java</title>
	<atom:link href="http://jeremysmyth.com/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeremysmyth.com</link>
	<description></description>
	<lastBuildDate>Sun, 04 Jul 2010 07:10:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Returning a copy of an object</title>
		<link>http://jeremysmyth.com/2009/10/01/returning-a-copy-of-an-object/</link>
		<comments>http://jeremysmyth.com/2009/10/01/returning-a-copy-of-an-object/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 18:59:47 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=180</guid>
		<description><![CDATA[Consider an object passed (by reference) into a method, which then modifies the object. Should the method return the object on completion?
Well, it&#8217;s redundant. Here&#8217;s why.
There are two approaches to doing this &#8211; the classic way (caller chooses what to manipulate/change), and callee changes (which is what happens when you pass in an object by [...]]]></description>
			<content:encoded><![CDATA[<p>Consider an object passed (by reference) into a method, which then modifies the object. Should the method return the object on completion?</p>
<p>Well, it&#8217;s redundant. Here&#8217;s why.</p>
<p>There are two approaches to doing this &#8211; the classic way (caller chooses what to manipulate/change), and callee changes (which is what happens when you pass in an object by reference:</p>
<ul>
<li>If the caller chooses what to manipulate, then your method will operate on a copy of the dataset, and return that copy, leaving the original untouched. Then the caller may overwrite the original, if desired. Many array operations in Perl work like this.
<li>The alternative lets the called method do the in-place operation, in which case the return value is more typically a boolean (&#8221;Yes, I&#8217;ve succeeded!&#8221;) or an int containing the number of values affected. This is how database updates work.</li>
</ul>
<p>Of course, if the object is not passed by reference (i.e. a copy is passed into the method) or if the method explicitly returns a modified copy, then returning an object is the right way to do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2009/10/01/returning-a-copy-of-an-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Java Applications via &#8220;Setup&#8221; Utilities</title>
		<link>http://jeremysmyth.com/2009/07/12/installing-java-applications-via-setup-utilities/</link>
		<comments>http://jeremysmyth.com/2009/07/12/installing-java-applications-via-setup-utilities/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 14:49:42 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=161</guid>
		<description><![CDATA[As with many applications, you may wish to install a Java program with a setup utility that installs the files and sets up appropriate shortcuts. However, there are some subtleties with Java application installation that require some extra thought.
Java applications can only be run on a machine with a JRE (Java Runtime Environment), so any [...]]]></description>
			<content:encoded><![CDATA[<p>As with many applications, you may wish to install a Java program with a setup utility that installs the files and sets up appropriate shortcuts. However, there are some subtleties with Java application installation that require some extra thought.</p>
<p>Java applications can only be run on a machine with a JRE (Java Runtime Environment), so any setup utility won&#8217;t run quite the same as other application setup files; you won&#8217;t be able to give someone your setup file and expect it to run correctly, unless they already have the appropriate JRE.</p>
<p>It is still possible to install Java applications using standard Windows Installer utilities; some tools allow you to bundle (or download and install) a suitable JRE as part of the Windows Installer process, resulting in the application&#8217;s files being installed along with any dependencies.</p>
<p>It&#8217;s even possible to install Java applications as a service in Windows, using additional wrapper utilities.</p>
<p>However, in Java, the usual way to do the &#8220;setup routine&#8221; is typically going to result in a &#8220;jar&#8221; file. This way, you can launch the program by using a shortcut that launches the JVM and points it to the appropriate jar file. From the user&#8217;s point of view, this is indistinguishable from any other shortcut, but of course it requires that the files and JRE have already been installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2009/07/12/installing-java-applications-via-setup-utilities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
