<?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: FGF: A Collection Class with Events</title>
	<atom:link href="http://jsedlak.org/2010/01/31/fgf-a-collection-class-with-events/feed/" rel="self" type="application/rss+xml" />
	<link>http://jsedlak.org/2010/01/31/fgf-a-collection-class-with-events/</link>
	<description></description>
	<lastBuildDate>Wed, 14 Sep 2011 00:30:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: John Sedlak</title>
		<link>http://jsedlak.org/2010/01/31/fgf-a-collection-class-with-events/comment-page-1/#comment-1287</link>
		<dc:creator>John Sedlak</dc:creator>
		<pubDate>Mon, 01 Feb 2010 11:13:54 +0000</pubDate>
		<guid isPermaLink="false">http://jsedlak.org/?p=573#comment-1287</guid>
		<description>I am assuming that you are speaking about the event portion of the code when you talk about avoiding generics? The reason for this is that a single event handler couldn&#039;t listen to multiple lists. It is a very small and insignificant reason, I know, but it also allows for complete coverage of use cases.

As for deriving from System...Collection - I honestly didn&#039;t know it existed. I will have to double check to see if this object is available on the 360 and Zune HD because Reflector seems to be having issues reflecting on them.

The reason for the index and the object is because originally this interface was modeled after the INotifyCollectionChanged interface, which supplies both the index and the object as well as another parameter telling how the collection was changed. I am hoping that with the release of .NET 4.0, this interface will be better placed in the framework&#039;s libraries such that I can use it. This will give me interoperability with other .NET software.

Again, the fact that the index exists does not limit the use to index based collections but does supply complete coverage which is an overriding goal for FGF. The point here is that if it is needed or can be used, the index parameter is there. If it weren&#039;t there than the use would be limited to non-indexable collections.

Having said all that, your implementation seems perfectly reasonable and is a good way of approaching the situation.</description>
		<content:encoded><![CDATA[<p>I am assuming that you are speaking about the event portion of the code when you talk about avoiding generics? The reason for this is that a single event handler couldn&#8217;t listen to multiple lists. It is a very small and insignificant reason, I know, but it also allows for complete coverage of use cases.</p>
<p>As for deriving from System&#8230;Collection &#8211; I honestly didn&#8217;t know it existed. I will have to double check to see if this object is available on the 360 and Zune HD because Reflector seems to be having issues reflecting on them.</p>
<p>The reason for the index and the object is because originally this interface was modeled after the INotifyCollectionChanged interface, which supplies both the index and the object as well as another parameter telling how the collection was changed. I am hoping that with the release of .NET 4.0, this interface will be better placed in the framework&#8217;s libraries such that I can use it. This will give me interoperability with other .NET software.</p>
<p>Again, the fact that the index exists does not limit the use to index based collections but does supply complete coverage which is an overriding goal for FGF. The point here is that if it is needed or can be used, the index parameter is there. If it weren&#8217;t there than the use would be limited to non-indexable collections.</p>
<p>Having said all that, your implementation seems perfectly reasonable and is a good way of approaching the situation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus Ewald</title>
		<link>http://jsedlak.org/2010/01/31/fgf-a-collection-class-with-events/comment-page-1/#comment-1286</link>
		<dc:creator>Markus Ewald</dc:creator>
		<pubDate>Mon, 01 Feb 2010 07:01:59 +0000</pubDate>
		<guid isPermaLink="false">http://jsedlak.org/?p=573#comment-1286</guid>
		<description>Having taken that route already, allow me to make some suggestions ;-)

Is there any reason why you avoid generics in that code? I would hate to have to downcast in the event handler. Especially since with this design, if I later changed the collection&#039;s type, those downcasts would still happily compile and only fail a runtime.

You also don&#039;t seem to derive from System.Collections.ObjectModel.Collection (which is made for this purpose and would implement IList, ICollection, IEnumerable, IList, ICollection and IEnumerable for you)

Supplying an index *and* the object seems redundant. Such a talkative interface limits the concept to indexable collections. I have had a use for observable dictionaries in the past :)

Here&#039;s my hammer for the same nail: :P
https://devel.nuclex.org/framework/browser/Nuclex.Support/trunk/Source/Collections/ItemEventArgs.cs
https://devel.nuclex.org/framework/browser/Nuclex.Support/trunk/Source/Collections/ObservableCollection.cs
https://devel.nuclex.org/framework/browser/Nuclex.Support/trunk/Source/Collections/ObservableDictionary.cs</description>
		<content:encoded><![CDATA[<p>Having taken that route already, allow me to make some suggestions <img src='http://jsedlak.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Is there any reason why you avoid generics in that code? I would hate to have to downcast in the event handler. Especially since with this design, if I later changed the collection&#8217;s type, those downcasts would still happily compile and only fail a runtime.</p>
<p>You also don&#8217;t seem to derive from System.Collections.ObjectModel.Collection (which is made for this purpose and would implement IList, ICollection, IEnumerable, IList, ICollection and IEnumerable for you)</p>
<p>Supplying an index *and* the object seems redundant. Such a talkative interface limits the concept to indexable collections. I have had a use for observable dictionaries in the past <img src='http://jsedlak.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s my hammer for the same nail: <img src='http://jsedlak.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
<a href="https://devel.nuclex.org/framework/browser/Nuclex.Support/trunk/Source/Collections/ItemEventArgs.cs" rel="nofollow">https://devel.nuclex.org/framework/browser/Nuclex.Support/trunk/Source/Collections/ItemEventArgs.cs</a><br />
<a href="https://devel.nuclex.org/framework/browser/Nuclex.Support/trunk/Source/Collections/ObservableCollection.cs" rel="nofollow">https://devel.nuclex.org/framework/browser/Nuclex.Support/trunk/Source/Collections/ObservableCollection.cs</a><br />
<a href="https://devel.nuclex.org/framework/browser/Nuclex.Support/trunk/Source/Collections/ObservableDictionary.cs" rel="nofollow">https://devel.nuclex.org/framework/browser/Nuclex.Support/trunk/Source/Collections/ObservableDictionary.cs</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

