<?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>Gabriele Lana &#187; java</title>
	<atom:link href="http://www.gabrielelana.it/archives/category/java/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gabrielelana.it</link>
	<description>on Agile Methodologies and Programming</description>
	<lastBuildDate>Sat, 04 Jun 2011 15:51:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Interface Implementation in Java</title>
		<link>http://www.gabrielelana.it/archives/25</link>
		<comments>http://www.gabrielelana.it/archives/25#comments</comments>
		<pubDate>Tue, 27 Mar 2007 06:01:10 +0000</pubDate>
		<dc:creator>Gabriele Lana</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.gabrielelana.it/archives/25</guid>
		<description><![CDATA[Quante volte vi siete trovati di fronte alla dichiarazione di un&#8217;interfaccia

1: interface SomeInterface {
2:     ...
3: }

Per poi scoprire che ne esiste una sola implementazione?
1: class SomeInterfaceImpl implements SomeInterface {
2:     ...
3: }

Non so voi, ma il risultato, dal un punto di vista della leggibiiltà, lo trovo estremamente poco [...]]]></description>
			<content:encoded><![CDATA[<p>Quante volte vi siete trovati di fronte alla dichiarazione di un&#8217;interfaccia<br />
<span id="more-25"></span></p>
<pre class="code"><tt>1: <span style="font-weight: bold"><span style="color: #404040">interface</span></span> SomeInterface {
2:     ...
3: }
</tt></pre>
<p>Per poi scoprire che ne esiste una sola implementazione?</p>
<pre class="code"><tt>1: <span style="font-weight: bold"><span style="color: #404040">class</span></span> SomeInterfaceImpl <span style="font-weight: bold"><span style="color: #404040">implements</span></span> SomeInterface {
2:     ...
3: }
</tt></pre>
<p>Non so voi, ma il risultato, dal un punto di vista della leggibiiltà, lo trovo estremamente poco elegante, il nome SomeInterfaceImpl è stato scelto per una limitazione tecnica, non certo per aderire al <a href="http://domaindrivendesign.org/discussion/messageboardarchive/UbiquitousLanguage.html">linguaggio di dominio</a>.  Vi offro un&#8217;alternativa (più che altro un workaround, la limitazione rimane)</p>
<pre class="code"><tt>01: <span style="font-weight: bold"><span style="color: #404040">interface</span></span> SomeInterface {
02:
03:         <span style="font-weight: bold"><span style="color: #404040">public</span></span> <span style="font-weight: bold"><span style="color: #404040">static</span></span> <span style="font-weight: bold"><span style="color: #404040">class</span></span> Implementation <span style="font-weight: bold"><span style="color: #404040">implements</span></span> SomeInterface {
04:              ...
05:         }
06:
07: }
</tt></pre>
<p>Che ci porterebbe ad avere</p>
<pre class="code"><tt>01: SomeInterface object <span style="color: #FF0000">=</span> <span style="font-weight: bold"><span style="color: #404040">new</span></span> SomeInterface<span style="color: #FF0000">.</span>Implementation<span style="color: #FF0000">();</span>
</tt></pre>
<p>Che non è il massimo, ma secondo me è meglio di prima</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gabrielelana.it/archives/25/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

