<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>OOP - There It Is - 3.5</title>
    <link>http://www.vpsw.com/blogbaby/</link>
    <description>A Very Practical Blog</description>
    <language>en-us</language>
    <copyright>Dean Fiala</copyright>
    <lastBuildDate>Wed, 11 Jun 2008 03:24:01 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>dfiala@vpsw.com</managingEditor>
    <webMaster>dfiala@vpsw.com</webMaster>
    <item>
      <trackback:ping>http://www.vpsw.com/blogbaby/Trackback.aspx?guid=5ebf2926-8003-4c16-b328-8e91755317b0</trackback:ping>
      <pingback:server>http://www.vpsw.com/blogbaby/pingback.aspx</pingback:server>
      <pingback:target>http://www.vpsw.com/blogbaby/PermaLink,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</pingback:target>
      <dc:creator>Dean</dc:creator>
      <wfw:comment>http://www.vpsw.com/blogbaby/CommentView,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</wfw:comment>
      <wfw:commentRss>http://www.vpsw.com/blogbaby/SyndicationService.asmx/GetEntryCommentsRss?guid=5ebf2926-8003-4c16-b328-8e91755317b0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The Resharper cult members already know this, but for those who haven't joined yet,
version <a href="http://www.jetbrains.com/resharper/download/">4.0 released today</a> with
VS 2008 support -- huzzah,  huzzah.  No longer able to resist the chanting
and promises of eternal coolness I donned my robe and installed my free copy.
</p>
        <p>
I clearly should have joined sooner.  Resharper has already changed my life. 
First it pointed that I had redundant overrides  in the control I was working
on, which I had really meant to delete. 
</p>
        <p>
Then it reminded me about the new <a href="http://msdn.microsoft.com/en-us/library/bb384061.aspx">implicit
type declaration</a> keyword var, so this...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">XmlDocument SomeDoc = new XmlDocument();</font>
          </p>
        </blockquote>
        <p>
becomes...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">var SomeDoc = new XmlDocument();</font>
          </p>
        </blockquote>
        <p>
Granted, that's not too exciting, but if your type declaration is something like...
</p>
        <blockquote>
          <font face="Courier New" color="#0000ff">Dictionary&lt;SomeStrangeType,ANamespace.AnotherLongType&gt;
SomeDictionary = new Dictionary&lt;SomeStrangeType,ANamespace.AnotherLongType&gt;();</font>
        </blockquote>
        <p>
with var it becomes...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">var SomeDictionary = new Dictionary&lt;SomeStrangeType,ANamespace.AnotherLongType&gt;();</font>
          </p>
        </blockquote>
        <p>
Then Resharper pointed out something I didn't realize was available in C#, the <a href="http://msdn.microsoft.com/en-us/library/bb384062.aspx">object
intializer</a>?? VB.NET has long had something similar with the <a href="http://msdn.microsoft.com/en-us/library/wc500chb.aspx">With
statement</a> (now with <a href="http://msdn.microsoft.com/en-us/library/bb385125.aspx">object
initializer goodness</a> too).  What's nice about this is that it saves repeating
the instance name in front of the properties.  So this...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">var MenuBinding = new MenuItemBinding(); 
<br />
MenuBinding.DataMember = MenuItemElementName; 
<br />
MenuBinding.TextField = DisplayTextAttribute; 
<br />
MenuBinding.NavigateUrlField = NavigationUrlAttribute; 
<br />
MenuBinding.Depth = Depth;</font>
          </p>
        </blockquote>
        <p>
becomes...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">var MenuBinding = new MenuItemBinding 
<br />
  { 
<br />
     DataMember = MenuItemElementName, 
<br />
     TextField = DisplayTextAttribute, 
<br />
     NavigateUrlField = NavigationUrlAttribute, 
<br />
     Depth = Depth 
<br />
  };</font>
          </p>
        </blockquote>
        <p>
