<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: dbcdb: generated using Java</title>
	<atom:link href="http://malvasiabianca.org/archives/2005/09/dbcdb-generated-using-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://malvasiabianca.org/archives/2005/09/dbcdb-generated-using-java/</link>
	<description></description>
	<lastBuildDate>Tue, 22 May 2012 01:20:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Mark Gritter</title>
		<link>http://malvasiabianca.org/archives/2005/09/dbcdb-generated-using-java/comment-page-1/#comment-3695</link>
		<dc:creator>Mark Gritter</dc:creator>
		<pubDate>Mon, 05 Sep 2005 05:38:48 +0000</pubDate>
		<guid isPermaLink="false">/?p=144#comment-3695</guid>
		<description>&lt;i&gt;My most pressing current infrastructure issue is that I really don’t understand how javac works with dependencies. If Foo.java uses a class Bar and if Bar.java uses a class Baz, then it looks like, if I modify Bar.java and tell javac to recompile Foo.java, it will also recompile Bar.java, but if I modify Baz.java, then compiling Foo.java doesn’t cause Baz.java to be recompiled...&lt;/i&gt;

javac tries to be smart, which usually works, but sometimes does not.  Unlike C++, a change in a class Baz cannot change the interface for a class Bar that uses it (even if it has the type Baz exposed in the interface) because objects are always passed by reference (and there are no type aliases so the actual type of any argument or return value is always clear.)  So, a recompilation of Baz requires a recompilation of Bar (which might use something that&#039;s been changed) but not of next-level clients (Foo).

But, by default javac works the other way and only does one level of &quot;search&quot;.  If Bar.class is up-to-date wrt to Bar.java, but Baz.class is not, compilation of Foo.java-&gt;Foo.class will not update Baz.  This can lead to an application failing in unexpected ways.  But, I believe if Bar.class is also out of data, then Baz gets updated as well--- although I&#039;m not 100% certain.  This is what I recall happening when I was doing more Java programming.

There is a -depend or -Xdepend which tries to get the whole dependency tree rebuilt.</description>
		<content:encoded><![CDATA[<p><i>My most pressing current infrastructure issue is that I really don’t understand how javac works with dependencies. If Foo.java uses a class Bar and if Bar.java uses a class Baz, then it looks like, if I modify Bar.java and tell javac to recompile Foo.java, it will also recompile Bar.java, but if I modify Baz.java, then compiling Foo.java doesn’t cause Baz.java to be recompiled&#8230;</i></p>
<p>javac tries to be smart, which usually works, but sometimes does not.  Unlike C++, a change in a class Baz cannot change the interface for a class Bar that uses it (even if it has the type Baz exposed in the interface) because objects are always passed by reference (and there are no type aliases so the actual type of any argument or return value is always clear.)  So, a recompilation of Baz requires a recompilation of Bar (which might use something that&#8217;s been changed) but not of next-level clients (Foo).</p>
<p>But, by default javac works the other way and only does one level of &#8220;search&#8221;.  If Bar.class is up-to-date wrt to Bar.java, but Baz.class is not, compilation of Foo.java->Foo.class will not update Baz.  This can lead to an application failing in unexpected ways.  But, I believe if Bar.class is also out of data, then Baz gets updated as well&#8212; although I&#8217;m not 100% certain.  This is what I recall happening when I was doing more Java programming.</p>
<p>There is a -depend or -Xdepend which tries to get the whole dependency tree rebuilt.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 7/12 queries in 0.005 seconds using disk: basic

Served from: malvasiabianca.org @ 2012-05-23 14:13:59 -->
