<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/wordpress-mu-1.2.3-2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Did you know&#8230;.</title>
	<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952</link>
	<description>The Blog of the Delphi Product Manager</description>
	<pubDate>Sat, 06 Sep 2008 21:11:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=wordpress-mu-1.2.3-2.2.1</generator>

	<item>
		<title>By: Nick Hodges</title>
		<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3891</link>
		<author>Nick Hodges</author>
		<pubDate>Fri, 05 Oct 2007 16:27:53 +0000</pubDate>
		<guid>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3891</guid>
		<description>Cleggy --

I'm using a LiveWriter plugin -- unfortunately, I can't seem to find the name of it.

I can tweak the formatting, so I'll give that a look.

Nick</description>
		<content:encoded><![CDATA[<p>Cleggy &#8211;</p>
<p>I&#8217;m using a LiveWriter plugin &#8212; unfortunately, I can&#8217;t seem to find the name of it.</p>
<p>I can tweak the formatting, so I&#8217;ll give that a look.</p>
<p>Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Hodges</title>
		<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3890</link>
		<author>Nick Hodges</author>
		<pubDate>Fri, 05 Oct 2007 16:26:49 +0000</pubDate>
		<guid>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3890</guid>
		<description>Serg --

This is just typical information hiding -- the actual declaration of the class doesn't matter and thus isn't made public.  The property exposes the functionality.

You can, of course, design things totally differently if you like.

Nick</description>
		<content:encoded><![CDATA[<p>Serg &#8211;</p>
<p>This is just typical information hiding &#8212; the actual declaration of the class doesn&#8217;t matter and thus isn&#8217;t made public.  The property exposes the functionality.</p>
<p>You can, of course, design things totally differently if you like.</p>
<p>Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Serg</title>
		<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3866</link>
		<author>Serg</author>
		<pubDate>Fri, 05 Oct 2007 06:24:10 +0000</pubDate>
		<guid>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3866</guid>
		<description>The code example looks strange for me - TNestedClass type declared as private while property NestedClass: TNestedClass is made public. What difference it makes if I declare TNestedClass type in public section of TOuterClass?</description>
		<content:encoded><![CDATA[<p>The code example looks strange for me - TNestedClass type declared as private while property NestedClass: TNestedClass is made public. What difference it makes if I declare TNestedClass type in public section of TOuterClass?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Clegg</title>
		<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3865</link>
		<author>David Clegg</author>
		<pubDate>Thu, 04 Oct 2007 19:41:39 +0000</pubDate>
		<guid>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3865</guid>
		<description>What tool do you use for code formatting, Nick? FWIW, YAPP (http://lingua.codegear.com/yapp/) doesn't seem to suffer from the same problem with the quotes.</description>
		<content:encoded><![CDATA[<p>What tool do you use for code formatting, Nick? FWIW, YAPP (http://lingua.codegear.com/yapp/) doesn&#8217;t seem to suffer from the same problem with the quotes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Hodges</title>
		<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3860</link>
		<author>Nick Hodges</author>
		<pubDate>Thu, 04 Oct 2007 16:44:34 +0000</pubDate>
		<guid>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3860</guid>
		<description>Rob --

I copied the code right out of the Code Editor and pasted it into a formatting tool.  That may have done something to the font.

Nick</description>
		<content:encoded><![CDATA[<p>Rob &#8211;</p>
<p>I copied the code right out of the Code Editor and pasted it into a formatting tool.  That may have done something to the font.</p>
<p>Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Kennedy</title>
		<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3859</link>
		<author>Rob Kennedy</author>
		<pubDate>Thu, 04 Oct 2007 16:26:31 +0000</pubDate>
		<guid>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3859</guid>
		<description>Users of Delphi 2005 should be aware of QC 11331. The compiler will accept some nested-class code that it shouldn't accept. The bug was fixed for Delphi 2006, apparently.

Marshall cites an enumerator as a good candidate for a nested class, but it shouldn't be a _private_ nested class. It should be public. That lets consumers of the class enumerate its contents. Maybe the "for-in" loop can use a private nested class, but the rest of us can't, and not all enumerations fit the "for-in" model.

And Nick, your code isn't valid. It's using left single quotation marks instead of apostrophes. Delphi doesn't support curly quotes, does it?</description>
		<content:encoded><![CDATA[<p>Users of Delphi 2005 should be aware of QC 11331. The compiler will accept some nested-class code that it shouldn&#8217;t accept. The bug was fixed for Delphi 2006, apparently.</p>
<p>Marshall cites an enumerator as a good candidate for a nested class, but it shouldn&#8217;t be a _private_ nested class. It should be public. That lets consumers of the class enumerate its contents. Maybe the "for-in" loop can use a private nested class, but the rest of us can&#8217;t, and not all enumerations fit the "for-in" model.</p>
<p>And Nick, your code isn&#8217;t valid. It&#8217;s using left single quotation marks instead of apostrophes. Delphi doesn&#8217;t support curly quotes, does it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Hodges</title>
		<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3858</link>
		<author>Nick Hodges</author>
		<pubDate>Thu, 04 Oct 2007 16:04:53 +0000</pubDate>
		<guid>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3858</guid>
		<description>C Johnson --

Probably the best example is a collection with a specific collection type.  The specific type is meaningless outside the context of the collection itself, so it makes sense to nest it within the collection itself.

Nick</description>
		<content:encoded><![CDATA[<p>C Johnson &#8211;</p>
<p>Probably the best example is a collection with a specific collection type.  The specific type is meaningless outside the context of the collection itself, so it makes sense to nest it within the collection itself.</p>
<p>Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Mueller</title>
		<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3854</link>
		<author>Thomas Mueller</author>
		<pubDate>Thu, 04 Oct 2007 10:17:16 +0000</pubDate>
		<guid>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3854</guid>
		<description>Hi Nick,

this highlights one of the disadvantages of having to fully declare classes in the interface section of a unit: Since the nested class is private, there is no need for it to be part of a unit's interface section, it only confuses programmers who use the class.
This would be much tidier if it were possible to declare anything that's private in the implementation section only. IIRC there is at least one QC report on this issue.

twm</description>
		<content:encoded><![CDATA[<p>Hi Nick,</p>
<p>this highlights one of the disadvantages of having to fully declare classes in the interface section of a unit: Since the nested class is private, there is no need for it to be part of a unit&#8217;s interface section, it only confuses programmers who use the class.<br />
This would be much tidier if it were possible to declare anything that&#8217;s private in the implementation section only. IIRC there is at least one QC report on this issue.</p>
<p>twm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: M J Marshall</title>
		<link>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3853</link>
		<author>M J Marshall</author>
		<pubDate>Thu, 04 Oct 2007 05:15:33 +0000</pubDate>
		<guid>http://blogs.codegear.com/nickhodges/2007/10/03/38952#comment-3853</guid>
		<description>Nested classes are very useful for implementing "local" classes such as Enumerators: Instead of defining TMyClassEnumerator as a public class, you define TMyClass.TEnumerator as a private nested class.

Besides keeping the namespace a little tidier, it allows you to restrict access to classes that you are forced to declare publicly (such as enumerators).</description>
		<content:encoded><![CDATA[<p>Nested classes are very useful for implementing "local" classes such as Enumerators: Instead of defining TMyClassEnumerator as a public class, you define TMyClass.TEnumerator as a private nested class.</p>
<p>Besides keeping the namespace a little tidier, it allows you to restrict access to classes that you are forced to declare publicly (such as enumerators).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