I was staring at this new construct when I realized that -- it shouldn't work. The
project I was working on was a Framework 2.0 project and these things were in 3.0
syntax.  But the darn thing compiles and works.  Not even a single warning. 
WTF?  It turns out that since 3.0 and 3.5 are based on 2.0, these are simply
compiler tricks -- there is nothing fundamentally different about the types. 
Here's a <a href="http://weblogs.asp.net/shahar/archive/2008/01/23/use-c-3-features-from-c-2-and-net-2-0-code.aspx">blog
post</a> that explores in more detail what is happening under the covers.
</p>
        <p>
Not bad for 15 minutes of tooling around.  Guess I am an official member. Where's
the Koolaid?
</p>
        <img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=5ebf2926-8003-4c16-b328-8e91755317b0" />
      </body>
      <title>Sharpening Knives</title>
      <guid isPermaLink="false">http://www.vpsw.com/blogbaby/PermaLink,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</guid>
      <link>http://www.vpsw.com/blogbaby/PermaLink,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</link>
      <pubDate>Wed, 11 Jun 2008 03:24:01 GMT</pubDate>
      <description>&lt;p&gt;
The Resharper cult members already know this, but for those who haven't joined yet,
version &lt;a href="http://www.jetbrains.com/resharper/download/"&gt;4.0 released today&lt;/a&gt; with
VS 2008 support -- huzzah,&amp;#160; huzzah.&amp;#160; No longer able to resist the chanting
and promises of eternal coolness I donned my robe and installed my free copy.
&lt;/p&gt;
&lt;p&gt;
I clearly should have joined sooner.&amp;#160; Resharper has already changed my life.&amp;#160;
First it pointed that I had redundant overrides&amp;#160; in the control I was working
on, which I had really meant to delete. 
&lt;/p&gt;
&lt;p&gt;
Then it reminded me about the new &lt;a href="http://msdn.microsoft.com/en-us/library/bb384061.aspx"&gt;implicit
type declaration&lt;/a&gt; keyword var, so this...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;XmlDocument SomeDoc = new XmlDocument();&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
becomes...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;var SomeDoc = new XmlDocument();&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Granted, that's not too exciting, but if your type declaration is something like...
&lt;/p&gt;
&lt;blockquote&gt;&lt;font face="Courier New" color="#0000ff"&gt;Dictionary&amp;lt;SomeStrangeType,ANamespace.AnotherLongType&amp;gt;
SomeDictionary = new Dictionary&amp;lt;SomeStrangeType,ANamespace.AnotherLongType&amp;gt;();&lt;/font&gt; &lt;/blockquote&gt; 
&lt;p&gt;
with var it becomes...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;var SomeDictionary = new Dictionary&amp;lt;SomeStrangeType,ANamespace.AnotherLongType&amp;gt;();&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Then Resharper pointed out something I didn't realize was available in C#, the &lt;a href="http://msdn.microsoft.com/en-us/library/bb384062.aspx"&gt;object
intializer&lt;/a&gt;?? VB.NET has long had something similar with the &lt;a href="http://msdn.microsoft.com/en-us/library/wc500chb.aspx"&gt;With
statement&lt;/a&gt; (now with &lt;a href="http://msdn.microsoft.com/en-us/library/bb385125.aspx"&gt;object
initializer goodness&lt;/a&gt; too).&amp;#160; What's nice about this is that it saves repeating
the instance name in front of the properties.&amp;#160; So this...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;var MenuBinding = new MenuItemBinding(); 
&lt;br /&gt;
MenuBinding.DataMember = MenuItemElementName; 
&lt;br /&gt;
MenuBinding.TextField = DisplayTextAttribute; 
&lt;br /&gt;
MenuBinding.NavigateUrlField = NavigationUrlAttribute; 
&lt;br /&gt;
MenuBinding.Depth = Depth;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
becomes...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;var MenuBinding = new MenuItemBinding 
&lt;br /&gt;
&amp;#160; { 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160; DataMember = MenuItemElementName, 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160; TextField = DisplayTextAttribute, 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160; NavigateUrlField = NavigationUrlAttribute, 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160; Depth = Depth 
&lt;br /&gt;
&amp;#160; };&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
I was staring at this new construct when I realized that -- it shouldn't work. The
project I was working on was a Framework 2.0 project and these things were in 3.0
syntax.&amp;#160; But the darn thing compiles and works.&amp;#160; Not even a single warning.&amp;#160;
WTF?&amp;#160; It turns out that since 3.0 and 3.5 are based on 2.0, these are simply
compiler tricks -- there is nothing fundamentally different about the types.&amp;#160;
Here's a &lt;a href="http://weblogs.asp.net/shahar/archive/2008/01/23/use-c-3-features-from-c-2-and-net-2-0-code.aspx"&gt;blog
post&lt;/a&gt; that explores in more detail what is happening under the covers.
&lt;/p&gt;
&lt;p&gt;
Not bad for 15 minutes of tooling around.&amp;#160; Guess I am an official member. Where's
the Koolaid?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=5ebf2926-8003-4c16-b328-8e91755317b0" /&gt;</description>
      <comments>http://www.vpsw.com/blogbaby/CommentView,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</comments>
      <category>.NET</category>
      <category>2.0</category>
      <category>3.0</category>
      <category>3.5</category>
      <category>Resharper</category>
    </item>
    <item>
      <trackback:ping>http://www.vpsw.com/blogbaby/Trackback.aspx?guid=7f00c831-3534-491e-be8d-4993f8cd770a</trackback:ping>
      <pingback:server>http://www.vpsw.com/blogbaby/pingback.aspx</pingback:server>
      <pingback:target>http://www.vpsw.com/blogbaby/PermaLink,guid,7f00c831-3534-491e-be8d-4993f8cd770a.aspx</pingback:target>
      <dc:creator>Dean</dc:creator>
      <wfw:comment>http://www.vpsw.com/blogbaby/CommentView,guid,7f00c831-3534-491e-be8d-4993f8cd770a.aspx</wfw:comment>
      <wfw:commentRss>http://www.vpsw.com/blogbaby/SyndicationService.asmx/GetEntryCommentsRss?guid=7f00c831-3534-491e-be8d-4993f8cd770a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">While crawling around in VS 2008 to work
