Microsoft MVP Logo

    <p>I finally got sick of writing feature.xml after feature.xml and creating new GUIDs. These repetitive things as well as those that make me take my hands off the keyboard slow me down... and that drives me nuts. Over the last few months I've been polishing and tweaking some stuff I've been working on that I use on a day-to-day basis as a SharePoint developer that speed up my development. Finally, they are at a point where I want to share them for others to benefit from them as I have (and a few folks who've been kind enough to test and provide feedback).</p>
    <p>Before I dive in, let me answer four questions I'm sure you're wondering:</p>
    <p style="MARGIN-LEFT: 15px"><strong><u>What</u> is it?</strong>
    Additions for <a href="http://www.devexpress.com/Products/NET/CodeRush/">CodeRush</a> &amp; <a href="http://www.devexpress.com/Products/NET/IDETools/Refactor/">Refactor! Pro</a> Visual Studio productivity add-ins. These include a dynamic list for SharePoint types, XML templates addressing the various XML files we use in SharePoint (eg: Feature schema, solution schema, field type definitions, *.webpart files, etc) as well as some refactorings. What in the heck does all this mean? No worries, I'll get to it :).</p>
    <p style="MARGIN-LEFT: 15px"><strong><u>How</u> do I get it?</strong>
    Go to this page to get the latest releases... I'll keep adding stuff over time. Got ideas for more stuff? <a href="http://www.andrewconnell.com/blog/contact.aspx">Let me know</a>!</p>
    <p style="MARGIN-LEFT: 15px"><strong><u>Who</u> is it for?</strong>
    Those developers who use DevExpress' <a href="http://www.devexpress.com/Products/NET/IDETools/CodeRush/">CodeRush</a> &amp; <a href="http://www.devexpress.com/Products/NET/IDETools/Refactor/">Refactor! Pro</a> Visual Studio productivity add-ins. No, they (CodeRush &amp; Refactor! Pro) aren't free utilities (what I'm giving you is free), but frankly, for only $250 (you get both CodeRush &amp; Refactor! Pro), it is well worth it in the time you'll save when you look at the big picture. Heck, Refactor already contains over 100 refactorings (<a href="http://www.devexpress.com/Products/NET/IDETools/VBRefactor/">VB.NET</a> &amp; <a href="http://www.devexpress.com/Products/NET/IDETools/RefactorASP/">ASP.NET</a> developers have been used to getting a free, slimmed down version of Refactor for Visual Studio for a while).

    <strong><u>Why</u></strong> <strong>do I have to buy something to use this?</strong>
    It's just the direction I took. I love CodeRush &amp; Refactor! Pro and <a href="http://www.andrewconnell.com/Tags/DXCore%20/%20CR%20/%20Refactor">I've said it numerous times</a>. Don't know what CodeRush or Refactor! Pro are? Use the above links, <a href="http://www.andrewconnell.com/blog/DevExpress-DXCore-CodeRush-Refactor-and-Mark-Miller">read my post</a>, or <a href="http://www.devexpress.com/Products/NET/IDETools/CodeRush/Training.xml">sit back and watch it in action</a> (at least this quick "<a href="http://www.devexpress.com/Products/NET/IDETools/CodeRush/Trainings/CodeRushBirdsEyeView/CodeRushBirdsEyeView24.html">big picture</a>" screencast).</p>
    <p>OK, so what is this all about? As I said above, I got sick of doing the same thing over and over... creating new GUIDS, writing yet another Feature definition file. I mean, come on, how many can you really build before you flip on auto pilot. Even Feature receivers... the <span style="FONT-FAMILY: courier new, courier, monospace">ReceiverAssembly</span> &amp; <span style="FONT-FAMILY: courier new, courier, monospace">ReceiverClass</span> attributes just slow you down, eh? Better yet, why should <em>I</em> be doing that stuff? I'm serious... I know how to do it (I = you too). Can't a machine do this stuff? Can't I spend my time on more complicated and creative stuff?</p>
    <p>The answer is <em>yes</em>... no... the answer is <em>HELL YES</em>, and that was my motivation when I started building these things (and continues to be). Visual examples will prove this better than I can type it up... so here you go:</p>
    <p><strong>Creating new GUIDS:</strong>
    If I have to take my hand off the keyboard one more time and select Tools &raquo; Create GUID (don't forget about deleting the {} brackets... arg!) I'm going to chop it off! Why can't I just do something like this (notice the Keys window at the bottom of the animation showing what I'm typing... specifically, notice what happens when I type <strong>newguid[space]</strong>):</p>
    <p align="center"><a title="Photo Sharing" href="http://www.flickr.com/photos/andrewconnell/1198852843/"><img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" height="232" alt="newguid" width="532" src="http://farm2.static.flickr.com/1280/1198852843_49e7e9e5dd_o.gif"></a></p>
    <p>It is such a simple demo, but my goodness, can't you see the benefit? And it is so simple!</p>
    <p><strong>Creating new Feature definitions (feature.xml):</strong>
    Even if you have enabled CAML IntelliSense in Visual Studio, building Feature definitions is tedious. What does every one need? An ID, title, scope, and some element manifests right? So... why not let the machine do the work for us? In this example, I'm just typing <strong>fxml[space]</strong> and then hitting [enter] to jump between the fields:</p>
    <p align="center"><a title="Photo Sharing" href="http://www.flickr.com/photos/andrewconnell/1199718824/"><img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" height="308" alt="fxml" width="552" src="http://farm2.static.flickr.com/1358/1199718824_501a8aba52_o.gif"></a></p>
    <p>Notice the automatically created GUID? </p>
    <p><strong>But wait</strong>, aren't you saying "<em>uh, AC... you can do a LOT of this using Visual Studio snippets.</em>" True, there is a striking similarity (<em>so far</em>)... but snippets can't contain logic parsed at implementation time huh? Just keep reading :)</p>
    <p><strong>Creating new Feature definitions containing Feature receivers (feature.xml):
    </strong>Is it hard to add in those <em>ReceiverAssembly</em> and <em>ReceiverClass </em>attributes? Nah... you can even cheat by building the project containing the receiver class and opening the assembly in <a href="http://www.aisto.com/roeder/dotnet/">Lutz's Reflector</a> to get the assembly's full name (aka: 4-part name). But... if you've already created the Feature receiver class in your project, why can't the machine figure that stuff out for you? Oh... but it can:</p>
    <p align="center"><a title="Photo Sharing" href="http://www.flickr.com/photos/andrewconnell/1199718618/"><img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" height="332" alt="frxml" width="576" src="http://farm2.static.flickr.com/1366/1199718618_f4e2d60fff_o.gif"></a></p>
    <p>Uh huh... that's right. It reflected the assembly, obtained the full name, and also walked through the project looking for the first type that inherited from <span style="FONT-FAMILY: courier new, courier, monospace">Microsoft.SharePoint.SPFeatureReceiver</span>, got the type's full name ([namespace].[type_name]) and added both of these to the necessary attributes.</p>
    <p><strong>Adding new types:
    </strong>What's one of the most annoying things for you (well, at least for me) when writing SharePoint code... or any code for that matter? For me, it's either having to put the namespace in the using statements to use a type or type the whole namespace+typename in my code which looks nasty. While Refactor! Pro has a nice refactoring to clean up the long name to breaking it up to use on tly the type and put the namespace in the using statement, CR has a slick capability called dynamic types. I've created a few types in this set for SharePoint objects. For example, the type <span style="FONT-FAMILY: courier new, courier, monospace">sps = Microsoft.SharePoint.SPSite</span>. When you type a template that uses a type, such as <strong>vsps</strong> (for a new variable of the type sps, or <span style="FONT-FAMILY: courier new, courier, monospace">Microsoft.SharePoint.SPSite</span>), CR will add the namespace for you automatically if it isn't already present, like the following demo shows:</p>
    <p align="center"><a title="Photo Sharing" href="http://www.flickr.com/photos/andrewconnell/1198853001/"><img style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" height="196" alt="vsps" width="368" src="http://farm2.static.flickr.com/1210/1198853001_b52a3ce9c7_o.gif"></a></p>
    <p><strong>So how much does it help?
    </strong>Nothing beats tangible results. One of the people who volunteered to test this had his dev team take their most complex Feature and re-code it again from scratch without these tools. It took on average 25 minutes. Using these tools, with only 30 minutes of getting familiar with the tools, they cut dev time down to 10 minutes!!!</p>
    <p>OK... enough teasers. To get more info, check out the page I've created for these tools where you'll find more information such as how to download and install and what's included. Also, there are a few screencasts posted as well to help you see everything this stuff does (so much easier to see than it is to read another post). There is one very brief overview screencast, <a href="http://www.andrewconnell.com/blog/videos/SPCodeRushTools/Overview.aspx">Overview of AC's VS CodeRush/Refactor Tools for SharePoint Devs</a>, for those who just want a teaser to see if this is this.</p>
    <p>&raquo; <a href="http://www.andrewconnell.com/ACs-VS-CodeRush-Refactor-Tools-for-SharePoint-Developers">AC's VS CodeRush/Refactor Tools for SharePoint Developers</a></p>
    <p>Let me know what you think! Oh... and I didn't name this post "part 1 of 5" for some random reason. Over the next four days, I'll add another post related to these productivity enhancements.  :)</p>
    <ul>
    <li><a href="http://www.andrewconnell.com/blog/Announcing-ACs-VS-CodeRushRefactor-Tools-for-SharePoint-Devs-Part-1-of-5">Part 1: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs </a></li>
    <li><a href="http://www.andrewconnell.com/blog/Working-with-Templates-in-ACs-VS-CodeRushRefactor-Tools-for-SharePoint-Devs-Part-2-of-5">Part 2: Working with Templates in AC's VS CodeRush/Refactor Tools for SharePoint Devs</a> </li>
    <li><a href="http://www.andrewconnell.com/blog/MOSS-Publishing-Templates-in-ACs-VS-CodeRushRefactor-Tools-for-SharePoint-Part-3-of-5">Part 3: Special Templates in AC's VS CodeRush/Refactor Tools for SharePoint Devs for Publishing Sites </a></li>
    <li><a href="http://www.andrewconnell.com/blog/Use-of-StringProviders-in-ACs-VS-CodeRushRefactor-Tools-for-SharePoint-Devs-Part-4-of-5">Part 4: String Providers in AC's VS CodeRush/Refactor Tools for SharePoint Devs </a></li>
    <li><a href="http://www.andrewconnell.com/blog/Creating-custom-Refactorings-for-use-in-Refactor-Pro-The-quotCreate-Web-Part-Definitionquot-Refactoring-Part-5-of-5">Part 5: Creating custom Refactorings for use in Refactor! Pro: The "Create Web Part Definition" Refactoring</a> </li>
    </ul>
    <div class="wlWriterEditableSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:367f05fa-6af9-45fc-9b26-1e37cdf908f5" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">Technorati tags: <a rel="tag" href="http://technorati.com/tags/sharepoint">sharepoint</a>, <a rel="tag" href="http://technorati.com/tags/wss">wss</a>, <a rel="tag" href="http://technorati.com/tags/moss">moss</a>, <a rel="tag" href="http://technorati.com/tags/publishing%20site">publishing site</a>, <a rel="tag" href="http://technorati.com/tags/dxcore">dxcore</a>, <a rel="tag" href="http://technorati.com/tags/coderush">coderush</a>, <a rel="tag" href="http://technorati.com/tags/refactor%20pro">refactor pro</a></div>
Comments powered by Disqus