<?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"
	>
<channel>
	<title>Comments for Joanna Carter</title>
	<atom:link href="http://blogs.teamb.com/joannacarter/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://blogs.teamb.com/joannacarter</link>
	<description></description>
	<pubDate>Mon, 15 Mar 2010 01:07:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>Comment on The Iterator Pattern by giulio</title>
		<link>http://blogs.teamb.com/joannacarter/2004/06/30/697#comment-29</link>
		<dc:creator>giulio</dc:creator>
		<pubDate>Tue, 08 Aug 2006 17:49:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/06/30/692/#comment-29</guid>
		<description>Why don't to add an implementation template using C# enerics? Anyway... very good! ;-)&lt;br&gt;&lt;br&gt;Bye,&lt;br&gt;Giulio</description>
		<content:encoded><![CDATA[<p>Why don&#8217;t to add an implementation template using C# enerics? Anyway&#8230; very good! <img src='http://blogs.teamb.com/joannacarter/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Bye,<br />
<br />Giulio</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Observer Pattern by Mike S</title>
		<link>http://blogs.teamb.com/joannacarter/2004/06/30/690#comment-18</link>
		<dc:creator>Mike S</dc:creator>
		<pubDate>Tue, 28 Mar 2006 00:19:14 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/06/30/1/#comment-18</guid>
		<description>Nice article and thanks for putting it together.&lt;br&gt;&lt;br&gt;Do you have a working example available for download?  It is much easier to start with something that works and I have been completely unsuccessful in splicing &lt;br&gt;together the various snippets.</description>
		<content:encoded><![CDATA[<p>Nice article and thanks for putting it together.</p>
<p>Do you have a working example available for download?  It is much easier to start with something that works and I have been completely unsuccessful in splicing<br />
<br />together the various snippets.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on OO Frameworks Masterclass by wl</title>
		<link>http://blogs.teamb.com/joannacarter/2004/08/09/1024#comment-15</link>
		<dc:creator>wl</dc:creator>
		<pubDate>Mon, 12 Sep 2005 20:36:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/08/09/698/#comment-15</guid>
		<description>no comment :-)</description>
		<content:encoded><![CDATA[<p>no comment <img src='http://blogs.teamb.com/joannacarter/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Iterator Pattern by Jose Luis</title>
		<link>http://blogs.teamb.com/joannacarter/2004/06/30/697#comment-16</link>
		<dc:creator>Jose Luis</dc:creator>
		<pubDate>Sat, 20 Aug 2005 15:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/06/30/692/#comment-16</guid>
		<description>If I add the &#34;friendly&#34; class to be able to declare the iterator class into another unit separated from TCustomerList class, I would need to add into the TCustomerIterator unit the uses of the TCustomerList.&lt;br&gt;Then, when I would like to add the GetIterator into the TCustomerList to create the iterator from withing the list ifself, am I going to have a circular reference?&lt;br&gt;</description>
		<content:encoded><![CDATA[<p>If I add the &quot;friendly&quot; class to be able to declare the iterator class into another unit separated from TCustomerList class, I would need to add into the TCustomerIterator unit the uses of the TCustomerList.<br />
<br />Then, when I would like to add the GetIterator into the TCustomerList to create the iterator from withing the list ifself, am I going to have a circular reference?<br />
</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Iterator Pattern by Shawn Stamps</title>
		<link>http://blogs.teamb.com/joannacarter/2004/06/30/697#comment-28</link>
		<dc:creator>Shawn Stamps</dc:creator>
		<pubDate>Sun, 10 Jul 2005 19:05:11 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/06/30/692/#comment-28</guid>
		<description>Yes, it is an infinite loop. The correct code would be:&lt;br&gt;&lt;br&gt;Repeat&lt;br&gt;Result := inherited Next;&lt;br&gt;Until Not Result Or Result And CurrentItem.CreditStop;&lt;br&gt;&lt;br&gt;I've coded that kind of error so many times that I usually catch it right after I type it in. ;)&lt;br&gt;</description>
		<content:encoded><![CDATA[<p>Yes, it is an infinite loop. The correct code would be:</p>
<p>Repeat<br />
<br />Result := inherited Next;<br />
<br />Until Not Result Or Result And CurrentItem.CreditStop;</p>
<p>I&#8217;ve coded that kind of error so many times that I usually catch it right after I type it in. <img src='http://blogs.teamb.com/joannacarter/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Observer Pattern by Joanna Carter</title>
		<link>http://blogs.teamb.com/joannacarter/2004/06/30/690#comment-17</link>
		<dc:creator>Joanna Carter</dc:creator>
		<pubDate>Thu, 09 Jun 2005 13:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/06/30/1/#comment-17</guid>
		<description>No, using interface references for delegation is just as valid as objects as long as you are aware of the refcounting and QueryInterface implications.</description>
		<content:encoded><![CDATA[<p>No, using interface references for delegation is just as valid as objects as long as you are aware of the refcounting and QueryInterface implications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Observer Pattern by Ilia Frenkel</title>
		<link>http://blogs.teamb.com/joannacarter/2004/06/30/690#comment-27</link>
		<dc:creator>Ilia Frenkel</dc:creator>
		<pubDate>Thu, 09 Jun 2005 13:34:16 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/06/30/1/#comment-27</guid>
		<description>Great article!&lt;br&gt;I have some remark, though:&lt;br&gt;  TClockTimer = class(TInterfacedObject, IClockTimer, ISubject)&lt;br&gt;  private&lt;br&gt;    fTimer: TTimer;&lt;br&gt;    fInternalTime: TDateTime;&lt;br&gt;    fSubject: --&#62;ISubject&#60;--;&lt;br&gt;    function GetTime: TDateTime;&lt;br&gt;    procedure Tick(Sender: TObject);&lt;br&gt;    property Subject: --&#62;ISubject&#60;--&lt;br&gt;             read fSubject&lt;br&gt;             implements ISubject;&lt;br&gt;  public&lt;br&gt;    constructor Create;&lt;br&gt;  end;&lt;br&gt;&lt;br&gt;Shouldn't it be TSubject?&lt;br&gt;&lt;br&gt;---&lt;br&gt;Best regards, Ilia Frenkel.</description>
		<content:encoded><![CDATA[<p>Great article!<br />
<br />I have some remark, though:<br />
<br />  TClockTimer = class(TInterfacedObject, IClockTimer, ISubject)<br />
<br />  private<br />
<br />    fTimer: TTimer;<br />
<br />    fInternalTime: TDateTime;<br />
<br />    fSubject: &#8211;&gt;ISubject&lt;&#8211;;<br />
<br />    function GetTime: TDateTime;<br />
<br />    procedure Tick(Sender: TObject);<br />
<br />    property Subject: &#8211;&gt;ISubject&lt;&#8211;<br />
<br />             read fSubject<br />
<br />             implements ISubject;<br />
<br />  public<br />
<br />    constructor Create;<br />
<br />  end;</p>
<p>Shouldn&#8217;t it be TSubject?</p>
<p>&#8212;<br />
<br />Best regards, Ilia Frenkel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Iterator Pattern by Stephen Melnyk</title>
		<link>http://blogs.teamb.com/joannacarter/2004/06/30/697#comment-26</link>
		<dc:creator>Stephen Melnyk</dc:creator>
		<pubDate>Tue, 23 Nov 2004 21:30:54 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/06/30/692/#comment-26</guid>
		<description>Thanks for the article, Joanna.  I appreciate you taking the time to write it.&lt;br&gt;&lt;br&gt;Could you clarify one point for me?  In the Skip Iterators section, you implement TBadCustomerIterator.Next with:&lt;br&gt;&lt;br&gt;    repeat&lt;br&gt;      Result := inherited Next;&lt;br&gt;    until Result and CurrentItem.CreditStop&lt;br&gt;&lt;br&gt;Isn't this an infinite loop?  The last item in the list is going to return False from the inherited Next.&lt;br&gt;&lt;br&gt;Stephen</description>
		<content:encoded><![CDATA[<p>Thanks for the article, Joanna.  I appreciate you taking the time to write it.</p>
<p>Could you clarify one point for me?  In the Skip Iterators section, you implement TBadCustomerIterator.Next with:</p>
<p>    repeat<br />
<br />      Result := inherited Next;<br />
<br />    until Result and CurrentItem.CreditStop</p>
<p>Isn&#8217;t this an infinite loop?  The last item in the list is going to return False from the inherited Next.</p>
<p>Stephen</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Observer Pattern by Joanna Carter</title>
		<link>http://blogs.teamb.com/joannacarter/2004/06/30/690#comment-25</link>
		<dc:creator>Joanna Carter</dc:creator>
		<pubDate>Wed, 20 Oct 2004 00:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/06/30/1/#comment-25</guid>
		<description>&#62; Great article! But I think there are some small&lt;br&gt;&#62; problems in it. &lt;br&gt;&#62; 1 just as Lars Christian Svane said, :) &lt;br&gt;&#62; (DigitalClock1 as ISubject).Attach(fClockTimer as&lt;br&gt;&#62; IObserver); &lt;br&gt;&#62; should be: &lt;br&gt;&#62; (fClockTimer as ISubject).Attach(DigitalClock1 as&lt;br&gt;&#62; IObserver); &lt;br&gt;&lt;br&gt;Yes, I should change this :-)&lt;br&gt;&lt;br&gt;&#62; 2 &lt;br&gt;&#62; fController: Pointer; &lt;br&gt;&#62; should be: &lt;br&gt;&#62; fController: IInterface; &lt;br&gt;&#60;snip&#62;&lt;br&gt;&#62; Why? &lt;br&gt;&#62; If fController is defined as a Pointer type, I&lt;br&gt;&#62; think it is a pointer type cast and not a&lt;br&gt;&#62; interface reference in code&lt;br&gt;&#62; &#34;fController := Pointer(Controller)&#34;. you have to&lt;br&gt;&#62; add &#34;Controller._AddRef;&#34; to avoid a access&lt;br&gt;&#62; violation. &lt;br&gt;&lt;br&gt;The use of the Pointer is known as a 'weak reference' and is used to break the circular refcount problem where an outer class holds a reference to an inner class and an inner class holds a reference to the outer class. This then means that neither of the refcounts get to drop to zero thus causing a memory leak. Assigning to a Pointer means that the refcount of the Controller is not incremented from the one that is holding the outer (controller) object; therefore, when that ref falls out of scope it then drops to zero releasing the outer object which, in turn releases the inner object.&lt;br&gt;&lt;br&gt;Try it :-)&lt;br&gt;&lt;br&gt;Joanna</description>
		<content:encoded><![CDATA[<p>&gt; Great article! But I think there are some small<br />
<br />&gt; problems in it.<br />
<br />&gt; 1 just as Lars Christian Svane said, <img src='http://blogs.teamb.com/joannacarter/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br />&gt; (DigitalClock1 as ISubject).Attach(fClockTimer as<br />
<br />&gt; IObserver);<br />
<br />&gt; should be:<br />
<br />&gt; (fClockTimer as ISubject).Attach(DigitalClock1 as<br />
<br />&gt; IObserver); </p>
<p>Yes, I should change this <img src='http://blogs.teamb.com/joannacarter/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>&gt; 2<br />
<br />&gt; fController: Pointer;<br />
<br />&gt; should be:<br />
<br />&gt; fController: IInterface;<br />
<br />&lt;snip&gt;<br />
<br />&gt; Why?<br />
<br />&gt; If fController is defined as a Pointer type, I<br />
<br />&gt; think it is a pointer type cast and not a<br />
<br />&gt; interface reference in code<br />
<br />&gt; &quot;fController := Pointer(Controller)&quot;. you have to<br />
<br />&gt; add &quot;Controller._AddRef;&quot; to avoid a access<br />
<br />&gt; violation. </p>
<p>The use of the Pointer is known as a &#8216;weak reference&#8217; and is used to break the circular refcount problem where an outer class holds a reference to an inner class and an inner class holds a reference to the outer class. This then means that neither of the refcounts get to drop to zero thus causing a memory leak. Assigning to a Pointer means that the refcount of the Controller is not incremented from the one that is holding the outer (controller) object; therefore, when that ref falls out of scope it then drops to zero releasing the outer object which, in turn releases the inner object.</p>
<p>Try it <img src='http://blogs.teamb.com/joannacarter/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Joanna</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Observer Pattern by wango</title>
		<link>http://blogs.teamb.com/joannacarter/2004/06/30/690#comment-14</link>
		<dc:creator>wango</dc:creator>
		<pubDate>Tue, 19 Oct 2004 08:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.teamb.com/joannacarter/2004/06/30/1/#comment-14</guid>
		<description>Great article! But I think there are some small  problems in it.&lt;br&gt;1 just as Lars Christian Svane said, :)&lt;br&gt;(DigitalClock1 as ISubject).Attach(fClockTimer as IObserver); &lt;br&gt;should be: &lt;br&gt;(fClockTimer as ISubject).Attach(DigitalClock1 as IObserver); &lt;br&gt;2 &lt;br&gt;fController: Pointer;&lt;br&gt;should be:  &lt;br&gt;fController: IInterface;&lt;br&gt;&lt;br&gt;constructor TSubject.Create(const Controller: IInterface);&lt;br&gt;begin&lt;br&gt;  inherited Create;&lt;br&gt;  fController := Pointer(Controller);&lt;br&gt;should be:&lt;br&gt;  fController := Controller;&lt;br&gt;end;&lt;br&gt;&lt;br&gt;procedure TSubject.Notify;&lt;br&gt;var&lt;br&gt;  i: Integer;&lt;br&gt;begin&lt;br&gt;  if fObservers &#60;&#62; nil then&lt;br&gt;    for i := 0 to Pred(fObservers.Count) do&lt;br&gt;      (fObservers[i]. as IObserver).Update(IInterface (fController));&lt;br&gt;should be:&lt;br&gt;      (fObservers[i] as IObserver).Update(fController);&lt;br&gt;end;&lt;br&gt;&lt;br&gt;Why?&lt;br&gt;If fController is defined as a Pointer type, I think it is a pointer type cast and not a interface reference in code &#34;fController := Pointer(Controller)&#34;. you have to add &#34;Controller._AddRef;&#34; to avoid a access violation. &lt;br&gt;</description>
		<content:encoded><![CDATA[<p>Great article! But I think there are some small  problems in it.<br />
<br />1 just as Lars Christian Svane said, <img src='http://blogs.teamb.com/joannacarter/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br />(DigitalClock1 as ISubject).Attach(fClockTimer as IObserver);<br />
<br />should be:<br />
<br />(fClockTimer as ISubject).Attach(DigitalClock1 as IObserver);<br />
<br />2<br />
<br />fController: Pointer;<br />
<br />should be:<br />
<br />fController: IInterface;</p>
<p>constructor TSubject.Create(const Controller: IInterface);<br />
<br />begin<br />
<br />  inherited Create;<br />
<br />  fController := Pointer(Controller);<br />
<br />should be:<br />
<br />  fController := Controller;<br />
<br />end;</p>
<p>procedure TSubject.Notify;<br />
<br />var<br />
<br />  i: Integer;<br />
<br />begin<br />
<br />  if fObservers &lt;&gt; nil then<br />
<br />    for i := 0 to Pred(fObservers.Count) do<br />
<br />      (fObservers[i]. as IObserver).Update(IInterface (fController));<br />
<br />should be:<br />
<br />      (fObservers[i] as IObserver).Update(fController);<br />
<br />end;</p>
<p>Why?<br />
<br />If fController is defined as a Pointer type, I think it is a pointer type cast and not a interface reference in code &quot;fController := Pointer(Controller)&quot;. you have to add &quot;Controller._AddRef;&quot; to avoid a access violation.<br />
</p>
]]></content:encoded>
	</item>
</channel>
</rss>
