<?xml version="1.0" encoding='utf-8'?>
<!-- 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
-->
<?xml-stylesheet type="text/xsl" href="https://rollerweblogger.org/roller-ui/styles/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom">
    <title type="html">Insert Pith Here</title>
    <subtitle type="html">&amp;quot;The essential or central part&amp;quot; according to  dictionary.com</subtitle>
    <id>https://rollerweblogger.org/lance/feed/entries/atom</id>
        <link rel="self" type="application/atom+xml" href="https://rollerweblogger.org/lance/feed/entries/atom" />
    <link rel="alternate" type="text/html" href="https://rollerweblogger.org/lance/" />
    <updated>2009-10-11T23:55:12+00:00</updated>
    <generator uri="http://roller.apache.org" version="6.1.5">Apache Roller</generator>
    <entry>
        <id>https://rollerweblogger.org/lance/entry/tomacco</id>
        <title type="html">Tomacco</title>
        <author><name>lance</name></author>
        <link rel="alternate" type="text/html" href="https://rollerweblogger.org/lance/entry/tomacco"/>
        <published>2009-03-10T14:15:41+00:00</published>
        <updated>2009-03-11T05:38:10+00:00</updated> 
        <category term="Java" label="Java" />
        <category term="composition" scheme="http://roller.apache.org/ns/tags/" />
        <category term="inheritance" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">I had another programmer come over and ask me a question that centered around inheritance.  Specifically, trying to understand how/why subclass Bletch could see property &amp;#39;bar&amp;#39; from superclass Foo:
&lt;pre&gt;
public class Foo {
   int bar;
   ...
}

public class Bletch extends Foo {
   public int count() {
      return bar++;
   }
   ...
}
&lt;/pre&gt;

I reminded him how inheritance works (he is new to OO), but we also discussed composition.  As an example I worked up to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Tomacco#Tomacco&quot;&gt;Tomacco plant&lt;/a&gt;: it extends Tomato, but contains an instance of Tobacco so that it can respond to hasNicotine():
&lt;pre&gt;
public class Tomacco extends Tomato {
   Tobacco t = new Tobacco();

   public boolean hasNicotine() {
      return t.hasNicotine();
   }
   ...
}&lt;/pre&gt;</content>
    </entry>
    <entry>
        <id>https://rollerweblogger.org/lance/entry/re_blind_pilot_flies_from</id>
        <title type="html">Re: Blind pilot flies from London to Sydney</title>
        <author><name>lance</name></author>
        <link rel="alternate" type="text/html" href="https://rollerweblogger.org/lance/entry/re_blind_pilot_flies_from"/>
        <published>2007-04-30T10:51:19+00:00</published>
        <updated>2007-04-30T17:51:19+00:00</updated> 
        <category term="General" label="General" />
        <category term="humor" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">But he was trying to get to Quebec!

Okay, &lt;a href=&quot;http://www.msnbc.msn.com/id/18391216/&quot;&gt;not really&lt;/a&gt;, but that was my first response to the headline.</content>
    </entry>
    <entry>
        <id>https://rollerweblogger.org/lance/entry/back_in_the_saddle</id>
        <title type="html">back in the saddle?</title>
        <author><name>lance</name></author>
        <link rel="alternate" type="text/html" href="https://rollerweblogger.org/lance/entry/back_in_the_saddle"/>
        <published>2007-04-11T14:17:17+00:00</published>
        <updated>2007-04-11T21:17:17+00:00</updated> 
        <category term="General" label="General" />
        <content type="html">From time-to-time I remind myself that I really should get brainopolis.com and Vanity Foul back on the air.  In our &amp;quot;new&amp;quot; home there are some infrastructure issues that I&amp;#39;ve just been loathe to tackle.

Not that anybody is paying attention to my second blog here (thanks Dave), but let me know if you&amp;#39;d like to hear from me more often.</content>
    </entry>
    <entry>
        <id>https://rollerweblogger.org/lance/entry/re_5_years_of_blogging</id>
        <title type="html">Re: 5 years of blogging</title>
        <author><name>lance</name></author>
        <link rel="alternate" type="text/html" href="https://rollerweblogger.org/lance/entry/re_5_years_of_blogging"/>
        <published>2007-04-11T14:13:28+00:00</published>
        <updated>2007-04-11T21:13:28+00:00</updated> 
        <category term="General" label="General" />
        <category term="dave" scheme="http://roller.apache.org/ns/tags/" />
        <category term="johnson" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">I&amp;#39;m going to make this a chain; from &lt;b&gt;&lt;a href=&quot;http://raibledesigns.com/rd/entry/5th_anniversary_of_blogging_roller&quot;&gt;RE: 5th anniversary of Blogging Roller&lt;/a&gt;&lt;/b&gt;

.quote {

    margin-left: 10%;

    text-align: justify;

    font-style: italic;

}

