<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><id>tag:blogger.com,1999:blog-8730195</id><updated>2009-11-08T17:48:42.265-08:00</updated><title type="text">Delphi Power Unleashed</title><subtitle type="html">Programming blogs containing Delphi, C# and .NET experiences</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default?start-index=26&amp;max-results=25" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>233</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/DelphiPowerUnleashed" type="application/atom+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry><id>tag:blogger.com,1999:blog-8730195.post-4170351345267603648</id><published>2009-11-06T00:13:00.001-08:00</published><updated>2009-11-06T12:25:55.948-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linq" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><title type="text">Casting lists using LINQ #2</title><content type="html">&lt;p&gt;In &lt;a href="http://beensoft.blogspot.com/2009/11/casting-lists-using-linq.html"&gt;my previous post&lt;/a&gt; I showed the LINQ way to cast List&amp;lt;SomeDeriveType&amp;gt; to List&amp;lt;SomeBaseObject&amp;gt;.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:e5aa0a4c-a01e-4b7d-b6bd-7c1f2f520f1d" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;BaseObject&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; baseObjects    &lt;br /&gt;             &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; DerivedList.Cast&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;BaseObject&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;Great stuff!&lt;br /&gt;&lt;br /&gt;As &lt;a href="http://twitter.com/jamiei" target="_blank"&gt;@jamiei&lt;/a&gt; &lt;a href="http://beensoft.blogspot.com/2009/11/casting-lists-using-linq.html#comments"&gt;commented&lt;/a&gt; this will raise an exception if the cast fails. &lt;strong&gt;OffType&amp;lt;T&amp;gt;&lt;/strong&gt; will return only the elements of type T despite the fact that you have different derived types in one list. So suppose you have an &lt;strong&gt;Animal &lt;/strong&gt;class and a &lt;strong&gt;Cat&lt;/strong&gt; and &lt;strong&gt;Dog&lt;/strong&gt; class that derive from Animal you could do something like this:&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:0965f3e9-8652-4cc6-9e0b-5d71bcae5d04" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;List&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Animal&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; animalList &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; List&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Animal&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;();&lt;br /&gt;animalList.Add(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Dog(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Dog1&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;animalList.Add(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Dog(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Dog2&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;animalList.Add(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Dog(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Dog3&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;animalList.Add(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Cat(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Cat1&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;animalList.Add(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Cat(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Cat2&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;animalList.Add(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Cat(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Cat3&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Get the dogs&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Dog&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; dogList &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; animalList.OfType&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Dog&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;();&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Get the cats&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Cat&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; catList &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; animalList.OfType&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Cat&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;();&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;LINQ makes it very easy to seperate the Dogs from the Cats!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-4170351345267603648?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/4170351345267603648/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=4170351345267603648" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/4170351345267603648" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/4170351345267603648" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/11/casting-lists-using-linq-2.html" title="Casting lists using LINQ #2" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-59479135599845446</id><published>2009-11-04T00:05:00.001-08:00</published><updated>2009-11-06T12:00:21.413-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linq" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><title type="text">Casting lists using LINQ #1</title><content type="html">I have been doing lately much work on a .NET 3.5 application using LINQ. LINQ is a great way to manipulate data. I still consider myself a 'LINQ rookie' so I discover everyday something new.&lt;/p&gt;  &lt;p&gt;One thing that floated around my head a while was the problem that you can't cast a List&amp;lt;SomeDerivedObject&amp;gt; to List&amp;lt;SomeBaseObject&amp;gt;.   &lt;br /&gt;A poorman's solution to this was to loop the objects from the one list into the other list. Not an elegant solution though.....&lt;/p&gt;  &lt;p&gt;I discovered that you can do this easily with LINQ. When you use a &lt;strong&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/strong&gt; you can do this like this:&lt;/p&gt;  &lt;p&gt;   &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:3d2ed4fb-5987-4339-9565-2f69418449ae" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;IEnumerable&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;BaseObject&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; baseObjects &lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; DerivedList.Cast&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;BaseObject&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;Where DerivedList holds objects that inherit from BaseObject.&lt;br /&gt;With a &lt;strong&gt;List&amp;lt;T&amp;gt;&lt;/strong&gt; you could do something like this(copy):&lt;br /&gt;   &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:516d3fb7-54d8-459c-b337-7499bf3ac312" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;List&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;BaseObject&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; baseObjects &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;br /&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; List&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;BaseObject&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;(DerivedList.Cast&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;BaseObject&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;());&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;A great LINQ resource is &lt;a href="http://msdn.microsoft.com/en-gb/vcsharp/aa336746.aspx" target="_blank"&gt;101 LINQ samples&lt;/a&gt; on MSDN.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-59479135599845446?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/59479135599845446/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=59479135599845446" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/59479135599845446" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/59479135599845446" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/11/casting-lists-using-linq.html" title="Casting lists using LINQ #1" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-1106787991848385870</id><published>2009-08-05T00:43:00.001-07:00</published><updated>2009-08-05T00:44:38.187-07:00</updated><title type="text">Go see Delphi 2010</title><content type="html">&lt;p&gt;The first Delphi 2010 sneak peek video's showed up on the Internet. &lt;a href="http://www.embarcadero.com/rad-studio-2010/" target="_blank"&gt;The first sneak peek&lt;/a&gt; shows some new IDE features like &lt;strong&gt;IDE insight&lt;/strong&gt;, an everywhere context sensitive IDE navigation system.    &lt;br /&gt;    &lt;br /&gt;Anders Ohlsson has a nice sum up of &lt;a href="http://blogs.embarcadero.com/ao/2009/08/04/39017" target="_blank"&gt;all the related Delphi 2010 blogposts&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-1106787991848385870?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/1106787991848385870/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=1106787991848385870" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/1106787991848385870" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/1106787991848385870" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/08/go-see-delphi-2010.html" title="Go see Delphi 2010" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-2758797911910747571</id><published>2009-06-30T00:30:00.001-07:00</published><updated>2009-06-30T00:31:54.562-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi prism" /><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><title type="text">CodeRush for free, not for Delphi Prism</title><content type="html">&lt;p&gt;As &lt;a href="http://beensoft.blogspot.com/2009/04/coderush-when-code-smells.html" target="_blank"&gt;blogged before&lt;/a&gt; you know that I think DevExpress CodeRush totally rocks!    &lt;br /&gt;Did you know that you can get a lot of this functionality for free?    &lt;br /&gt;    &lt;br /&gt;Mark Miller has got &lt;a href="http://community.devexpress.com/blogs/markmiller/archive/2009/06/25/coderush-xpress-for-c-and-visual-basic-2008.aspx" target="_blank"&gt;a very nice list&lt;/a&gt; of features that are available in &lt;a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/index.xml" target="_blank"&gt;CodeRush Xpress&lt;/a&gt; for&lt;strong&gt; C#&lt;/strong&gt; and &lt;strong&gt;Visual Basic&lt;/strong&gt; inside &lt;strong&gt;Visual Studio 2008&lt;/strong&gt;. All for free!    &lt;br /&gt;In the full product you will get even more, check out the differences in this article: &lt;a href="http://community.devexpress.com/blogs/markmiller/archive/2008/12/19/differences-between-coderush-xpress-and-coderush.aspx" target="_blank"&gt;Moving up from CodeRus Xpress to CodeRush&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Delphi Prism&lt;/strong&gt;    &lt;br /&gt;The downside of all this good stuff is that &lt;a href="http://www.codegear.com/products/delphi/prism" target="_blank"&gt;Delphi Prism&lt;/a&gt; is not supported. The fact that the original CodeRush was a pure Delphi IDE product, I can not believe that it will not be supported in the future. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-2758797911910747571?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/2758797911910747571/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=2758797911910747571" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/2758797911910747571" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/2758797911910747571" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/06/coderush-for-free-not-for-delphi-prism.html" title="CodeRush for free, not for Delphi Prism" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-8326390907556927941</id><published>2009-06-29T00:39:00.001-07:00</published><updated>2009-06-29T00:39:59.998-07:00</updated><title type="text">The future of Delphi</title><content type="html">&lt;p&gt;I haven't had much time lately to follow everything on the Delphi side of the fence, but there is a lot going on.   &lt;br /&gt;Stefaan Lesage has a nice write up on this future, &lt;a href="http://www.devia.be/news/article/the-future-of-delphi-looks-brighter-than-ever-before/" target="_blank"&gt;The future of Delphi looks brighter than ever before&lt;/a&gt;.    &lt;br /&gt;    &lt;br /&gt;A very nice read, sums up everything that is cooking in the labs, including the roadmap.    &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-8326390907556927941?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/8326390907556927941/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=8326390907556927941" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/8326390907556927941" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/8326390907556927941" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/06/future-of-delphi.html" title="The future of Delphi" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-8836324858615334692</id><published>2009-05-18T01:06:00.001-07:00</published><updated>2009-05-18T01:33:21.726-07:00</updated><title type="text">Applying Domain-Driven Design - Book review</title><content type="html">&lt;p&gt;Before this weekend I got my copy of &lt;a href="http://www.amazon.com/Applying-Domain-Driven-Design-Patterns-Examples/dp/0321268202" target="_blank"&gt;Applying Domain-Driven Design and Patterns&lt;/a&gt; by Jimmy Nilsson.    &lt;br /&gt;&lt;a href="http://www.amazon.com/Applying-Domain-Driven-Design-Patterns-Examples/dp/0321268202" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="148" alt="adddp" src="http://lh6.ggpht.com/_33FNQ5v3xjo/ShEXGbUfGXI/AAAAAAAAAIM/P9Z5mAMHsyc/adddp%5B6%5D.jpg?imgmax=800" width="115" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;Althought the title, in my opinion should be &amp;quot;&lt;strong&gt;Applying Domain-Driven Design, Test Driven Design and Patterns&amp;quot;&lt;/strong&gt;, because beside DDD it covers a great deal of TDD also.    &lt;br /&gt;Design patterns for me were always a bit fuzzy, something from far-far-away land. However lately I am having more and more interest in &lt;a href="http://beensoft.blogspot.com/2009/04/exploring-test-driven-development.html" target="_blank"&gt;Test Driven Devleopment&lt;/a&gt; and that software design method drives you towards better, testable, design, and &lt;a href="http://en.wikipedia.org/wiki/Domain-driven_design" target="_blank"&gt;Domain Driven Design&lt;/a&gt; seems to being just doing that.    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Back to book&lt;/strong&gt;    &lt;br /&gt;When you order a book about Design Patterns you expect it to be more a reference then a complete read, because the stuff looks to be boring ('dry stuff' as we say here), without trying it out.    &lt;br /&gt;In this book however the author takes you on a journey of &lt;strong&gt;software architecture&lt;/strong&gt;, &lt;strong&gt;design&lt;/strong&gt; and &lt;strong&gt;decisions&lt;/strong&gt;. The book gives lots of &amp;quot;&lt;strong&gt;Aha!&lt;/strong&gt;&amp;quot;, &amp;quot;&lt;strong&gt;Huh?&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;strong&gt;Done that&lt;/strong&gt;&amp;quot; moments which, I guess, keeps you awake.    &lt;br /&gt;It is loaded with lots of solutions for particular (recognizable) software problems, not just pushing Design Patterns, but making you think more about the right solutions, which &lt;strong&gt;always depends&lt;/strong&gt;....&lt;/p&gt;  &lt;p&gt;In just three days I have read half of the book already! For me that is rare.   &lt;br /&gt;    &lt;br /&gt;So if you are interested in better software design I can highly recommend this book, it reads like a breeze!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-8836324858615334692?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/8836324858615334692/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=8836324858615334692" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/8836324858615334692" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/8836324858615334692" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/05/applying-domain-driven-design-book.html" title="Applying Domain-Driven Design - Book review" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-1787692579740273318</id><published>2009-04-24T12:39:00.001-07:00</published><updated>2009-04-24T12:45:43.882-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><category scheme="http://www.blogger.com/atom/ns#" term="TDD" /><title type="text">Exploring Test Driven Development</title><content type="html">&lt;p&gt;A few weeks ago I attended a software event organized by the dutch &lt;a href="http://www.sdn.nl" target="_blank"&gt;Software Developer Network&lt;/a&gt; SDN. This time I followed a few sessions about &lt;a href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank"&gt;Test Driven Development&lt;/a&gt; presented by (among others) &lt;a href="http://www.alexthissen.nl/blogs/main/" target="_blank"&gt;Alex Thissen&lt;/a&gt;, &lt;a href="http://blogs.oosterkamp.nl/blogs/thomas/" target="_blank"&gt;Thomas Huijer&lt;/a&gt; and &lt;a href="http://www.dennisdoomen.net" target="_blank"&gt;Dennis Doomen&lt;/a&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;I must admit that before this sessions I was convinced that automated unit testing was a plus, but it would take just too much time (at least that is what I thought) so that I never actually used it. Triggered by this sessions I started to explore TDD and slowly but surely I am convinced by its pros.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;So what is it?&lt;/strong&gt;     &lt;br /&gt;TDD is not strictly about testing, but it is a &lt;a href="http://en.wikipedia.org/wiki/Software_engineering" target="_blank"&gt;software design method&lt;/a&gt; build upon testing. Check the &lt;a href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank"&gt;TDD wiki&lt;/a&gt; for all the details, but basically it drills down to the following:     &lt;br /&gt;    &lt;br /&gt;Every new feature in an application &lt;strong&gt;starts with building a test&lt;/strong&gt; around one unit of code (a method or property), because of the fact that the real feature is not yet written that test will fail. After making the test you write the actual method which correctness can be checked by running the test.     &lt;br /&gt;&lt;strong&gt;Kind of strange huh?&lt;/strong&gt; First test, then code. But when you think about it a little more it is a great way to improve your code quality.&lt;/p&gt;  &lt;p&gt;Consider the following:    &lt;br /&gt;- By building a test you are triggered to think more about the &lt;strong&gt;specifications&lt;/strong&gt;, heck by building the test you 'persist' the specifications in your code. (If specification changes, the test changes)    &lt;br /&gt;- It doesn't matter who writes the actual method, as long as the test fails he/she did not comply to the specifications.     &lt;br /&gt;- New features and specifications, which leads to refactoring your code, will be checked against your tests. If the test passes you will be fine.     &lt;br /&gt;In fact in TDD you will first change/refactor your test before refactoring the real code.     &lt;br /&gt;- You will try to keep test as small as possible, thus making smaller methods in your applications, thus making it less complex.    &lt;br /&gt;Less complex means more maintainable in the future. (Less time/costs)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;&amp;#8220;I don't care how good you think your design is. If I can't walk in and write a test for an arbitrary method of yours in five minutes its not as good as you think it is, and whether you know it or not, you're paying a price for it.&amp;#8221;       &lt;br /&gt;&lt;a href="http://www.michaelfeathers.com/" target="_blank"&gt;Michael Feathers&lt;/a&gt;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Testing in Visual Studio&lt;/strong&gt;     &lt;br /&gt;Visual Studio 2008 now offers unit testing. You can add a test project in your solution that refers your application/code library.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Making a first TDD application&lt;/strong&gt;&amp;#160; &lt;br /&gt;Suppose we have some class Calculator with methods like Add, Divide etcetera.     &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Step 1&lt;/strong&gt;     &lt;br /&gt;Create two test methods for the Add and Divide methods. A test method's result is stated by either an Assert, or an expected Exception:&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:ca91995b-5382-4a34-bf31-811e79bd7c87" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;[TestMethod]&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; Add()&lt;br /&gt;    {&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int2 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;3&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Result &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; calculator.Add(Int1, Int2);&lt;br /&gt;      Assert.AreEqual(&lt;/span&gt;&lt;span style="color: #800080;"&gt;5&lt;/span&gt;&lt;span style="color: #000000;"&gt;, Result); &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    [TestMethod]&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; Divide()&lt;br /&gt;    {&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;6&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int2 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;3&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;double&lt;/span&gt;&lt;span style="color: #000000;"&gt; Result &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; calculator.Divide(Int1, Int2);&lt;br /&gt;      Assert.AreEqual(&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;, Result); &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    [TestMethod]&lt;br /&gt;    [ExpectedException(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;typeof&lt;/span&gt;&lt;span style="color: #000000;"&gt;(DivideByZeroException))]&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; DivideByZero()&lt;br /&gt;    {&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;6&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int2 &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;double&lt;/span&gt;&lt;span style="color: #000000;"&gt; Result &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; calculator.Divide(Int1, Int2);&lt;br /&gt;    }&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;In the test unit we created our Calculator class which we will test. Of course without the actual code this will not compile, so we create the initial method stubs, which will throw a not implemented exception.&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt; &lt;br /&gt;Run the tests. No supprise they will fail. &lt;br /&gt;  &lt;br /&gt;&lt;strong&gt;Step 3&lt;/strong&gt; &lt;br /&gt;Write the real methods: &lt;br /&gt;  &lt;/p&gt;&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:5c4a7003-9271-4c95-a4d4-8e1e1fbe41bf" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Add(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int1, &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int2)&lt;br /&gt;    {&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int2;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;double&lt;/span&gt;&lt;span style="color: #000000;"&gt; Divide(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int1, &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int2)&lt;br /&gt;    {&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int1 &lt;/span&gt;&lt;span style="color: #000000;"&gt;/&lt;/span&gt;&lt;span style="color: #000000;"&gt; Int2;&lt;br /&gt;    }&lt;br /&gt;  }&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;&lt;strong&gt;Step 4 &lt;br /&gt;&lt;/strong&gt;Run the test. They succeed! Because the not so well choosen parameter names you could easily mismatch them in the method Divide, but your test will check for that! &lt;br /&gt;&lt;p&gt;&lt;strong&gt;What is next? &lt;br /&gt;&lt;/strong&gt;This example is rather simple. Complex codes, with for example database interaction will require some more coding for which you will write &lt;strong&gt;fakes and mocks&lt;/strong&gt;. I will explore them in another post. &lt;br /&gt;  &lt;br /&gt;&lt;strong&gt;Conclusion &lt;br /&gt;&lt;/strong&gt;Although you might think that Test Driven Development takes a lot time in the process I am convinced (now) that it will pay back further on in the development process. Beside that it will boost the quality of your code and give you a base to safely refactor it in the future. &lt;br /&gt;  &lt;br /&gt;The examples where build in C#. I am not sure if this works in Delphi Prism as well, but I expect that it does. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-1787692579740273318?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/1787692579740273318/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=1787692579740273318" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/1787692579740273318" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/1787692579740273318" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/04/exploring-test-driven-development.html" title="Exploring Test Driven Development" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-3633965277568904786</id><published>2009-04-18T10:16:00.000-07:00</published><updated>2009-04-18T10:26:36.848-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="free" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><title type="text">Free ebook: Illustrated C# 2008</title><content type="html">Found this really BIG (20mb) free e-book on C#: &lt;strong&gt;&lt;a href="http://www.red-gate.com/products/ants_profiler/boost_app_performance_ebook5.htm?utm_source=cp"&gt;Illustrated C# 2008&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;It has more then 700 pages, so I guess it covers all about C# and .NET development.&lt;br /&gt;&lt;br /&gt;Quote about the book:&lt;br /&gt;&lt;em&gt;If you're a C++ or VB programmer migrating to C# 2008, &lt;/em&gt; &lt;strong&gt;Added&lt;/strong&gt; :(or a Delphi developer doing .NET development either in &lt;strong&gt;Delphi Prism&lt;/strong&gt; or C#) &lt;em&gt;this book is well worth reading. The author, Daniel Solis offers a very visual approach – with lots of figures, diagrams and code samples – that will help you get to work with C# fast. &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Because the lack of Delphi Prism books, I always find myself ending up with C# examples, which, of course, can be translated to Delphi Prism syntax easily.&lt;br /&gt;&lt;br /&gt;Enjoy it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-3633965277568904786?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/3633965277568904786/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=3633965277568904786" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/3633965277568904786" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/3633965277568904786" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/04/free-book-illustrated-c-2008.html" title="Free ebook: Illustrated C# 2008" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-8779541425159652628</id><published>2009-04-08T04:28:00.001-07:00</published><updated>2009-04-08T04:28:11.561-07:00</updated><title type="text">CodeRush, when code smells...</title><content type="html">&lt;p&gt;At the beginning of this month &lt;a href="http://www.devexpress.com/" target="_blank"&gt;Devexpress&lt;/a&gt; released &lt;a href="http://www.devexpress.com/Products/NET/DXperience/WhatsNew2009v1/" target="_blank"&gt;the new version&lt;/a&gt; of their DXPerience products for .NET (Version 2009.1)    &lt;br /&gt;With the release of this components they also released a new version of their coding assisting tool &lt;a href="http://www.devexpress.com/Products/NET/DXperience/WhatsNew2009v1/index.xml?page=7#autolist16" target="_blank"&gt;CodeRush and Refactor Pro&lt;/a&gt;.     &lt;br /&gt;We use CodeRush for a couple of years now in Visual Studio for our C# work. Strange enough this new version somehow managed to trigger the &amp;quot;&lt;strong&gt;wow&lt;/strong&gt;&amp;quot; factor once again.    &lt;br /&gt;I will not explain every new feature here, (You will find some resources at the end of this post) but one that is &lt;strong&gt;awesome&lt;/strong&gt; in particular is &lt;strong&gt;Code Issues&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Code Issues feature&lt;/strong&gt; analyses your source code while your are working in your code. It gives you hints for &lt;strong&gt;Unused namespace references&lt;/strong&gt;, &lt;strong&gt;unused methods&lt;/strong&gt;, &lt;strong&gt;undisposed local vars&lt;/strong&gt; etc, etc.     &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;How does it work?&lt;/strong&gt;    &lt;br /&gt;Hints appear in a bar near the scrollbar of the editor when you hover the mouse over the colored lines (each color is a hint category):    &lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_33FNQ5v3xjo/SdyKRSvnwLI/AAAAAAAAAHk/QGhLXNSHxD0/s1600-h/cr2%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="157" alt="Code Smell" src="http://lh5.ggpht.com/_33FNQ5v3xjo/SdyKR8admqI/AAAAAAAAAHo/8Kt0RwFz2yg/cr2_thumb%5B1%5D.jpg?imgmax=800" width="302" border="0" /&gt;&lt;/a&gt;&amp;#160;&amp;#160; &lt;br /&gt;In this particular example, which seems to be extracted from some farmer application ;-), Coderush hints that a line of code where two strings are concatenated, could be refactored using string.format.    &lt;br /&gt;    &lt;br /&gt;When you hover the code line, it shows you what you could do to improve your code: (or make it smell better)&lt;a href="http://lh4.ggpht.com/_33FNQ5v3xjo/SdyKSBerIxI/AAAAAAAAAHs/eSvuzHTr7ug/s1600-h/cr1%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="139" alt="cr1" src="http://lh3.ggpht.com/_33FNQ5v3xjo/SdyKSkfcdEI/AAAAAAAAAHw/GmZeStnw1o8/cr1_thumb%5B1%5D.jpg?imgmax=800" width="402" border="0" /&gt;&lt;/a&gt;     &lt;br /&gt;This is really &lt;strong&gt;an impressive cool feature&lt;/strong&gt;, that will boost the quality of your code.    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Delphi Prism     &lt;br /&gt;&lt;/strong&gt;Unfortunately CodeRush only supports &lt;strong&gt;C#&lt;/strong&gt; and &lt;strong&gt;VB.NET&lt;/strong&gt; at this moment. It would be very nice if CodeRush &lt;a href="http://beensoft.blogspot.com/2008/11/devexpress-will-support-delphi-prism.html" target="_blank"&gt;would support Delphi Prism&lt;/a&gt; as well.     &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;    &lt;br /&gt;Beside the fact that CodeRush helps you to boost your productivity with lots of code templates, it also helps you to track code smells and refactor them out of your software which will eventualy increase the quality of it.    &lt;br /&gt;    &lt;br /&gt;You can find more resources on CodeRush here:    &lt;br /&gt;&lt;a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/" target="_blank"&gt;The Devexpress website&lt;/a&gt;    &lt;br /&gt;Mark Miller blog post &amp;quot;&lt;a href="http://community.devexpress.com/blogs/markmiller/archive/2009/04/01/what-s-new-in-coderush-amp-refactor-pro-9-1.aspx" target="_blank"&gt;What's new in CodeRush &amp;amp; Refactor Pro&lt;/a&gt;&amp;quot;    &lt;br /&gt;&lt;a href="http://rorybecker.blogspot.com/2009/03/coderush-and-refactor-910-beta.html" target="_blank"&gt;This blogpost by Rory Becker&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-8779541425159652628?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/8779541425159652628/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=8779541425159652628" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/8779541425159652628" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/8779541425159652628" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/04/coderush-when-code-smells.html" title="CodeRush, when code smells..." /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-8666957275802234620</id><published>2009-03-12T00:59:00.001-07:00</published><updated>2009-03-12T04:03:48.298-07:00</updated><title type="text">New release for Delphi Prism</title><content type="html">&lt;p&gt;There is a new release of Delphi Prism available, according &lt;a href="http://edn.embarcadero.com/article/39408" target="_blank"&gt;this edn article&lt;/a&gt;. The &lt;strong&gt;Delphi Prism February 2009 release&lt;/strong&gt; (Build 3.0.17.591) as it is called (Wasn't it already March? ;-) ) contains the following &lt;a href="http://prismwiki.codegear.com/en/Changes_and_Known_Issues#Changes_and_Resolved__Issues_in_Build_3.0.17.591%22" target="_blank"&gt;changes&lt;/a&gt;. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-8666957275802234620?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/8666957275802234620/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=8666957275802234620" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/8666957275802234620" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/8666957275802234620" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/03/new-release-for-delphi-prism.html" title="New release for Delphi Prism" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-3187098808457453412</id><published>2009-01-07T02:33:00.001-08:00</published><updated>2009-01-07T02:37:13.616-08:00</updated><title type="text">TIOBE language of the year not Delphi</title><content type="html">&lt;p&gt;In october Jim Mckeeth &lt;a href="http://www.delphi.org/2008/10/delphi-language-of-the-year-2008/" target="_blank"&gt;reported&lt;/a&gt; that Delphi could well be the language of the year in the &lt;a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html" target="_blank"&gt;TIOBE Community language index&lt;/a&gt;.    &lt;br /&gt;Unfortunately this has not happened despite the efforts of the Delphi community putting &amp;quot;Delphi programming&amp;quot; on webpages.    &lt;br /&gt;    &lt;br /&gt;In &lt;a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html" target="_blank"&gt;january&lt;/a&gt; Delphi is fallen slightly one place back to position 10. (Nothing to worry about). Remarkable is that Pascal went up 3 places compared with last year, now holding the 15th position. I predict that Pascal will become the language of the year 2009! ;-)&lt;/p&gt;  &lt;p&gt;Language of the year 2008: C&lt;/p&gt;  &lt;p&gt;For what it is worth........   &lt;br /&gt;    &lt;br /&gt;What is your prediction?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-3187098808457453412?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/3187098808457453412/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=3187098808457453412" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/3187098808457453412" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/3187098808457453412" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/01/tiobe-language-of-year-not-delphi.html" title="TIOBE language of the year not Delphi" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-4059008698280608068</id><published>2009-01-06T12:41:00.001-08:00</published><updated>2009-01-06T12:42:15.162-08:00</updated><title type="text">LINQ with Delphi Prism #2 : Deferred Execution</title><content type="html">&lt;p&gt;As said in &lt;a href="http://beensoft.blogspot.com/2009/01/linq-with-delphi-prism-1-sequences.html" target="_blank"&gt;this previous post&lt;/a&gt; Delphi Prism supports LINQ all the way so all the LINQ feature just work in Delphi Prism.     &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Deferred Execution      &lt;br /&gt;&lt;/strong&gt;One of the key features of LINQ is &lt;strong&gt;Deferred Execution&lt;/strong&gt;. That means that a LINQ query does not execute until data is demanded, for except by an iteration through a list. This makes it possible to make a complex query without execution each part of the query seperately.     &lt;br /&gt;    &lt;br /&gt;However, there is one exceptions to the rule, a LINQ query &lt;strong&gt;executes immediately&lt;/strong&gt; when you use a function that must iterate over the list for its result like, for example &lt;strong&gt;Sum(), Count(), ToList()&lt;/strong&gt; etc.     &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:691b3a09-5fed-441d-a173-7049265a41cf" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Example of deferred execution or lazy execution&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;-------------------------------------------&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; Numbers :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; new List&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;integer&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  Numbers.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; DoubledList : sequence &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;of&lt;/span&gt;&lt;span style="color: #000000;"&gt; integer &lt;br /&gt;                      :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; Numbers.Select(n&lt;/span&gt;&lt;span style="color: #000000;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;n&lt;/span&gt;&lt;span style="color: #000000;"&gt;*&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Query not yet executed!&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Add another number to the list&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  Numbers.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;  &lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;At this point query is executed&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Result &amp;quot;2--4&amp;quot;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; i : Integer &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; DoubledList &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;      Result :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; Result &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; i.ToString &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;--&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  MessageBox.Show(Result);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Example of direct execution&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;-------------------------------------------&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; Numbers :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; new List&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;integer&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  Numbers.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;  Numbers.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Query executed here&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; Sum :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; (Numbers.Select(n&lt;/span&gt;&lt;span style="color: #000000;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;n&lt;/span&gt;&lt;span style="color: #000000;"&gt;*&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;)).Sum();&lt;br /&gt;  Numbers.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;3&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;  Numbers.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;4&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Would expect 20, but result is only 6&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  MessageBox.Show(Sum.ToString);    &lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-4059008698280608068?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/4059008698280608068/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=4059008698280608068" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/4059008698280608068" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/4059008698280608068" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/01/linq-with-delphi-prism-2-deferred.html" title="LINQ with Delphi Prism #2 : Deferred Execution" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-6932688402384221632</id><published>2009-01-05T12:40:00.001-08:00</published><updated>2009-01-05T12:56:30.120-08:00</updated><title type="text">LINQ with Delphi Prism #1 : Sequences</title><content type="html">&lt;p&gt;I have been digging into LINQ this christmas. LINQ is a cool way to query data, whether it is an &lt;strong&gt;array&lt;/strong&gt;, a &lt;strong&gt;list&lt;/strong&gt; or a &lt;strong&gt;remote datasource&lt;/strong&gt;.     &lt;br /&gt;LINQ is a new feature of &lt;strong&gt;C# 3.0&lt;/strong&gt; that comes with Visual Studio 2008, but guess what, &lt;a href="http://www.codegear.com/products/delphi/prism" target="_blank"&gt;Delphi Prism&lt;/a&gt;, also supports LINQ all the way. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;If you want to play/test LINQ queries syntax you can download and install &lt;a href="http://www.linqpad.net/"&gt;LinqPad&lt;/a&gt;, a free tool to use LINQ querys against a SQL Server database. (You could drop Management Studio for that). &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The only disadvantage I found (IMO) on LINQ so far is that quering remote datasources is bound to Microsoft SQL Server database. (Maybe this will be extended in the future)   &lt;br /&gt;That involves, the so called &amp;quot;&lt;strong&gt;LINQ to SQL&lt;/strong&gt;&amp;quot; methods, which is, I believe, allready deprecated. &lt;/p&gt;  &lt;p&gt;As said before &lt;strong&gt;Delphi Prism completely supports LINQ&lt;/strong&gt;. Starting a 3.5 framework application will give you a reference to &lt;strong&gt;System.Linq&lt;/strong&gt;, the namespace, where LINQ lives.&lt;/p&gt;  &lt;p&gt;In this series I will explore LINQ using Delphi Prism: &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1. Using LINQ on a sequence&lt;/strong&gt;     &lt;br /&gt;LINQ, in Delphi Prism, works on so called &lt;strong&gt;sequences&lt;/strong&gt;, which is a new type described in the &lt;a href="http://prismwiki.codegear.com/"&gt;Delphi Prism Wiki&lt;/a&gt; as: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Sequences are a special type in the language and can be thought of as a collection of elements, similar to an array. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Declare a sequence like this: &lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:ea535058-4b9e-4e7c-a499-99eb8a282a13" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; width: 437px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  Names : sequence &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;of&lt;/span&gt;&lt;span style="color: #000000;"&gt; String :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;br /&gt;     [&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Mickey&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Dick&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Roland&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Delphi&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Harry&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;];&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;With LINQ it is very easy to query a collection, like this sequence. You can do this in two ways, namely: &lt;br /&gt;1.&lt;strong&gt; Using Lambda expressions&lt;/strong&gt; &lt;br /&gt;2. &lt;strong&gt;Using query comprehension syntax&lt;/strong&gt; (Query Syntax)&lt;/p&gt;&lt;br /&gt;&lt;p&gt;With &lt;a href="http://prismwiki.codegear.com/en/Lambda_Expressions" target="_blank"&gt;Lambda expressions&lt;/a&gt; you can write rather small expressions to query the data, with the &lt;a href="http://prismwiki.codegear.com/en/Query_Expressions" target="_blank"&gt;query syntax&lt;/a&gt; they become more readable (read less magic ;-)). &lt;br /&gt;By the way the compiler (at least in C#) will translate the query syntax into lambda expressions. Both techniques are complementary. (I think the Oxygene compiler also does this....)&lt;/p&gt; &lt;br /&gt;&lt;p&gt;Suppose we want to have all the names from our sequence which have more then 4 characters, containing an &amp;quot;a&amp;quot; and sorted in upper case. &lt;/p&gt;&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:bc14fc14-f145-48df-98ef-fc5d929aea21" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Using Lambda syntax&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; FilteredNames :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; Names&lt;br /&gt;                       .Where (n &lt;/span&gt;&lt;span style="color: #000000;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; (n.Length &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;4&lt;/span&gt;&lt;span style="color: #000000;"&gt;) &lt;br /&gt;                              &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;and&lt;/span&gt;&lt;span style="color: #000000;"&gt; n.Contains(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;a&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;))&lt;br /&gt;                       .OrderBy (n &lt;/span&gt;&lt;span style="color: #000000;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; n)&lt;br /&gt;                       .Select (n &lt;/span&gt;&lt;span style="color: #000000;"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; n.ToUpper());&lt;br /&gt;                               &lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Using query comprehension syntax&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt; FilteredNames :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; from n &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; Names&lt;br /&gt;                       where ((n.Length &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;4&lt;/span&gt;&lt;span style="color: #000000;"&gt;) &lt;br /&gt;                               &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;and&lt;/span&gt;&lt;span style="color: #000000;"&gt; n.Contains(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;a&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;))&lt;br /&gt;                       order by n&lt;br /&gt;                       select n.ToUpper;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Note we don't have to declare FilteredNames&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Iterate through the filterednames to show them in a messagebox:&lt;br /&gt;  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:1775656e-5886-41e6-8c6d-2f60f60d7562" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; s : string &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; FilteredNames &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;     FilteredOnes :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; FilteredOnes &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; s &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; &amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;--&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;quot; &lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;br /&gt;  MessageBox.Show(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;FilteredOnes: &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; FilteredOnes) &lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Note that the original collection, Names in this case, is still holding all the elements.&lt;/br&gt;&lt;br /&gt;Conclusion LINQ is a, in basic, simple way to query collections the SQL way. Delphi Prism supports them complete. Choosing Lambda expression or Query syntax will be mostly a personal preference.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-6932688402384221632?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/6932688402384221632/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=6932688402384221632" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/6932688402384221632" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/6932688402384221632" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2009/01/linq-with-delphi-prism-1-sequences.html" title="LINQ with Delphi Prism #1 : Sequences" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-7573216336364559310</id><published>2008-11-20T05:24:00.001-08:00</published><updated>2008-11-20T05:24:43.946-08:00</updated><title type="text">DevExpress will support Delphi Prism</title><content type="html">&lt;p&gt;Now that Delphi for .NET (now Delphi Prism) has become a Visual Studio plugin it is possible to use all the .NET components out there.   &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://www.devexpress.com" target="_blank"&gt;DevExpress&lt;/a&gt;, which btw started as a Delphi shop, has a great component set called &lt;a href="http://www.devexpress.com/Products/NET/DXperience/" target="_blank"&gt;DXperience&lt;/a&gt; for ASP.NET and Winforms development. Until now they only supported the Visual Studio IDE's.    &lt;br /&gt;You could use this components also in Delphi for .NET however they were not officialy supported. (No installation and technical support)&lt;/p&gt;  &lt;p&gt;According to &lt;a href="http://community.devexpress.com/blogs/ctodx/archive/2008/11/19/dxperience-and-delphi-prism.aspx" target="_blank"&gt;this blogpost&lt;/a&gt; by Julian Bucknall the CTO of DevExpress, it looks like they will &lt;strong&gt;support Delphi Prism in the official sense of the word&lt;/strong&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The story is that we shall be supporting Delphi Prism with DXperience and we're evaluating what we need to do to make that work. As it happens: not very much -- it installs just fine and, on first blush, seems to work just fine. There are more exhaustive tests to complete, obviously.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Of course this is not an official statement......&lt;/p&gt;  &lt;p&gt;We use the DXPerience components daily in our C# projects, and they are just great. We feel that Visual Studio with C#/VB.NET/Delphi Prism + DXPerience gives the developer the same power as Delphi for Win32 as we know it for so long. (For Winforms developement).&lt;/p&gt;  &lt;p&gt; In my opinion this is great step for Delphi Prism in the .NET world. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-7573216336364559310?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/7573216336364559310/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=7573216336364559310" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/7573216336364559310" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/7573216336364559310" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/11/devexpress-will-support-delphi-prism.html" title="DevExpress will support Delphi Prism" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-6012061352085745682</id><published>2008-10-27T12:14:00.000-07:00</published><updated>2008-10-27T14:12:36.565-07:00</updated><title type="text">Delphi Prism, some first thoughts</title><content type="html">Delphi Prism is announced in &lt;a href="http://www.codegear.com/products/delphi/prism"&gt;this Embarcadero press release&lt;/a&gt;. Delphi Prism is based on Oxygene from &lt;a href="http://www.remobjects.com"&gt;Remobjects&lt;/a&gt;, so I think you could say &lt;a href="http://www.codegear.com/products/delphi/prism"&gt;Delphi Prism &lt;/a&gt;is Remobject's &lt;a href="http://www.remobjects.com/oxygene.aspx"&gt;Oxygene&lt;/a&gt;. Read &lt;a href="http://www.remobjects.com/oxygene.aspx"&gt;Remobjects press release here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Added: &lt;a href="http://www.bitwisemag.com/2/Delphi-Prism-Visual-Studio-Pascal"&gt;Interview with marc hoffman&lt;/a&gt;, Chief Architect at Remobjects on Bitwise Magazine.&lt;br /&gt;&lt;br /&gt;After five years of several solutions and directions, it looks like Delphi for .NET has finally found a good home.&lt;br /&gt;&lt;br /&gt;Although Delphi .NET only exists for only about four years, there have been a lot of changes in the strategy executed by Borland, Borland/CodeGear and now Embarcadero. So let's take a brief look at the Delphi for .NET history:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2004 - Delphi 8 (Borland)&lt;/strong&gt;&lt;br /&gt;Delphi for .NET is born for the .NET Framework version 1.1. Delphi for .NET is positioned as a &lt;strong&gt;first class .NET citizen&lt;/strong&gt;. It offers .NET 1.1 development for Winforms, ASP.NET and VCL.NET, which is the .NET variant of the VCL, offering a highly compatible framework based on .NET.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2005 - Delphi 2005 (Borland)&lt;/strong&gt;&lt;br /&gt;Delphi 2005 offers the same as Delphi 8 but Delphi 2005 has a lot improvements in quality.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2006 - Delphi 2006 (Borland)&lt;/strong&gt;&lt;br /&gt;Delphi 2006 still has support for the .NET Framework 1.1 (Winforms, ASP.NET and VCL.NET) Delphi 2006 offers a stable IDE for this developments. The fact that it does not support .NET 2.0 shows the trouble that Borland had to keep up with Microsoft.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2007 - Delphi 2007 (CodeGear/Borland)&lt;/strong&gt;&lt;br /&gt;Delphi 2007 finally supports .NET 2.0, but unfortunately &lt;a href="http://beensoft.blogspot.com/2007/06/codegear-to-drop-winforms-designer-in.html"&gt;the Winforms support is dropped&lt;/a&gt;. (Only ASP.NET and VCL.NET is supported)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2008 - Delphi 2008 (Embarcadero)&lt;/strong&gt;&lt;br /&gt;Delphi 2009 has become a Visual Studio Plugin based on Oxygene (formely known as Chrome) offering support for all available Microsoft .NET technology's (2.0, 3.0, 3.5))&lt;br /&gt;Unfortunately it looks like VCL.NET is dropped.&lt;br /&gt;&lt;br /&gt;It is not likely that the Delphi for .NET product strategy will be nominated for best executed product strategy ever. &lt;g&gt;&lt;br /&gt;&lt;br /&gt;However this is a &lt;strong&gt;very strong sign &lt;/strong&gt;of the new spirit that Embarcadero is bringing to Delphi. It proofs that &lt;strong&gt;the buyout by Embarcadero is the best thing &lt;/strong&gt;that happened to Delphi (and of course CodeGear) in the last five years.&lt;br /&gt;&lt;br /&gt;Back to Delphi Prism:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Delphi Prism the pros&lt;/strong&gt;&lt;br /&gt;1. Instant support for all Microsoft .NET technologies.&lt;br /&gt;2. The Delphi language is now at same level as C#, VB.NET, so the choice for the Delphi language can be made much easier. (Hack it is the same IDE)&lt;br /&gt;3. Delphi for Win32 can focus on Win32 again, will not be hold back by .NET technologies.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Delphi Prism the cons&lt;/strong&gt;&lt;br /&gt;1. Less compatibilty with Delphi Win32 technologies, due to pure .NET and languages changes/additions. (Compared to VCL-VCL.NET, VCL-Winforms)&lt;br /&gt;2. After Winforms, now VCL.NET dropped, and that will not please every body.&lt;br /&gt;&lt;br /&gt;All with all the pros weigh more than the cons in my opinion.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why use Delphi Prism?&lt;/strong&gt;&lt;br /&gt;This question is not answered easily. I think a lot of Delphi developers went for C# in the last four years. For example we decided in 2007 to standarize our .NET development on Visual Studio C# due to the dropping of Winforms in Delphi 2007 (Basicaly due to the mixed/confusing messages by Borland).  &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br /&gt;Although we don't know all the ins and outs yet (sure will hear a lot more the coming week) this is by far the best thing ever that happened to Delphi for .NET.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-6012061352085745682?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/6012061352085745682/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=6012061352085745682" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/6012061352085745682" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/6012061352085745682" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/10/delphi-prism-some-first-thoughts.html" title="Delphi Prism, some first thoughts" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-7322927454563694077</id><published>2008-10-22T00:00:00.001-07:00</published><updated>2008-10-22T03:14:48.699-07:00</updated><title type="text">Exploring anonymous methods</title><content type="html">&lt;p&gt;New in Delphi 2009 are anonymous methods. Anonymous methods are methods without a name, which are able to do something on local variables where they are implemented. In fact they are &lt;strong&gt;a reference to a method&lt;/strong&gt;.    &lt;br /&gt;Anonymous methods are a &lt;strong&gt;bit magic&lt;/strong&gt;, at least they were to me, and hard to explain.    &lt;br /&gt;A nice place to use them is together with generics types. For instance the Sort method of a &lt;a href="http://beensoft.blogspot.com/2008/09/simple-generic-list-tlist.html"&gt;TList&amp;lt;T&amp;gt;&lt;/a&gt; is &lt;strong&gt;a natural place&lt;/strong&gt; to use them: &lt;/p&gt;&lt;p&gt;&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:e2de5690-92c7-4bf1-a7f3-fb5d9bde112a" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #000000;"&gt;  PersonsList.Sort(TComparer&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Construct(&lt;br /&gt;     &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;const&lt;/span&gt;&lt;span style="color: #000000;"&gt; Item1, Item2: TPerson): Integer&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;         Result :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; CompareText(Item1.LastName, &lt;br /&gt;                            Item2.LastName);&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;A cool thing about anonymous methods is that &lt;strong&gt;it can execute your code (incl. local vars) in another place&lt;/strong&gt;. This can be &lt;strong&gt;another unit&lt;/strong&gt; or even &lt;strong&gt;another thread&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;Implementing them in your daily code however is another thing. How to do that? Well here are &lt;strong&gt;my first explorations&lt;/strong&gt;: Let's say we have this simple application that has a TStringList where we want to do some searching on the strings, based on the users input. I came up with this:&lt;/p&gt;&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:70517719-f929-4c70-a9d6-fd0c6fe497af" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Declaration of the anon reference &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;The passed string will be searched on&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;type&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;   TAnonStrProc &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;br /&gt;       reference &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;to&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(s : string) : Integer;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Implement a method to execute &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;1. Ask a string to search&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;2. Execute the referenced method &amp;quot;proc&amp;quot;&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt; TForm4.FindString(proc: TAnonStrProc)&lt;br /&gt;                             : Integer;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  SearchStr : string;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  Result :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;-&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; InputQuery(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Search&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Search a string&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;br /&gt;                 SearchStr) &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;then&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    Result :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; proc(SearchStr);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Create a string list&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;procedure&lt;/span&gt;&lt;span style="color: #000000;"&gt; TForm4.Button1Click(Sender: TObject);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  sla : TStrings;&lt;br /&gt;  i,j : Integer;&lt;br /&gt;  Index, Count : integer;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  sla :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; TStringList.Create;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;try&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;   sla.Add(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;One&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;   sla.Add(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Two&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;   sla.Add(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Three&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;   sla.Add(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Two&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Call the FindString method with anon method&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;to get the index of string in the list&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Note that it does someting with our local&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;variable sla&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;   Index :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; FindString(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(s : string) : Integer&lt;br /&gt;                       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;                         Result :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; sla.IndexOf(s);&lt;br /&gt;                       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;   ShowMessage(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Index: &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; IntToStr(Index));&lt;br /&gt; &lt;br /&gt;   &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Call the FindString method with anon method&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;to get the count of a searched string&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;   Count :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; FindString(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(s : string) : Integer&lt;br /&gt;                       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;                         str : string;&lt;br /&gt;                         i : integer;&lt;br /&gt;                       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;                         Result :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;                         &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; str &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; sla &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;                           &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; str &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; s &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;then&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;                             Inc(Result);&lt;br /&gt;                         &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;                       &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;br /&gt;   ShowMessage(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Count: &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; IntToStr(Count));&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;finally&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;   sla.Free;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Please note that this example probably &lt;strong&gt;won't make it in the daily code&lt;/strong&gt;, but it shows in a simple manner how they work. Because of the fact that our anonymouse method can take any method as long that it has a string as parameter you can call one method FindString with different implementations by passing different methods.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Well I think anonymous methods are cool. Implement them in your daily code wisely is not that simple. The working however, which seems magic at first, is after some exploring not that hard to follow.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-7322927454563694077?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/7322927454563694077/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=7322927454563694077" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/7322927454563694077" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/7322927454563694077" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/10/exploring-anonymous-methods.html" title="Exploring anonymous methods" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-7520888137387162452</id><published>2008-10-20T23:52:00.001-07:00</published><updated>2008-10-20T23:52:09.283-07:00</updated><title type="text">Round the table Podcast@Delphi.org</title><content type="html">&lt;p&gt;&lt;a href="http://www.delphi.org/2008/10/episode-11-more-roundtable/"&gt;The 11th Episode&lt;/a&gt; on the &lt;a href="http://www.delphi.org/"&gt;the podcast @ delphi.org&lt;/a&gt; dicusses some interesting things like anonymous methods, Garbage Collection (&amp;quot;To Dispose() or not to Dispose() ) and the speed of the TStringbuilder.    &lt;br /&gt;    &lt;br /&gt;Great stuff! Enjoy!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-7520888137387162452?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/7520888137387162452/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=7520888137387162452" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/7520888137387162452" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/7520888137387162452" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/10/round-table-podcastdelphiorg.html" title="Round the table Podcast@Delphi.org" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-5641222420804724771</id><published>2008-10-06T12:40:00.000-07:00</published><updated>2008-10-06T13:08:35.947-07:00</updated><title type="text">Speculating on .NET plans #3</title><content type="html">Although there are not much details unveiled yet, &lt;a href="http://blogs.codegear.com/nickhodges/"&gt;Nick Hodges&lt;/a&gt; made some statements about a new CodeGear product/project/plan called &lt;strong&gt;Delphi Prism &lt;/strong&gt;at the SDN Conference in the Netherlands.&lt;br /&gt;&lt;a href="http://blog.marcocantu.com/"&gt;Marco Cantu&lt;/a&gt; was the first &lt;a href="http://blog.marcocantu.com/blog/nick_announces_delphi_prism.html"&gt;to blog about this statements&lt;/a&gt;, soon followed by &lt;a href="http://www.bobswart.nl/Weblog/Blog.aspx?RootId=5:2771"&gt;Bob Swart&lt;/a&gt;, and &lt;a href="http://www.itwriting.com/blog/954-prism-official-delphi-language-comes-to-visual-studio.html"&gt;Tim Anderson&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But no official statement yet! As it looks the official announcement will be made during the PDC Conference by the end of this month. (According to &lt;a href="http://blogs.codegear.com/abauer/2008/10/06/38874"&gt;Allen Bauer's blogpost&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;What we know now is that &lt;strong&gt;Delphi Prism &lt;/strong&gt;will be a Visual Studio plugin, which I think is great news. As you might know I speculated somewhat over the Delphi .NET (That was the former name of the product) roadmap in previous blogposts, &lt;a href="http://beensoft.blogspot.com/2008/08/speculating-on-net-plans-2.html"&gt;here&lt;/a&gt;(#2), &lt;a href="http://beensoft.blogspot.com/2008/08/tiburon-win32-only-speculating-on-net.html"&gt;here&lt;/a&gt; and &lt;a href="http://beensoft.blogspot.com/2008/07/return-of-winforms-in-delphi-for-net-or.html"&gt;here&lt;/a&gt;. Looks like my speculations were pretty accurate. :-P&lt;br /&gt;&lt;br /&gt;I guess this will be the end of the speculation part although there are much questions unanswered, which I am sure will be answered in the near future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-5641222420804724771?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/5641222420804724771/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=5641222420804724771" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/5641222420804724771" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/5641222420804724771" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/10/speculating-on-net-plans-3.html" title="Speculating on .NET plans #3" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-1854243426464703987</id><published>2008-09-30T03:27:00.001-07:00</published><updated>2008-09-30T03:30:56.917-07:00</updated><title type="text">A simple Generic Dictionary: TDictionary</title><content type="html">&lt;p&gt;A new generic type in Delphi 2009 is &lt;strong&gt;TDictionary&lt;/strong&gt;. TDictionary offers a way to store values based on a key into a list. TDictionary is declared as &lt;strong&gt;TDictionary&amp;lt;TKey, TValue&amp;gt;.&lt;/strong&gt;     &lt;br /&gt;TDictionary in fact is what a hashtable is in C#. It allows you to store/structure data based on any key type and any value type.     &lt;br /&gt;    &lt;br /&gt;Suppose we want to track our persons, from the &lt;a href="http://beensoft.blogspot.com/2008/09/simple-generic-list-tlist.html" target="_blank"&gt;previous blogpost&lt;/a&gt;, on their social security number, we could put them in TDictionary like this: (using a very simple social security number....)&lt;/p&gt;  &lt;p&gt;   &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:462564fc-76ee-431a-8970-9c84de016dc4" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;procedure&lt;/span&gt;&lt;span style="color: #000000;"&gt; TForm4.Button2Click(Sender: TObject);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  Dic : TDictionary&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Integer,TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  p : TPerson;&lt;br /&gt;  i : integer;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Create dictionary&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  Dic :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; TDictionary&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;Integer,TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Create;&lt;br /&gt;  Dic.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;, TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Delphi&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Mr&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  Dic.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;, TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Generic&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Bill&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  Dic.Add(&lt;/span&gt;&lt;span style="color: #800080;"&gt;3&lt;/span&gt;&lt;span style="color: #000000;"&gt;, TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;nonymous&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;An&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;try&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt; &lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Travel the strings&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; p &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; Dic.Values  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    ShowMessage(p.FullName);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt; &lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Travel the keys&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; i &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; Dic.Keys &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    ShowMessage(IntToStr(i) &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;: &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;br /&gt;                             Dic.Items[i].FullName);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt; &lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Find some key&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; Dic.TryGetValue(&lt;/span&gt;&lt;span style="color: #800080;"&gt;3&lt;/span&gt;&lt;span style="color: #000000;"&gt;, p) &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;then&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    ShowMessage(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Found it!: &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; p.FullName);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt; &lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;finally&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; p &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; Dic.Values &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;      p.Free;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Also free Values and KeyCollection&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;other wise you have a memoryleak&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Is this a bug?&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;    Dic.Values.Free;&lt;br /&gt;    Dic.Keys.Free;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Free the dictionary&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;    Dic.Free;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I noticed that if you free the Dictionary in above scenario you must also free the Values and Keys collection to avoid a memory leak. This looks like a bug to me. (Will investigate this further) &lt;br /&gt;  &lt;br /&gt;In this sample I used an integer type as the key value, so this has not much benefit compared to an array. You can however use &lt;strong&gt;any type&lt;/strong&gt; to be the key value!&lt;br /&gt;&lt;br /&gt;Because we can store any type, we can take this a step further and put a TList&amp;lt;T&amp;gt; in our Dictionary: &lt;br /&gt;&lt;br /&gt;Suppose we want to put our Personlist into a dictionary based on, let's say their gender. You could do that something like this: &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:b76cc00d-7510-4453-8b19-28af72934fb7" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;type&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  PersonKind &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; (pkMale, pkFemale);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;procedure&lt;/span&gt;&lt;span style="color: #000000;"&gt; TForm4.Button3Click(Sender: TObject);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  Dic : TDictionary&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;PersonKind,TList&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  MPersonsList : TList&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  FPersonsList : TList&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  pList : TList&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  p : TPerson;&lt;br /&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt; MPersonsList :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; TList&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Create;&lt;br /&gt; FPersonsList :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; TList&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Create;&lt;br /&gt; Dic :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; TDictionary&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;PersonKind,TList&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Create;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;try&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Fill male list&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  MPersonsList.Add(TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Delphi&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Mr&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  MPersonsList.Add(TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Generic&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Bill&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  MPersonsList.Add(TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Nymous&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Ano&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Fill female list&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  FPersonsList.Add(TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Delphi&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Mrs&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  FPersonsList.Add(TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Nymous&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Anna&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Add to dictionary&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  Dic.Add(pkMale, MPersonsList);&lt;br /&gt;  Dic.Add(pkFemale, FPersonsList);&lt;br /&gt;  &lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Travel&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; p &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; Dic[pkMale] &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    ShowMessage(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;This is a man: &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; p.FullName);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; p &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; Dic[pkFemale] &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    ShowMessage(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;This is a female: &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #000000;"&gt; p.FullName);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;finally&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Free Persons and Personlist&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; p &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; MPersonsList &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; p.Free;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; p &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; FPersonsList &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; p.Free;&lt;br /&gt;    MPersonsList.Free;&lt;br /&gt;    FPersonsList.Free;&lt;br /&gt; &lt;br /&gt;    Dic.Free;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;TDatadictionary is a &lt;strong&gt;very powerfull&lt;/strong&gt;, yet in basic &lt;strong&gt;easy to use&lt;/strong&gt;, generic type. It allows you to build simple, but also complex data structures. (What about a TDictionary with TDictionary's in it? ;-) ) &lt;br /&gt;&lt;br /&gt;Again a very nice language addition to Delphi!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-1854243426464703987?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/1854243426464703987/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=1854243426464703987" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/1854243426464703987" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/1854243426464703987" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/09/simple-generic-dictionary-tdictionary.html" title="A simple Generic Dictionary: TDictionary" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-4688201347656605302</id><published>2008-09-25T00:08:00.001-07:00</published><updated>2008-09-25T02:02:53.836-07:00</updated><title type="text">A simple Generic List: TList&lt;T&gt;</title><content type="html">&lt;p&gt;Delphi 2009 has support for generics, and has 'built in' generic types like TList, TArrays etc. If you want to use them you must add &lt;strong&gt;Generics.Collections&lt;/strong&gt; to your uses clause.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Generic List: TList      &lt;br /&gt;&lt;/strong&gt;Suppose we want a list with persons representing the TPerson class:     &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:6373bc24-ee90-4152-8723-7c97c646f509" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Our class TPerson&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;type&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  TPerson &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;   FFirstName : string;&lt;br /&gt;   FLastName : string;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt; GetFullName: string;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;published&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;constructor&lt;/span&gt;&lt;span style="color: #000000;"&gt; Create(ALastName : String; &lt;br /&gt;                            AFirstName : string);&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;property&lt;/span&gt;&lt;span style="color: #000000;"&gt; FirstName : string read FFirstName &lt;br /&gt;                             write FFirstName;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;property&lt;/span&gt;&lt;span style="color: #000000;"&gt; LastName : string read FLastName &lt;br /&gt;                             write FLastName;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;property&lt;/span&gt;&lt;span style="color: #000000;"&gt; FullName : string read GetFullName;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Define the generic list&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;PersonsList : TList&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Method to fill the list&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;procedure&lt;/span&gt;&lt;span style="color: #000000;"&gt; TForm4.btnPopulateClick(Sender: TObject);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Filll the personslist&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;  PersonsList.Add(TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Delphi&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;James&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  PersonsList.Add(TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Generic&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Mister&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  PersonsList.Add(TPerson.Create(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Anon&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;Method&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;etc.&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Traveling this list to fill a TListBox&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;procedure&lt;/span&gt;&lt;span style="color: #000000;"&gt; TForm4.FillListBox;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;var&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  p : TPerson;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  ListBox1.Items.Clear;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt; p &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; PersonsList &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;do&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;    ListBox1.Items.Add(p.FullName);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;As you can see, no rocking science needed to implement a generic list!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Sorting a generic TList&lt;br /&gt;&lt;/strong&gt;The next step is to implement a sorting method to sort the list on, for example, the Lastname property.&lt;br /&gt;  &lt;br /&gt;A TList has a Sort property which has an &lt;strong&gt;IComparer interface&lt;/strong&gt; that can be implemented like this using an anonymous method: &lt;br /&gt;  &lt;br /&gt;(You will have to add &lt;span style="font-weight:bold;"&gt;generics.default&lt;/span&gt; to your uses clause)&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:391879a3-befd-4997-bcb7-90817279130b" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;pre style="background-color:White;;overflow: auto;"&gt;&lt;div&gt;&lt;!--&lt;br /&gt;&lt;br /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br /&gt;http://www.CodeHighlighter.com/&lt;br /&gt;&lt;br /&gt;--&gt;&lt;span style="color: #0000FF;"&gt;procedure&lt;/span&gt;&lt;span style="color: #000000;"&gt; TForm4.btnSortClick(Sender: TObject);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;  PersonsList.Sort(TComparer&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;TPerson&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Construct(&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;function&lt;/span&gt;&lt;span style="color: #000000;"&gt;(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;const&lt;/span&gt;&lt;span style="color: #000000;"&gt; Item1,Item2:TPerson): Integer&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;begin&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;         Result :&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;br /&gt;          CompareText(Item1.LastName, Item2.LastName);&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;));&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;end&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;&lt;br /&gt;Generics is a great new feature of Delphi 2009. Just as in C# you will use them all the time. In this context, the use of &lt;span style="font-weight:bold;"&gt;anonymous methods&lt;/span&gt; is great.&lt;br /&gt;&lt;br /&gt;Besides TList Delphi has more standard generics typs including TArray, TEnumarable and more, so there is always more to explore!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Update 25-09-2008 10:58&lt;/strong&gt;&lt;br /&gt;As animal commented you must of course create the list first, which I did not include in the code snippets. &lt;br /&gt;&lt;br /&gt;PersonsList:= TList&lt;TPerson&gt;.Create;&lt;br /&gt;&lt;br /&gt;And you will have to free it also at sometime. (Don't forget to free the TPerson objects as well!)&lt;br /&gt;&lt;br /&gt;for p in PersonsList do begin&lt;br /&gt;  p.free;&lt;br /&gt;end;&lt;br /&gt;PersonsList.Free;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-4688201347656605302?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/4688201347656605302/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=4688201347656605302" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/4688201347656605302" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/4688201347656605302" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/09/simple-generic-list-tlist.html" title="A simple Generic List: TList&amp;lt;T&amp;gt;" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-1795980039029818518</id><published>2008-09-22T06:19:00.001-07:00</published><updated>2008-09-22T06:22:53.321-07:00</updated><title type="text">"Cast on News" episode at Delphi.org</title><content type="html">&lt;p&gt;Last Friday I had a really fun experience, because &lt;a href="http://www.delphi.org/" target="_blank"&gt;Jim McKeeth&lt;/a&gt; invited me to be on &lt;a href="http://www.delphi.org/2008/09/episode-6-cast-on-news/" target="_blank"&gt;the sixth episode on The Podcast at Delphi.org&lt;/a&gt; - &amp;quot;&lt;strong&gt;Cast on News&lt;/strong&gt;.&amp;quot;&amp;#160; &lt;br /&gt;    &lt;br /&gt;Also invited were &lt;a href="http://blogs.remobjects.com/blogs/mh" target="_blank"&gt;marc hoffman&lt;/a&gt; from Remobjects, and &lt;a href="http://www.deltics.co.nz/" target="_blank"&gt;Jolyon Smith&lt;/a&gt; from the Te Waka o Delphi blog. Together with host Jim McKeeth we talked about the new Delphi 2009 and Delphi in general. It turned out to be a good and fun talk.&lt;/p&gt;  &lt;p&gt;'Speaking up' instead of 'Writing up' is a total different experience, I can tell you now ;-).&amp;#160; Make sure you don't miss it, you can 'hear' &lt;a href="http://www.delphi.org/2008/09/episode-6-cast-on-news/" target="_blank"&gt;this podcast&lt;/a&gt; on the &lt;a href="http://www.delphi.org/" target="_blank"&gt;Delphi.org website&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-1795980039029818518?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/1795980039029818518/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=1795980039029818518" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/1795980039029818518" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/1795980039029818518" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/09/on-news-episode-at-delphiorg.html" title="&amp;quot;Cast on News&amp;quot; episode at Delphi.org" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-414903781066444282</id><published>2008-09-21T13:05:00.000-07:00</published><updated>2008-09-21T13:15:13.954-07:00</updated><title type="text">Those tiny little details...</title><content type="html">It are the tiny little details that makes a new release so interesting.&lt;br /&gt;Take for instance the code completion popup window of Delphi 2009, it now shows deprecated functions and properties in the color dark gray.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_33FNQ5v3xjo/SNaqinnx_QI/AAAAAAAAAE0/QvdAnzbh50w/s1600-h/ci.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_33FNQ5v3xjo/SNaqinnx_QI/AAAAAAAAAE0/QvdAnzbh50w/s320/ci.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5248569927475002626" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-414903781066444282?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/414903781066444282/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=414903781066444282" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/414903781066444282" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/414903781066444282" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/09/those-tiny-little-details.html" title="Those tiny little details..." /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_33FNQ5v3xjo/SNaqinnx_QI/AAAAAAAAAE0/QvdAnzbh50w/s72-c/ci.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-9054627372287599979</id><published>2008-09-16T12:41:00.001-07:00</published><updated>2008-09-16T13:05:38.949-07:00</updated><title type="text">Delphi 2009 very first impressions</title><content type="html">Today the SA announcements finally hit the doorstep. Here are some very first impressions:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Installation&lt;/strong&gt;&lt;br /&gt;Installation improved a lot! Installing Delphi 2009, so not C++ Builder, only took &lt;strong&gt;13 minutes&lt;/strong&gt;. &lt;br /&gt;The installation of the documentation, which is a separate install took about &lt;strong&gt;17 minutes&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. First startup&lt;/strong&gt;&lt;br /&gt;Start up time (cold) is on my machine approx. 10 seconds. A warm start however only takes 6 seconds. (Personally I don't care a lot about startup times, at least as it does not take too long ;-), but is a nice measure point)&lt;br /&gt;&lt;br /&gt;My machine: Intel Core 2 duo 1,86 Ghz. 2GB Ram, Windows Vista Business.&lt;br /&gt;&lt;br /&gt;So the installation experience is &lt;strong&gt;a lot better &lt;/strong&gt;then before. (remember &gt; 1 hour installations...).&lt;br /&gt;For my real projects I will have to wait for Devexpress, who are now &lt;a href="http://community.devexpress.com/blogs/ctodx/archive/2008/08/25/devexpress-vcl-products-support-for-tibur-243-n.aspx"&gt;working on Delphi 2009 support&lt;/a&gt;, before I can upgrade, but I guess until then there is a lot to explore.....generics, unicode....etc. By the way, Dr Bob has this &lt;a href="http://www.drbob42.com/tiburon/index.htm"&gt;nice overview with lots of blogpost and resources&lt;/a&gt; about Delphi 2009.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-9054627372287599979?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/9054627372287599979/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=9054627372287599979" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/9054627372287599979" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/9054627372287599979" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/09/delphi-2009-very-first-impressions.html" title="Delphi 2009 very first impressions" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-2017924939595332735</id><published>2008-09-02T07:17:00.001-07:00</published><updated>2008-09-02T07:17:27.714-07:00</updated><title type="text">Delphi a secret weapon..........</title><content type="html">&lt;p&gt;Nice article by &lt;a href="http://www.itwriting.com/blog/" target="_blank"&gt;Tim Anderson&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.itjoblog.co.uk/2008/08/delphi-a-secret-weapon-for-win.html" target="_blank"&gt;Delphi: a secret weapon for Windows developers&lt;/a&gt;    &lt;br /&gt;    &lt;br /&gt;Don't keep it a secret! ;-)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-2017924939595332735?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/2017924939595332735/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=2017924939595332735" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/2017924939595332735" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/2017924939595332735" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/09/delphi-secret-weapon.html" title="Delphi a secret weapon.........." /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8730195.post-5014149281665461464</id><published>2008-08-28T00:59:00.001-07:00</published><updated>2008-08-28T01:05:57.597-07:00</updated><title type="text">Speculating on .NET plans #2</title><content type="html">&lt;p&gt;&lt;a href="http://www.delphi.org/" target="_blank"&gt;Jim McKeeth&lt;/a&gt; asks himself, and us, &lt;a href="http://www.delphi.org/2008/08/delphi-win32-and-net-diverging/" target="_blank"&gt;in this blogpost&lt;/a&gt; what we think about the upcoming .NET roadmap.    &lt;br /&gt;Jim quotes, from &lt;a href="http://www.delphi.org/2008/08/episode-2-nick-hodges/" target="_blank"&gt;his podcast&lt;/a&gt; with &lt;a href="http://blogs.codegear.com/nickhodges/" target="_blank"&gt;Nick Hodges&lt;/a&gt;, which I will quote here again:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Historically one of our strong .NET stories has been close compatibility with the .NET and Win32 compilers.&amp;#160; But as we have evaluated that we have found that doing that is kind of holding both compilers back to a certain degree.&amp;#160; And that compatibility story not as compelling as it necessarily was.&amp;#160; And so what we are looking at instead is a solution that departs or sort of begins to diverge away from that compatibility story.&amp;#160; And starts heading more towards &lt;strong&gt;complete support for the .NET framework &lt;/strong&gt;kind of thing.&amp;#160; And so you&amp;#8217;ll be seeing more information about that in the coming weeks.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;He wonders if it is &lt;strong&gt;huge news&lt;/strong&gt;? Well I think is! I have speculated somewhat about this plans in &lt;a href="http://beensoft.blogspot.com/2008/08/tiburon-win32-only-speculating-on-net.html" target="_blank"&gt;this&lt;/a&gt;, and &lt;a href="http://beensoft.blogspot.com/2008/07/return-of-winforms-in-delphi-for-net-or.html" target="_blank"&gt;this&lt;/a&gt; blogpost.    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;This is what I think!&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I could think of a possible scenario:    &lt;br /&gt;&lt;em&gt;Disclaimer, this is what I think without any information or whatsoever.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The scenario: Delphi .NET as a Visual Studio plugin     &lt;br /&gt;&lt;/strong&gt;CodeGear splits Delphi into two seperate products, let say &amp;quot;&lt;strong&gt;Delphi VCL&amp;quot;&lt;/strong&gt; and &amp;quot;&lt;strong&gt;Delphi .NET&amp;quot;&lt;/strong&gt;.    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Delphi VCL     &lt;br /&gt;&lt;/strong&gt;Besides the Win32 part of this product, which is now called &lt;a href="http://www.codegear.com/products/delphi/win32" target="_blank"&gt;Delphi 2009&lt;/a&gt;, VCL.NET will be added. Offering a complete Win32/.NET compatible framework called VCL/(VCL.NET). (Let's call this one &amp;quot;&lt;strong&gt;RAD Studio VCL&lt;/strong&gt;&amp;quot;)    &lt;br /&gt;So Delphi as we know it, since Delphi 1 bundled with a 100% compatible .NET part. So for anyone who took the VCL.NET path as it's .NET path it is business as usual.    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Delphi .NET     &lt;br /&gt;&lt;/strong&gt;This product is offered as a Visual Studio plugin, offering Delphi (Pascal) (read the compiler) as fully fledged .NET language. Possible offering VCL.NET compatibility.    &lt;br /&gt;(So our old &lt;a href="http://beensoft.blogspot.com/2007/06/codegear-to-drop-winforms-designer-in.html" target="_blank"&gt;Delphi .NET 1.1 Winforms&lt;/a&gt; might have a future!)    &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;The benefits:     &lt;br /&gt;Delphi VCL&lt;/strong&gt; get's his own roadmap, is not delayed by the next Microsoft technology to be added to the .NET part. However offering VCL.NET as compatible .NET framework it will be a complete Windows development environment. Maybe not offering the 'latest and possible greatest' Microsoft technology but more than enough for 80% (? wild guess ;-) ) of the current Delphi users.    &lt;br /&gt;    &lt;br /&gt;Putting Delphi as a language into Visual Studio has the benefit that it can use the Microsoft designers, so it can always be on the edge of the future developments. &lt;/p&gt;  &lt;p&gt;In my humble opinion this is the only way to offer &lt;strong&gt;complete support for the .NET framework&lt;/strong&gt;.    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Again what do you think?   &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8730195-5014149281665461464?l=beensoft.blogspot.com'/&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://beensoft.blogspot.com/feeds/5014149281665461464/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=8730195&amp;postID=5014149281665461464" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/5014149281665461464" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8730195/posts/default/5014149281665461464" /><link rel="alternate" type="text/html" href="http://beensoft.blogspot.com/2008/08/speculating-on-net-plans-2.html" title="Speculating on .NET plans #2" /><author><name>Roland Beenhakker</name><uri>http://www.blogger.com/profile/05387682563668003098</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd="http://schemas.google.com/g/2005" name="OpenSocialUserId" value="07996756216310511835" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">6</thr:total></entry></feed>
