<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://community.sharpdevelop.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Itai Bar-Haim - All Comments</title><link>http://community.sharpdevelop.net/blogs/itaibh/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 SP2 (Build: 31113.47)</generator><item><title>re: Help Needed</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/08/23/help-needed.aspx#19033</link><pubDate>Fri, 28 Sep 2007 11:29:08 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:19033</guid><dc:creator>rmsphd</dc:creator><description>&lt;p&gt;i help you, but i don't understand much better who Class Diagram Work with Graphics,,, if you can help me a understand, i help you :D&lt;/p&gt;
&lt;p&gt;Please,&lt;/p&gt;
&lt;p&gt;and my english is poor&lt;/p&gt;
&lt;p&gt;i am from Brasil&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=19033" width="1" height="1"&gt;</description></item><item><title>Sharp Develop An Open Source IDE for .NET</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/08/class-diagram-status.aspx#18262</link><pubDate>Mon, 06 Aug 2007 12:21:13 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:18262</guid><dc:creator>Imesh Gunaratne's Web Log</dc:creator><description>&lt;p&gt;Sharp Develop is a FREE Open Source IDE for developing .NET Applications. This seems to be a great news&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=18262" width="1" height="1"&gt;</description></item><item><title>re: Generics... why so incomplete?</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/16/generics-why-so-incomplete.aspx#15373</link><pubDate>Thu, 22 Feb 2007 20:11:07 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15373</guid><dc:creator>DavidSrbecky</dc:creator><description>&lt;p&gt;Yes, rest assured that this behavior is not 'incompleteness'. &amp;nbsp;It is very well thought out and if something is not possible, it is usually for very good reason.&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15373" width="1" height="1"&gt;</description></item><item><title>re: Generics... why so incomplete?</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/16/generics-why-so-incomplete.aspx#15325</link><pubDate>Mon, 19 Feb 2007 20:19:57 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15325</guid><dc:creator>Blue Ninja</dc:creator><description>&lt;p&gt;Well, no wonder it's making so many people pull their hair out, then! I can see how this would in many cases cause more confusion and frustration than it would be handy. I'll have to wrap my brain around it a bit more...&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15325" width="1" height="1"&gt;</description></item><item><title>re: Generics... why so incomplete?</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/16/generics-why-so-incomplete.aspx#15323</link><pubDate>Mon, 19 Feb 2007 18:07:23 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15323</guid><dc:creator>itaibh</dc:creator><description>&lt;p&gt;No, David is correct in his examples. It doesn't matter which type is exposed by reference, what really matters is the actual type behind it.&lt;/p&gt;
&lt;p&gt;However, this should still be possible with immutable object, such as read-only lists.&lt;/p&gt;
&lt;p&gt;Something like &lt;/p&gt;
&lt;p&gt;List&amp;lt;Circle&amp;gt; c = new List&amp;lt;Circle&amp;gt;();&lt;/p&gt;
&lt;p&gt;ReadOnlyList&amp;lt;Shape&amp;gt; s = c.AsReadOnly();&lt;/p&gt;
&lt;p&gt;should have worked fine if it was possible to mark specific types as immutable (or if the CLR could identify that the types does not expose any method or property or field in such way it is changeable by regular code (not dealing with special cases like reflection based changes of private members, etc...)&lt;/p&gt;
&lt;p&gt;Itai.&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15323" width="1" height="1"&gt;</description></item><item><title>re: Generics... why so incomplete?</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/16/generics-why-so-incomplete.aspx#15321</link><pubDate>Mon, 19 Feb 2007 14:53:01 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15321</guid><dc:creator>Blue Ninja</dc:creator><description>&lt;p&gt;David,&lt;/p&gt;
&lt;p&gt;In your first case, you are adding a rectangle to the list of shapes, not the list of circles. As long as circle and rectangle inherit from shape, that would be okay - but, you could not add the rectangle to a list of circles, because rectangles don't inherit from circles, but rather from shapes. Or am I misunderstanding that?&lt;/p&gt;
&lt;p&gt;If I didn't misunderstand, wouldn't that change case 2 so that it would in fact not be possible to put a rectangle into a circleHandler?&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15321" width="1" height="1"&gt;</description></item><item><title>re: Generics... why so incomplete?</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/16/generics-why-so-incomplete.aspx#15311</link><pubDate>Sun, 18 Feb 2007 22:26:02 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15311</guid><dc:creator>DavidSrbecky</dc:creator><description>&lt;p&gt;Not even looking at the articles I will try to give quick counter-examples:&lt;/p&gt;
&lt;p&gt;Case 1:&lt;/p&gt;
&lt;p&gt;List&amp;lt;Circle&amp;gt; c = new List&amp;lt;Circle&amp;gt;();&lt;/p&gt;
&lt;p&gt;List&amp;lt;Shape&amp;gt; s = c; &amp;nbsp;// Must not work because then you could...&lt;/p&gt;
&lt;p&gt;s.Add(new Rectangle()); // ...add rectangle to circle list&lt;/p&gt;
&lt;p&gt;Case 2:&lt;/p&gt;
&lt;p&gt;class ShapesHandler&amp;lt;T&amp;gt; where T : Shape&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;T foo(params T[] shapes) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;return shapes[0];&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void bar ()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; ShapesHandler&amp;lt;Circle&amp;gt; circleHandler = new ShapesHandler&amp;lt;Circle&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; Circle circle = circleHandler.foo (new Shape[] {new Rectangle()}); // Assign an Rectangle to Circle... ops&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15311" width="1" height="1"&gt;</description></item><item><title>re: Class Diagram Status</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/08/class-diagram-status.aspx#15271</link><pubDate>Fri, 16 Feb 2007 14:01:59 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15271</guid><dc:creator>Blue Ninja</dc:creator><description>&lt;p&gt;Thanks for the clarification - I'll keep checking there for updates.&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15271" width="1" height="1"&gt;</description></item><item><title>re: Generics... why so incomplete?</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/16/generics-why-so-incomplete.aspx#15268</link><pubDate>Fri, 16 Feb 2007 13:34:36 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15268</guid><dc:creator>MattWard</dc:creator><description>&lt;p&gt;The following O'Reilly article discusses this, but it does not really give you a concrete reason why but instead gives you an example where such a substitution does not make sense and then shows you to solve the problem using generic methods.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.ondotnet.com/pub/a/dotnet/2005/06/20/generics.html"&gt;http://www.ondotnet.com/pub/a/dotnet/2005/06/20/generics.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can get your code to compile if you use generic methods as shown below:&lt;/p&gt;
&lt;p&gt;	void foo&amp;lt;T&amp;gt;(IEnumerable&amp;lt;T&amp;gt; shapes) where T : Shape&lt;/p&gt;
&lt;p&gt;	{&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;	void bar ()&lt;/p&gt;
&lt;p&gt;	{&lt;/p&gt;
&lt;p&gt;		foo (new List&amp;lt;Circle&amp;gt;());&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;	class ShapesHandler&amp;lt;T&amp;gt; where T : Shape&lt;/p&gt;
&lt;p&gt;	{&lt;/p&gt;
&lt;p&gt;		void foo&amp;lt;K&amp;gt;(params K[] shapes) where K : Shape&lt;/p&gt;
&lt;p&gt;		{ &amp;nbsp;&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;		void bar ()&lt;/p&gt;
&lt;p&gt;		{&lt;/p&gt;
&lt;p&gt;			List&amp;lt;Shape&amp;gt; someShapes = new List&amp;lt;Shape&amp;gt;();&lt;/p&gt;
&lt;p&gt;			foo (someShapes.ToArray());&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;The ShapesHandler code above needs a little more explanation since it is not really covered in the original article. At first glance your original definition would seem correct. However the original code only works if it outside of the ShapesHandler class, presumably because the type specific version needs to be created first. Inside the class itself you could probably use the type T instead of the concrete Shape class, something like:&lt;/p&gt;
&lt;p&gt;		void bar ()&lt;/p&gt;
&lt;p&gt;		{&lt;/p&gt;
&lt;p&gt;			List&amp;lt;T&amp;gt; someShapes = new List&amp;lt;T&amp;gt;();&lt;/p&gt;
&lt;p&gt;			foo (someShapes.ToArray());&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;However all the above code does not explain the &amp;quot;why&amp;quot; just the &amp;quot;how&amp;quot;. The &amp;quot;why&amp;quot; is explained in the Rick Byers post linked to in the previous comment.&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15268" width="1" height="1"&gt;</description></item><item><title>re: Generics... why so incomplete?</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/16/generics-why-so-incomplete.aspx#15267</link><pubDate>Fri, 16 Feb 2007 13:15:53 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15267</guid><dc:creator>chrisstefano</dc:creator><description>&lt;p&gt;There are a number of blogs on this subject. I believe the term to use is covariance.&lt;/p&gt;
&lt;p&gt;Checkout this blog on the subject &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/rmbyers/archive/2005/02/16/375079.aspx"&gt;http://blogs.msdn.com/rmbyers/archive/2005/02/16/375079.aspx&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15267" width="1" height="1"&gt;</description></item><item><title>re: Class Diagram Status</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/08/class-diagram-status.aspx#15262</link><pubDate>Fri, 16 Feb 2007 11:05:33 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15262</guid><dc:creator>itaibh</dc:creator><description>&lt;p&gt;Just to clear things out about the backporting comment, what I meant is that the class diagram addin will be available as a third-party addin, and WILL NOT BE INCLUDED in future 2.x releases.&lt;/p&gt;
&lt;p&gt;The addin will be available from the addin page on sourceforge: &lt;a rel="nofollow" target="_new" href="http://sdclassdiagram.sf.net"&gt;http://sdclassdiagram.sf.net&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Itai.&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15262" width="1" height="1"&gt;</description></item><item><title>re: Class Diagram Status</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/08/class-diagram-status.aspx#15141</link><pubDate>Sat, 10 Feb 2007 08:39:06 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15141</guid><dc:creator>itaibh</dc:creator><description>&lt;p&gt;Yes, it will. But first I want it to get more functional. This will take some time.&lt;/p&gt;
&lt;p&gt;In the meanwhile, you can download one of the much earlier versions from &lt;a rel="nofollow" target="_new" href="http://sdclassdiagram.sf.net"&gt;http://sdclassdiagram.sf.net&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Itai.&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15141" width="1" height="1"&gt;</description></item><item><title>re: Class Diagram Status</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/08/class-diagram-status.aspx#15138</link><pubDate>Fri, 09 Feb 2007 23:59:35 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15138</guid><dc:creator>Blue Ninja</dc:creator><description>&lt;p&gt;Will this be back-ported to the 2.1 branch?&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15138" width="1" height="1"&gt;</description></item><item><title>re: Class Diagram Status</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/08/class-diagram-status.aspx#15126</link><pubDate>Fri, 09 Feb 2007 08:37:30 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15126</guid><dc:creator>ChristophWille</dc:creator><description>&lt;p&gt;The Montferrer bits (WPF, WF and Class Designer) can be found on our build server &lt;a rel="nofollow" target="_new" href="http://build.sharpdevelop.net/buildartefacts/"&gt;http://build.sharpdevelop.net/buildartefacts/&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15126" width="1" height="1"&gt;</description></item><item><title>re: Class Diagram Status</title><link>http://community.sharpdevelop.net/blogs/itaibh/archive/2007/02/08/class-diagram-status.aspx#15124</link><pubDate>Fri, 09 Feb 2007 07:12:15 GMT</pubDate><guid isPermaLink="false">1b90d1c1-04e6-45b0-b51d-b665527d49b9:15124</guid><dc:creator>darkcloud</dc:creator><description>&lt;p&gt;Where to get your addin from? i want to try and use it&lt;/p&gt;
&lt;img src="http://community.sharpdevelop.net/aggbug.aspx?PostID=15124" width="1" height="1"&gt;</description></item></channel></rss>