&lt;blockquote&gt;
&lt;p&gt;From the &lt;a href=&quot;http://rollerweblogger.org/roller&quot;&gt;Blogging Roller himself&lt;/a&gt;:
&lt;/p&gt;
&lt;p class=&quot;quote&quot; style=&quot;color:rgb(102, 102, 102);&quot;&gt;
Today is the fifth anniversary of this blog, which I started on &lt;a href=&quot;http://rollerweblogger.org/roller/date/20020411&quot;&gt;April 11, 2002&lt;/a&gt; to promote the Roller blog software that I had just finished writing. 
&lt;br&gt;...
&lt;br&gt;Now, five years later, Roller has graduated from the Apache Incubator to become &lt;a href=&quot;http://roller.apache.org/&quot;&gt;Apache Roller&lt;/a&gt;, blog-tech is my full-time job at Sun and I&amp;#39;m still Blogging Roller. Thanks to Roller users and contributors everywhere for helping to make this possible.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;
Congrats Dave - 5 years is 20 years in Internet Time isn&amp;#39;t it?!
&lt;/p&gt;&lt;/blockquote&gt;
Add my congrats.  I&amp;#39;ve taken a nearly two year mostly-hiatus from blogging, but I&amp;#39;m still around.  My 5 year anniversary comes up in Aug.</content>
    </entry>
    <entry>
        <id>https://rollerweblogger.org/lance/entry/why_television_is_bad_for</id>
        <title type="html">Why television is bad for democracy</title>
        <author><name>lance</name></author>
        <link rel="alternate" type="text/html" href="https://rollerweblogger.org/lance/entry/why_television_is_bad_for"/>
        <published>2006-07-07T11:07:45+00:00</published>
        <updated>2006-07-07T18:07:45+00:00</updated> 
        <category term="Politics" label="Politics" />
        <category term="Politics" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">Okay, I overstated it a bit with that title, but this quote really struck me.
&lt;blockquote&gt;
... he says that image media bypass reason and go straight to the emotions. The image media are a metaphor for not thinking logically. Images disable thinking, so unless people read and use their reason democracy is disabled as well.  [&lt;i&gt;&lt;a href=&quot;http://citmedia.org/blog/2006/07/03/guest-posting-is-media-performance-democracys-critical-issue/&quot;&gt;Is Media Performance Democracyâ&#128;&#153;s Critical Issue?&lt;/a&gt;&lt;/i&gt;]
&lt;/blockquote&gt;</content>
    </entry>
    <entry>
        <id>https://rollerweblogger.org/lance/entry/beautiful_girl</id>
        <title type="html">Beautiful Girl</title>
        <author><name>lance</name></author>
        <link rel="alternate" type="text/html" href="https://rollerweblogger.org/lance/entry/beautiful_girl"/>
        <published>2006-06-12T08:34:02+00:00</published>
        <updated>2006-06-12T15:34:02+00:00</updated> 
        <category term="General" label="General" />
        <category term="General" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">Since I&amp;#39;m too lazy to hunt up his email address I just had to post a note saying Tim Bray has got &lt;a href=&quot;http://www.tbray.org/ongoing/When/200x/2006/06/11/Now-We-Are-Four&quot;&gt;a beautiful girl&lt;/a&gt;!</content>
    </entry>
    <entry>
        <id>https://rollerweblogger.org/lance/entry/oil_companies_exploiting_gas_crisis</id>
        <title type="html">Oil Companies Exploiting Gas Crisis?</title>
        <author><name>lance</name></author>
        <link rel="alternate" type="text/html" href="https://rollerweblogger.org/lance/entry/oil_companies_exploiting_gas_crisis"/>
        <published>2006-04-20T10:48:35+00:00</published>
        <updated>2006-04-20T17:49:03+00:00</updated> 
        <category term="General" label="General" />
        <category term="General" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">Who could believe &lt;a href=&quot;http://www.consumerist.com/consumer/gas/oil-companies-exploiting-gas-crisis-168500.php&quot;&gt;it&lt;/a&gt;?

Of course, our President says he&amp;#39;ll be on the lookout for price gouging, so I feel much better about it.</content>
    </entry>
    <entry>
        <id>https://rollerweblogger.org/lance/entry/i_m_learning_to_hate</id>
        <title type="html">I&amp;#39;m learning to hate constructors</title>
        <author><name>lance</name></author>
        <link rel="alternate" type="text/html" href="https://rollerweblogger.org/lance/entry/i_m_learning_to_hate"/>
        <published>2006-04-19T15:26:10+00:00</published>
        <updated>2006-04-19T22:26:10+00:00</updated> 
        <category term="General" label="General" />
        <category term="General" scheme="http://roller.apache.org/ns/tags/" />
        <content type="html">&lt;p&gt;Of course, that&amp;#39;s partially to do with the way &amp;quot;things are done&amp;quot; here.  We&amp;#39;ve got a base class (we&amp;#39;ll call A) that takes the form of Constructor(int id) where the constructor then loads values from the database after doing a lookup on id, among other things.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ve been working on a set of classes that need to work on a second database (something the original set of data objects didn&amp;#39;t need to do), so I created an abstract class (we&amp;#39;ll call B) which subclasses A and does some common work (common to this second set).  And I&amp;#39;ve got subclass C of B.&lt;/p&gt;

&lt;p&gt;Now, B is abstract, so it doesn&amp;#39;t need constructors, but C has to be compatible with A (for use in a Factory) so it does have to have C(int id).  But to avoid compilation errors in C(int id) { super(id); } I do have to specify B(id) { super(id) }.  &lt;/p&gt;

&lt;p&gt;So, my abstract class does have to have a Constructor.  Or I can copy-paste the work A(id) does into C(id).&lt;/p&gt;

&lt;p&gt;Have I mentioned that there is no way to enforce this Constructor(int id) contract, except by discovering that the Factory cannot instantiate your C?  I could fix the Factory such that it doesn&amp;#39;t build an object by calling a constructor, add a FactoryInterface with an initialize(id) method, and have the Factory use that instead.  Now c.initialize() can override a.initialize() with no need for b.intialize(); and I only have to get this approved by the rest of the development staff.  And roll this change into the 20+ classes that inherit from A.&lt;/p&gt;</content>
    </entry>
</feed>