on the <a href="http://www.vpsw.com/blogbaby/PermaLink,guid,cd94d8d1-fdda-4a14-8549-2f597a593660.aspx">P2P
presentation</a> for <a href="http://www.rocknug.org">RockNUG</a> and the <a href="http://novacodecamp.org">NOVA
Code Camp</a>, I stumbled upon a lovely little feature under Intellisense on the Edit
menu called <a href="http://msdn.microsoft.com/en-us/library/bb514114.aspx">Organize
Usings</a>.  A simple click can remove unused using statements, sort the statements
or do both.  Cleans up code faster than a life style diva on a nicotine binge.<br /><br />
Visual Studio has default templates for all project items and they frequently includes
using statements for namespaces, that well, never get used.  The class template,
for example really, really wants you to use the <a href="http://msdn.microsoft.com/en-us/library/bb308959.aspx">LINQ</a> and
the System.Text namespaces. If you haven't gotten around to <a href="http://msdn.microsoft.com/en-us/library/ms247119.aspx">modifying
the default templates</a>, you'll have lots of unneeded using statements cluttering
up your code.  The Organize Usings feature can help save other developers (or
the future you) from wondering, "Where the heck did he use LINQ in this class?".<br /><br />
And just so you don't strain yourself, it is only available for C#.<br /><br /><br /><p></p><img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=7f00c831-3534-491e-be8d-4993f8cd770a" /></body>
      <title>Making Like Martha Stewart</title>
      <guid isPermaLink="false">http://www.vpsw.com/blogbaby/PermaLink,guid,7f00c831-3534-491e-be8d-4993f8cd770a.aspx</guid>
      <link>http://www.vpsw.com/blogbaby/PermaLink,guid,7f00c831-3534-491e-be8d-4993f8cd770a.aspx</link>
      <pubDate>Mon, 19 May 2008 16:52:34 GMT</pubDate>
      <description>While crawling around in VS 2008 to work on the &lt;a href="http://www.vpsw.com/blogbaby/PermaLink,guid,cd94d8d1-fdda-4a14-8549-2f597a593660.aspx"&gt;P2P
presentation&lt;/a&gt; for &lt;a href="http://www.rocknug.org"&gt;RockNUG&lt;/a&gt; and the &lt;a href="http://novacodecamp.org"&gt;NOVA
Code Camp&lt;/a&gt;, I stumbled upon a lovely little feature under Intellisense on the Edit
menu called &lt;a href="http://msdn.microsoft.com/en-us/library/bb514114.aspx"&gt;Organize
Usings&lt;/a&gt;.&amp;nbsp; A simple click can remove unused using statements, sort the statements
or do both.&amp;nbsp; Cleans up code faster than a life style diva on a nicotine binge.&lt;br&gt;
&lt;br&gt;
Visual Studio has default templates for all project items and they frequently includes
using statements for namespaces, that well, never get used.&amp;nbsp; The class template,
for example really, really wants you to use the &lt;a href="http://msdn.microsoft.com/en-us/library/bb308959.aspx"&gt;LINQ&lt;/a&gt; and
the System.Text namespaces. If you haven't gotten around to &lt;a href="http://msdn.microsoft.com/en-us/library/ms247119.aspx"&gt;modifying
the default templates&lt;/a&gt;, you'll have lots of unneeded using statements cluttering
up your code.&amp;nbsp; The Organize Usings feature can help save other developers (or
the future you) from wondering, "Where the heck did he use LINQ in this class?".&lt;br&gt;
&lt;br&gt;
And just so you don't strain yourself, it is only available for C#.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=7f00c831-3534-491e-be8d-4993f8cd770a" /&gt;</description>
      <comments>http://www.vpsw.com/blogbaby/CommentView,guid,7f00c831-3534-491e-be8d-4993f8cd770a.aspx</comments>
      <category>3.5</category>
      <category>Visual Studio 2008</category>
    </item>
    <item>
      <trackback:ping>http://www.vpsw.com/blogbaby/Trackback.aspx?guid=cd94d8d1-fdda-4a14-8549-2f597a593660</trackback:ping>
      <pingback:server>http://www.vpsw.com/blogbaby/pingback.aspx</pingback:server>
      <pingback:target>http://www.vpsw.com/blogbaby/PermaLink,guid,cd94d8d1-fdda-4a14-8549-2f597a593660.aspx</pingback:target>
      <dc:creator>Dean</dc:creator>
      <wfw:comment>http://www.vpsw.com/blogbaby/CommentView,guid,cd94d8d1-fdda-4a14-8549-2f597a593660.aspx</wfw:comment>
      <wfw:commentRss>http://www.vpsw.com/blogbaby/SyndicationService.asmx/GetEntryCommentsRss?guid=cd94d8d1-fdda-4a14-8549-2f597a593660</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Nothing like a <a href="http://www.novacodecamp.org/">code
camp</a> to get jazzed about all the stuff I could be working on. It is like a revival
meeting; everything is new and exciting and possible.<br /><br />
I took in <a href="http://www.novacodecamp.org/CodeCamps/NoVaCodeCamp200801/Sessions/tabid/153/Default.aspx">sessions</a> about
making DotNetNuke modules and the new ASP.NET Dynamic Data extensions. Very interesting
stuff.  The Dynamic Data stuff appears to be a great way to bang out admin pages
with minimal effort.<br /><br />
I also presented my <a href="http://www.vpsw.com/down/PeertoPeerNetworkingWith3_5.ppt">little
talk</a> about the new <a href="http://msdn.microsoft.com/en-us/library/system.net.peertopeer.aspx">Peer-to-Peer
Networking</a> goodies in the .NET 3.5 framework.  This is stuff that's been
possible to do with the Windows API for a long time, but has finally been exposed
through the managed classes for access by mere mortals.  Here is yet <a href="http://www.vpsw.com/down/Chatty.zip">another
chat application</a> that demonstrates how it all works.<br /><br />
The real exciting namespace is its child the <a href="http://msdn.microsoft.com/en-us/library/system.net.peertopeer.collaboration.aspx">PeerToPeer.Collaboration</a> namespace. 
It is a framework for building p2p apps.  Didn't have the time to delve into
it fully, as it is only supported in Vista. But it did provide the first compelling
reason to upgrade, so I finally succumbed. 
<br /><br />
Just need to invent the 50 hour day to get to try out all the things I'd like to.<br /><p></p><img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=cd94d8d1-fdda-4a14-8549-2f597a593660" /></body>
      <title>Camping Out</title>
      <guid isPermaLink="false">http://www.vpsw.com/blogbaby/PermaLink,guid,cd94d8d1-fdda-4a14-8549-2f597a593660.aspx</guid>
      <link>http://www.vpsw.com/blogbaby/PermaLink,guid,cd94d8d1-fdda-4a14-8549-2f597a593660.aspx</link>
      <pubDate>Sun, 18 May 2008 01:30:07 GMT</pubDate>
      <description>Nothing like a &lt;a href="http://www.novacodecamp.org/"&gt;code camp&lt;/a&gt; to get jazzed
about all the stuff I could be working on. It is like a revival meeting; everything
is new and exciting and possible.&lt;br&gt;
&lt;br&gt;
I took in &lt;a href="http://www.novacodecamp.org/CodeCamps/NoVaCodeCamp200801/Sessions/tabid/153/Default.aspx"&gt;sessions&lt;/a&gt; about
making DotNetNuke modules and the new ASP.NET Dynamic Data extensions. Very interesting
stuff.&amp;nbsp; The Dynamic Data stuff appears to be a great way to bang out admin pages
with minimal effort.&lt;br&gt;
&lt;br&gt;
I also presented my &lt;a href="http://www.vpsw.com/down/PeertoPeerNetworkingWith3_5.ppt"&gt;little
talk&lt;/a&gt; about the new &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.peertopeer.aspx"&gt;Peer-to-Peer
Networking&lt;/a&gt; goodies in the .NET 3.5 framework.&amp;nbsp; This is stuff that's been
possible to do with the Windows API for a long time, but has finally been exposed
through the managed classes for access by mere mortals.&amp;nbsp; Here is yet &lt;a href="http://www.vpsw.com/down/Chatty.zip"&gt;another
chat application&lt;/a&gt; that demonstrates how it all works.&lt;br&gt;
&lt;br&gt;
The real exciting namespace is its child the &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.peertopeer.collaboration.aspx"&gt;PeerToPeer.Collaboration&lt;/a&gt; namespace.&amp;nbsp;
It is a framework for building p2p apps.&amp;nbsp; Didn't have the time to delve into
it fully, as it is only supported in Vista. But it did provide the first compelling
reason to upgrade, so I finally succumbed. 
&lt;br&gt;
&lt;br&gt;
Just need to invent the 50 hour day to get to try out all the things I'd like to.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=cd94d8d1-fdda-4a14-8549-2f597a593660" /&gt;</description>
      <comments>http://www.vpsw.com/blogbaby/CommentView,guid,cd94d8d1-fdda-4a14-8549-2f597a593660.aspx</comments>
      <category>.NET</category>
      <category>3.5</category>
      <category>p2p</category>
    </item>
  </channel>
</rss>