<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>C#</title>
        <link>http://www.edsid.com/blog/category/30.aspx</link>
        <description>C#</description>
        <language>en-US</language>
        <copyright>Gerry Heidenreich</copyright>
        <managingEditor>grh@whdlaw.com</managingEditor>
        <generator>Subtext Version 1.9.5.177</generator>
        <item>
            <title>Enterprise Integration with POCOs</title>
            <link>http://edsid.com/blog/archive/2008/08/27/enterprise-integration-with-pocos.aspx</link>
            <description>&lt;p&gt;Our custom development here at Whyte Hirschboeck Dudek regularly requires integration with our enterprise systems, from Active Directory to Time &amp;amp; Billing, our custom Marketing Dashboard, Document Management System, Customer Relations Management, etc... &lt;/p&gt;
&lt;p&gt;A few examples of data we may regularly need include:&lt;br /&gt;
- Contact information&lt;br /&gt;
- Member of a security or distribution group in Active Directory&lt;br /&gt;
- Current secretaries assigned to lawyers, or vice-versa&lt;br /&gt;
- Who is associated with what clients and projects&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;Motivation&lt;/strong&gt;&lt;/font&gt; &lt;br /&gt;
&lt;strong&gt;A small disclaimer&lt;/strong&gt;&lt;em&gt;: we are lucky to be in a Microsoft house, with Visual Studio 2008, Active Directory, Exchange, (mostly) SQL 2000 &amp;amp; 2005, and some APIs to play with.  Our systems are positioned to play nice with each other.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;There are so many different infrastructure frameworks, paradigms, and architectures that it is overwhelming to try to keep up (just learning about them, never mind putting them into production!).  Sure, service-enabling your enterprise with SOA seems to fit the bill through total abstraction, but the up-front costs are &lt;em&gt;huge&lt;/em&gt;, and the ROI is uncertain at best.  &lt;/p&gt;
&lt;p&gt;As you probably know, POJO is a formalized ('&lt;a href="http://www.martinfowler.com/bliki/POJO.html"&gt;Fowlerized&lt;/a&gt;") term for a 'plain old java object', and POCO is the CLR representation (PORO is Ruby, etc).  It is a domain entity that carries no special baggage.  It doesn't extend anything or carry any dependencies on other frameworks or methodologies, &lt;em&gt;only the CLR&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;When writing the application itself (a webpart or user control, clickonce app/utility, extranet, report, etc) 100% focus should be on the application's purpose and logic.  I should never have to tell the application what a Client is, just that I need one.  I shouldn't have to say that a client has matters, my client object should expose that for me!  Also, I don't want to get my objects by writing up services, proxies, ORM metadata, and various providers unless it is absolutely necessary.  I know these things are what's cool, and I need to grow up, but I like simplicity: I want my app to be as simple as possible to develop, and I want anything written outside the bounds of my app to be available as a single .dll file that describes my business entities so they can be &lt;em&gt;reused&lt;/em&gt; later by other projects.&lt;/p&gt;
&lt;p&gt;.Net provides some amazing capabilities for wiring an app together: Lambdas, LINQ, Extension methods, Generics, System.Converter&amp;lt;T1, T2&amp;gt;.  It is much more capable than it used to be to work with objects quickly and easily &lt;em&gt;on its own.  &lt;/em&gt;(With this in mind, I am anxious to see what the &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=entity+framework&amp;amp;aq=f&amp;amp;oq="&gt;Entity Framework&lt;/a&gt; does for us as far as value:complexity!)&lt;/p&gt;
&lt;p&gt;The following explains our approach, starting with the fundamental bits in our framework, the core library...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Enterprise Core Library&lt;/font&gt;&lt;/strong&gt; &lt;br /&gt;
The foundation of our enterprise integration efforts.  The classes contain regularly needed functionality like:&lt;br /&gt;
- Logging (to a single EnterpriseLog table)&lt;br /&gt;
- Connection strings to various systems (SQL, Ldap, Service URLs)&lt;br /&gt;
- Email, Notifications&lt;br /&gt;
- Active Directory querying&lt;br /&gt;
- ClickOnce helpers (add to startup, autoupdate methods, etc)&lt;br /&gt;
- SQL access methods for reading and executing SqlCommand objects.&lt;br /&gt;
- List to RSS mapping&lt;/p&gt;
&lt;p&gt;Our custom apps need a few keys in their .config, to access Active Directory, and to access our WhdEnterprise.ConnectionStrings table.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;ConnectionStrings&lt;/font&gt;&lt;/strong&gt; &lt;br /&gt;
Connecting to a system from our apps are trivial: ConnectionString.Retrieve("TimeBilling") grabs the appropriate string from the WhdEnterprise.ConnectionStrings table.  When (not if) the Time &amp;amp; Billing system moves servers, update the row in the table instead of mass-updating config files for all broken apps that use it.  A dictionary cache exists to keep performance from being an issue.&lt;/p&gt;
&lt;p&gt;ConnectionStrings may be used for more than just databases... consider LDAP string for Active Directory, and URLs for web services.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;User&lt;br /&gt;
&lt;/font&gt;&lt;/strong&gt;One of our most fundamental objects is in our Core library: WhdUser.&lt;/p&gt;
&lt;p&gt;WhdUser.Current uses Environment.UserName to identify the current user when needed, and optionally (lazily) grab email, phone extension, and computername from Active Directory.  &lt;/p&gt;
&lt;p&gt;Once the current user is identified, a domain-specific user can be instantiated (ex: List&amp;lt;Client&amp;gt; clients = TimeBillingUser(WhdUser.Current).Clients).  Each system has its POCO user object, and controller to retrieve the relevant domain-specific info.  Our time &amp;amp; billing system for instance, has a TimeBillingUser, which may have properties and methods like Secretaries, Clients, Projects, HoursWorked(), HoursBilled(), HoursCollected(), etc.  This data is lazy-loaded when appropriate.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Organic, &lt;em&gt;Evolutionary&lt;/em&gt; library growth&lt;/font&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;em&gt;"We stress the importance of creating objects not to meet mythical future needs, but only under the demands of the moment. This ensures that a design contains only as much information as the designer has directly experienced, and avoids premature complexity."&lt;/em&gt; - Kent Beck &amp;amp; Ward Cunningham, &lt;a href="http://c2.com/doc/oopsla89/paper.html"&gt;A Laboratory For Teaching Object-Oriented Thinking&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We extend our libraries only as needed, to meet current requirements.  The caveat is that we must keep our libraries backwards-compatible.  This can be accomplished easily by writing tests as the library is developed, and making sure those tests stay with the library project, and are run every time the project is extended.&lt;/p&gt;
&lt;p&gt;For example, to get a list of our most active lawyers, we may write a library that contains objects for Timekeeper, and Timecard, then map these into our Time &amp;amp; Billing system that contains our timekeeper and financial (hours worked) data.  At a later date, we may need a list of clients a lawyer does work for, so we would create a Client object, and map it into the appropriate table(s).&lt;/p&gt;
&lt;p&gt;At this point, we have a single DLL (Whd.Enterprise.TimeBilling.dll) that is deployed with the new app.  Other deployments of this dll used by other apps are older, but they were deployed with the requirements &lt;em&gt;that app&lt;/em&gt; needed.  With tests in place, those older apps should not have to worry about the new TimeBilling library being incompatible.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Controllers&lt;/font&gt;&lt;/strong&gt; &lt;br /&gt;
This is a controversial idea, and my naming could be better (not to be confused with MVC controller), but it works very nicely to develop against (especially with Intellisense).  Each enterprise object has 2 classes, the POCO (plain old CLR object), and its controller class (Client, and ClientController respectively).  Controller classes are full of static methods to do the work.  &lt;/p&gt;
&lt;p&gt;One of the key methods in the controller is Read(), which does the object-relational mapping.  The Read() method is delegated to the Core's Sql class to handle, and returns the appropriate POCO it's responsible for.  Other methods are added as needed, and if the controller class ever gets too big or busy to work with, it can then be refactored out to partial class files.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Pragmatic App Development&lt;/font&gt;&lt;/strong&gt; &lt;br /&gt;
From the app-developer's perspective, integrating with the enterprise should be as simple as possible:&lt;br /&gt;
- Add projects to my solution for each library I will be using, extend it as needed to fulfill my needs (or just reference the dll!)&lt;br /&gt;
- Reference the enterprise projects in my app's solution. &lt;br /&gt;
- Simplest possible namespace structure as possible.  Ideally, "WHD.Enterprise." opens up all of the domain objects and controllers I would ever need.  &lt;br /&gt;
- [Object] &amp;amp; [Object]Controller is the only enterprise-related pattern I need to understand.  &lt;br /&gt;
- Centralized logging (&lt;a href="http://www.edsid.com/blog/archive/2008/04/01/enterpriselog-usage-logging.aspx"&gt;Logging usage&lt;/a&gt; has proved its value already)&lt;/p&gt;
&lt;p&gt;Hopefully this is a good start to explain my thought and dev processes.  Don't hesitate to post any questions and/or criticism, I am sure that in future posts I will delve deeper into some of the bits, maybe even post some code.&lt;/p&gt;&lt;img src="http://edsid.com/blog/aggbug/23321.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2008/08/27/enterprise-integration-with-pocos.aspx</guid>
            <pubDate>Wed, 27 Aug 2008 23:20:36 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/23321.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2008/08/27/enterprise-integration-with-pocos.aspx#feedback</comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/23321.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/23321.aspx</trackback:ping>
        </item>
        <item>
            <title>.Net Open Source</title>
            <link>http://edsid.com/blog/archive/2008/04/16/.net-open-source.aspx</link>
            <description>&lt;p&gt;I finally had time tonight to scrape through &lt;a href="http://spreadsheets.google.com/pub?key=pKxDW35algYebfs8nssTjIQ"&gt;Jeff Atwoods spreadsheet o' candidates&lt;/a&gt; for his Open Source .Net grant.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.screwturn.eu/Default.aspx?AspxAutoDetectCookieSupport=1"&gt;ScrewTurn Wiki&lt;/a&gt; got the $5k (+ $5k more matched by Microsoft),was a great choice... it is the only wiki I have ever considered putting into production.  There were some awesome projects in the list (even nProf, but it's dead now, 404 and all), quite a few new ones I'd never heard of... &lt;/p&gt;
&lt;p&gt;I've played with most of these before, just laying down single list of them on my site:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.hibernate.org/343.html "&gt;nHibernate&lt;/a&gt; - ORM framework that's been around forever&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.chimpswithkeyboards.com/projects/nprofiler/"&gt;NProfiler&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.getpaint.net/roadmap.html"&gt;Paint.NET&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://dotnet.jku.at/projects/Prof-It/"&gt;Prof-It for C#&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.rssbandit.org/"&gt;RSS Bandit&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.team-mediaportal.com/blogs/"&gt;MEDIAPORTAL&lt;/a&gt; - Haven't played with this one at all, but it looks promising&lt;/p&gt;&lt;img src="http://edsid.com/blog/aggbug/23305.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2008/04/16/.net-open-source.aspx</guid>
            <pubDate>Thu, 17 Apr 2008 03:08:30 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/23305.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2008/04/16/.net-open-source.aspx#feedback</comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/23305.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/23305.aspx</trackback:ping>
        </item>
        <item>
            <title>The Thirsty Developer, Project Euler</title>
            <link>http://edsid.com/blog/archive/2008/04/11/the-thirsty-developer-project-euler.aspx</link>
            <description>&lt;p&gt;I can't believe that I didn't post about this!  My site was acting up when we did this, so I probably didn't have a place to post it.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.larryclarkin.com/"&gt;Larry Clarkin&lt;/a&gt; &amp;amp; &lt;a href="http://www.davebost.com/blog/"&gt;Dave Bost&lt;/a&gt; from Microsoft have a podcast called &lt;a href="http://thirstydeveloper.com/"&gt;The Thirsty Developer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Back in December I met up with Larry, Dave, and &lt;a href="http://damonpayne.com"&gt;Damon Payne&lt;/a&gt; at the Ale House in downtown Milwaukee to talk about &lt;a href="http://projecteuler.net/"&gt;Project Euler&lt;/a&gt;.  I remember having a lot of fun, despite being a bit nervous (my first experience on that side of a podcast!).  It was very loud in there as well; I think Larry did a great job of editing.&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://thirstydeveloper.com/ct.ashx?id=2395c271-8796-433c-82c5-fc7c3d69fd29&amp;amp;url=http%3a%2f%2fthirstydeveloper.com%2fshows%2ftd006-ProjectEuler.mp3"&gt;Here is the Project Euler episode&lt;/a&gt;]&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://thirstydeveloper.com/"&gt;The Thirsty Developer&lt;/a&gt;]&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://feeds.feedburner.com/ThirstyDeveloperPodcast"&gt;Subscribe to The Thirsty Developer Podcast&lt;/a&gt;]&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://feeds.feedburner.com/ThirstyDeveloper"&gt;Subscribe to The Thirsty Developer Blog&lt;/a&gt;]&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://edsid.com/blog/aggbug/23303.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2008/04/11/the-thirsty-developer-project-euler.aspx</guid>
            <pubDate>Fri, 11 Apr 2008 16:28:31 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/23303.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2008/04/11/the-thirsty-developer-project-euler.aspx#feedback</comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/23303.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/23303.aspx</trackback:ping>
        </item>
        <item>
            <title>Linq to everything</title>
            <link>http://edsid.com/blog/archive/2008/04/08/linq-to-everything.aspx</link>
            <description>&lt;p&gt;Charlie Calvert has a list of Linq Providers &lt;a href="http://blogs.msdn.com/charlie/archive/2008/02/28/link-to-everything-a-list-of-linq-providers.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Amongst the ones listed were a few that popped out at me:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2007/04/05/the-iqueryable-tales-linq-to-ldap-part-0.aspx"&gt;Linq to LDAP&lt;/a&gt; and &lt;a href="http://www.codeplex.com/LINQtoAD"&gt;Linq to Active Directory&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeplex.com/LinqOverCSharp "&gt;Linq to C#&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeplex.com/LinqToGeo"&gt;Linq to Geospacial Data&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeplex.com/LinqToGeo"&gt;Linq to Lucene&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeplex.com/metawebToLinQ"&gt;Linq to Freebase&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/hartmutm/archive/2006/07/24/677200.aspx"&gt;Linq to RDF&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeplex.com/LINQtoSharePoint"&gt;Linq to Sharepoint&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bloggingabout.net/blogs/emile/archive/2005/12/12/10514.aspx"&gt;Linq to WMI&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update: &lt;/strong&gt;From the looks of things, there is no Linq to &lt;a href="http://images.google.com/images?um=1&amp;amp;hl=en&amp;amp;q=legend+of+zelda+link"&gt;Link&lt;/a&gt; yet.  I believe that &lt;a href="http://www.damonpayne.com/"&gt;Damon Payne&lt;/a&gt; is &lt;a href="http://www.damonpayne.com/2008/04/07/DeepInNETDebriefing.aspx"&gt;working on this provider&lt;/a&gt; though.  His work is clearly inspired by the &lt;a href="http://www.zeldaelements.net/downloads_raresongs.shtml"&gt;NIN cover of Legend of Zelda theme song&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://edsid.com/blog/aggbug/23301.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2008/04/08/linq-to-everything.aspx</guid>
            <pubDate>Tue, 08 Apr 2008 22:48:05 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/23301.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2008/04/08/linq-to-everything.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/23301.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/23301.aspx</trackback:ping>
        </item>
        <item>
            <title>Community-Sourcing</title>
            <link>http://edsid.com/blog/archive/2008/04/02/community-sourcing.aspx</link>
            <description>&lt;p&gt;I have been a HUGE fan of Digg.com for years.  The content is generally good, the community is fun and (again, generally) intelligent, but the model: Submit/Vote/Discuss/Report... brilliant.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mystarbucksidea.force.com/home/home.jsp"&gt;MyStarbucksIdea.com&lt;/a&gt;, and Dell's &lt;a href="http://www.ideastorm.com/"&gt;IdeaStorm.com&lt;/a&gt; follow the Digg.com model, but in the context of innovation focused on a business.  They are crowdsourcing their innovation to the world, and their future offerings are going to be more organic than ever before.  The new tool on their belt gives them a clearer idea of their &lt;em&gt;actual&lt;/em&gt; customers' wishes.  Minimize the assumptions.  Outsource your innovation to the one group the really cares about your product, and spend next to nothing for the data you get from it... brilliant.&lt;/p&gt;
&lt;p&gt;Wikipedia (currently) defines Crowdsourcing as "...  the act of taking a task traditionally performed by an employee or contractor, and outsourcing it to an undefined, generally large group of people, in the form of an open call."&lt;/p&gt;
&lt;p&gt;I am in the habit of repurposing (or desigining my own) social-network ideas as internal solutions, and along the way I have occasionally had my share of failage/lesson-learnage, but I've also scored some wins.  Like everybody else that thinks they have a new idea worthy of its own name, I have started calling it 'community sourcing'.&lt;/p&gt;
&lt;p&gt;I reformed the definition above to fit my needs:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Community Sourcing&lt;br /&gt;
&lt;/strong&gt;&lt;font face="Arial"&gt;The act of taking a task traditionally &lt;/font&gt;&lt;font face="Arial"&gt;performed by a specific member of the group,  or consultant and exposing it to a controlled, generally large group of people who share the same &lt;/font&gt;&lt;font face="Arial"&gt;interest as the group, in the form of an open call.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The term seems to be out there (&lt;a href="http://www.google.com/search?hl=en&amp;amp;q=%22community+sourcing%22"&gt;google 2080 hits&lt;/a&gt;), and the purpose looks similar.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;As far as walking-the-walk goes, we have working 'community sourced' systems used every day for content-management, marketing, and project management.  Newer and (therefore, I hope) less-used solutions include link-tracking (think del.icio.us), and yes, a submit/vote/discuss/report app, which, in my humble opinion, is... brilliant.&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://edsid.com/blog/aggbug/23299.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2008/04/02/community-sourcing.aspx</guid>
            <pubDate>Wed, 02 Apr 2008 19:10:06 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/23299.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2008/04/02/community-sourcing.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/23299.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/23299.aspx</trackback:ping>
        </item>
        <item>
            <title>EnterpriseLog, usage-logging</title>
            <link>http://edsid.com/blog/archive/2008/04/01/enterpriselog-usage-logging.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;Most development work contains some type of logging.  Usually, it's to a local log file or an email, for exception tracking at the most.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Recently, I decided to throw together an EnterpriseLog table.  We tossed our logging bits into a central library... I don't know why it took so long to centralize this particular functionality, but I'm glad we did it.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Our EnterpriseLog table is providing useful data, as well as helping us answer some good questions:&lt;br /&gt;
- What applications are people using?&lt;br /&gt;
- Tracking ClickOnce downloads, system updates made by clickonce apps, etc.&lt;br /&gt;
- What terms are people searching for?&lt;br /&gt;
- Exceptions&lt;br /&gt;
- Usage&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Usage Logging&lt;/strong&gt;&lt;br /&gt;
Usage logging is has been very interesting so far.  An immediate benefit we have found is keeping track of how formatted information is being entered in unexpected ways.  It is amazing how many different ways there are to enter a phone number!  With a quick look at EnterpriseLog usage data for an application, &lt;strong&gt;we are able to recognize, learn, and accommodate &lt;em&gt;actual &lt;/em&gt;usage patterns&lt;/strong&gt;.  Continuing with the phone # topic:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;With any phone number, a quick regex levels the playing field by stripping out all non-digit characters:&lt;br /&gt;
string nums = Regex.Replace(textBox.Text, @"[^\d]", "");&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;If the result string is 10 chars (in the US), format appropriately for area code and exchange.  If it is 7 characters, try to infer the area code from the exchange.  If it is only 4 characters, assume it is an extension and build the real number from there if possible.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;In this case, usage logging helped me to skip the annoying validation and instructions and let my users do what they do.  We have been able to identify actual usage, throw assumptions out the window, and help them arrive at the appropriate result invisibly:&lt;br /&gt;
textBox.Text = String.Format("({0}) {1}-{2}", areaCode, exch, num);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Most of us base our UI development on assumptions about our users, past experience, and hopefully a &lt;a href="http://www.amazon.com/Dont-Make-Me-Think-Usability/dp/0321344758/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1207090821&amp;amp;sr=8-1"&gt;book&lt;/a&gt; or &lt;a href="http://www.amazon.com/Humane-Interface-Directions-Designing-Interactive/dp/0201379376/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1207090863&amp;amp;sr=1-1"&gt;two&lt;/a&gt;.  It is the assumptions part I have trouble with.  I'm a data guy.  I prefer to question the assumptions, set up some auditing and collect some data, and turn the assumptions into concrete UI features that keep the user in the flow.  &lt;/p&gt;&lt;img src="http://edsid.com/blog/aggbug/23298.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2008/04/01/enterpriselog-usage-logging.aspx</guid>
            <pubDate>Tue, 01 Apr 2008 23:03:50 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/23298.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2008/04/01/enterpriselog-usage-logging.aspx#feedback</comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/23298.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/23298.aspx</trackback:ping>
        </item>
        <item>
            <title>Salesperanto AND Coderian?</title>
            <link>http://edsid.com/blog/archive/2008/03/14/salesperonto-and-coderian.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;"Stop Thinking Like A Programmer"&lt;/strong&gt;&lt;/font&gt;&lt;a title="YinYang by GerryHeidenreich, on Flickr" target="_blank" href="http://www.flickr.com/photos/gheidenreich/2332531057/"&gt;&lt;strong&gt;&lt;img height="143" alt="YinYang" width="150" align="right" border="0" src="http://farm4.static.flickr.com/3139/2332531057_a773642fae_o.jpg" /&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I swear it's the theme this week.. I was actually told this by someone at work.  In my own defense, I was thinking like somebody that would rather script a solution than wait 3 weeks for it (ok yeah, that's like a programmer).... &lt;/p&gt;
&lt;p&gt;Think about this...&lt;/p&gt;
&lt;p&gt;1. &lt;strong&gt;Business&lt;/strong&gt;: Coders should be able to think in terms of features, interface complexity, barrier to entry, design and visualization, and capable of elevator pitching their product (notice I didn't say solution?) to a customer in these terms.&lt;/p&gt;
&lt;p&gt;2. &lt;strong&gt;Innovation&lt;/strong&gt;: getting the "I can do that" people (e.g. your engineers/architects/coders) to be able to speak directly to the "it would be cool if..." people (e.g. your billers, customers, parents, etc)&lt;/p&gt;
&lt;p&gt;3. &lt;strong&gt;Apple&lt;/strong&gt;'s innovation/momentum and Microsoft's shift in perspective &amp;amp; ability to compete:  Microsoft has &lt;em&gt;always &lt;/em&gt;been guilty of "thinking like programmers", and it has been very profitable for them, but things are changing, and they &lt;em&gt;are&lt;/em&gt; reacting accordingly.&lt;/p&gt;
&lt;p&gt;4. &lt;strong&gt;Black &amp;amp; White:&lt;/strong&gt; on one side are the geeks that appreciate your architecture and could debate code/frameworks/paradigms all day.  On the other side are your customers, who want to know how you are going to make them more profitable/efficient/confident/marketable/competitive.  Not much of a grey area here.  2 different languages: Salesperanto AND Coderian. &lt;/p&gt;
&lt;p&gt;5. &lt;strong&gt;Intentional Programming&lt;/strong&gt; [&lt;a href="http://en.wikipedia.org/wiki/Intentional_programming"&gt;wikipedia&lt;/a&gt;]: Your skillset is in demand, but we are getting closer to the day that "&lt;a href="http://www.nytimes.com/2007/01/28/business/yourmoney/28slip.html?_r=1&amp;amp;oref=slogin"&gt;Everyone Writes Software&lt;/a&gt;"... &lt;a href="http://www.aisto.com/roeder/Paper/"&gt;Lutz has a section&lt;/a&gt; dedicated to this.  Developers &lt;em&gt;must&lt;/em&gt; learn to understand the intent of their users.  Stop &lt;em&gt;thinking&lt;/em&gt; in syntax, start thinking in &lt;a href="http://en.wikipedia.org/wiki/Semantics"&gt;semantics&lt;/a&gt;...  Mashups, &lt;a href="http://en.wikipedia.org/wiki/Feature_Driven_Development"&gt;FDD&lt;/a&gt;, REST, RDF, &lt;a href="http://pipes.yahoo.com/pipes/"&gt;Pipes&lt;/a&gt; &amp;amp; &lt;a href="http://www.popfly.com/"&gt;Popfly&lt;/a&gt; (&lt;a href="http://labs.google.com/sets?hl=en&amp;amp;q1=microsoft+popfly&amp;amp;q2=yahoo+pipes&amp;amp;q3=&amp;amp;q4=&amp;amp;q5=&amp;amp;btn=Large+Set"&gt;Google SETS prediction&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;There is a pattern developing here, and there is A LOT of money being tossed around because of it (&lt;a href="http://www.techcrunch.com/2008/03/14/aol-on-a-bender-kickapps-may-be-next-acquisition/"&gt;check this out&lt;/a&gt;!).  &lt;/p&gt;&lt;img src="http://edsid.com/blog/aggbug/23295.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2008/03/14/salesperonto-and-coderian.aspx</guid>
            <pubDate>Fri, 14 Mar 2008 16:03:47 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/23295.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2008/03/14/salesperonto-and-coderian.aspx#feedback</comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/23295.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/23295.aspx</trackback:ping>
        </item>
        <item>
            <title>Self-installing Windows Services</title>
            <link>http://edsid.com/blog/archive/2007/11/27/23290.aspx</link>
            <description>&lt;P&gt;&lt;BR&gt;I recently did some Windows Service work (pluggable enterprise-wide notification service, very cool... totally worth it's own article someday when I have time), and I'm thinking that the service installage/uninstallage is squirrelly... I&amp;nbsp;made some batch files to do it for me and never thought about it again.&amp;nbsp; W. Kevin Hazzard reflected installutil.exe, and integrated (un)install right into his service.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;He has a good article on CodeProject to make Windows Service&amp;nbsp;installing and uninstalling&amp;nbsp;easier:&lt;BR&gt;&lt;A href="http://www.codeproject.com/dotnet/WinSvcSelfInstaller.asp"&gt;http://www.codeproject.com/dotnet/WinSvcSelfInstaller.asp&lt;/A&gt;&lt;/P&gt;&lt;img src="http://edsid.com/blog/aggbug/23290.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2007/11/27/23290.aspx</guid>
            <pubDate>Tue, 27 Nov 2007 14:21:00 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/23290.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2007/11/27/23290.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/23290.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/23290.aspx</trackback:ping>
        </item>
        <item>
            <title>.Net now "Shared Source" NOT Open Source</title>
            <link>http://edsid.com/blog/archive/2007/10/03/17635.aspx</link>
            <description>&lt;P&gt;&lt;BR&gt;Scott Guthrie &lt;A href="http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx"&gt;announced&lt;/A&gt; on his blog, a few hours ago, that&amp;nbsp;.Net source code will be opened up to the public, under a &lt;A href="http://www.microsoft.com/resources/sharedsource/licensingbasics/referencelicense.mspx"&gt;ms-rl license&lt;/A&gt;&amp;nbsp;(for reference, read-only).&lt;/P&gt;
&lt;P&gt;Scott's announcement, already flooded with lots of comments &amp;amp; trackbacks, mostly positive, is &lt;A href="http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx"&gt;here&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Starting with Visual Studio 2008 (Orcas), currently set to be released later this year, we will be able to reference the internal state of .Net objects as if they were local.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;This means a few things: &lt;BR&gt;1.&lt;/STRONG&gt; F11 will step you &lt;EM&gt;into&lt;/EM&gt; the actual .Net object being called, where you can reference in-state .Net classes.&lt;BR&gt;&lt;STRONG&gt;2.&lt;/STRONG&gt; You will see real objects, variables, line numbers in your call stack for the&amp;nbsp;.Net classes being referenced.&amp;nbsp;&lt;BR&gt;&lt;STRONG&gt;3.&lt;/STRONG&gt; (I assume) you will be able to &amp;#8220;Go to definition&amp;#8220; and view actual .Net class source code instead of an interface.&amp;nbsp; Of course, we've always had the ability to reflect on the libraries, and with a little work, figure out what was happening... but this will make things a lot more simple and accessible (have a look at&amp;nbsp;&lt;A href="http://www.aisto.com/roeder/dotnet/"&gt;Reflector&lt;/A&gt; to&amp;nbsp;figure out the Asp.Net treeview control!)&lt;BR&gt;&lt;STRONG&gt;4.&lt;/STRONG&gt; WWBAD (What would &lt;A href="http://blogs.msdn.com/brada/"&gt;Brad Abrams&lt;/A&gt; do?)&amp;nbsp; Now we can see for real instead of reverse engineer it and spend our time figuring out what&amp;nbsp;the variable datetime17 is doing.&amp;nbsp; In other words, quality of code should improve.&amp;nbsp; As we constantly reference the .Net library, some of the&amp;nbsp;msft&amp;nbsp;QA, v3.5 juju should rub off on us and help us fall a little more in line with standards, best practice, etc.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Anyway, it's read-only.&amp;nbsp; It's not Open source.&amp;nbsp; But it's&amp;nbsp;another big step in what I think is the right direction for Microsoft...&lt;/P&gt;
&lt;P&gt;Some good&amp;nbsp;MS pages to check out on open/shared source initiatives:&lt;BR&gt;- &lt;A href="http://www.microsoft.com/opensource/default.mspx"&gt;Open Source at Microsoft&lt;/A&gt;&lt;BR&gt;- &lt;A href="http://www.microsoft.com/opensource/default.mspx"&gt;Microsoft Shared Source Initiative&lt;/A&gt;&lt;BR&gt;- &lt;A href="http://www.microsoft.com/resources/sharedsource/Licensing/Developer.mspx"&gt;MS Developer Tools&lt;/A&gt; (A &lt;EM&gt;goldmine&lt;/EM&gt; of open/shared source projects, most on CodePlex)&lt;/P&gt;&lt;img src="http://edsid.com/blog/aggbug/17635.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2007/10/03/17635.aspx</guid>
            <pubDate>Wed, 03 Oct 2007 16:49:00 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/17635.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2007/10/03/17635.aspx#feedback</comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/17635.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/17635.aspx</trackback:ping>
        </item>
        <item>
            <title>Euler12 (spoiler warning) - GetDivisors</title>
            <link>http://edsid.com/blog/archive/2007/05/03/13026.aspx</link>
            <description>&lt;P&gt;&lt;BR&gt;Thanks to &lt;A href="http://www.damonpayne.com/PermaLink,guid,bde3428a-af73-4681-bc92-58a0372b7c9e.aspx"&gt;Mr. Payne&lt;/A&gt;, I've been spending more hours awake coding, and less time sleeping, in the name of &lt;A href="http://www.projecteuler.net/index.php?section=about"&gt;'fun and recreation&lt;/A&gt;'... &lt;/P&gt;
&lt;P&gt;As Damon points out in his&amp;nbsp;&lt;A href="http://www.damonpayne.com/PermaLink,guid,fdb0de99-446c-428b-ba98-14ef8c5dfaf0.aspx"&gt;esoteric&amp;nbsp;and colorful post&lt;/A&gt; yesterday, I've been working my way through the Euler (&lt;A href="http://www.waukesha.uwc.edu/mat/kkromare/up.html"&gt;prounounced 'oy ler!&lt;/A&gt;) puzzles at &lt;A href="http://www.projecteuler.net/index.php?section=view"&gt;Project Euler&lt;/A&gt;.&amp;nbsp; I've banged out solutions for puzzles 1-13, but #10 is the only one I can't get under 1 minute (In fact, it's the only one that isn't solved almost instantly).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.projecteuler.net/index.php?section=problems&amp;amp;id=12"&gt;Problem 12&lt;/A&gt; is interesting: &lt;EM&gt;Which is the first triangle number to have over 500 divisors?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Finding triangle numbers is trivial; the actual&amp;nbsp;challenge in this puzzle is efficiently counting divisors for increasingly huge numbers.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The initial approach that almost works:&lt;BR&gt;&lt;/STRONG&gt;For number n, iterate from 1 to n, increment divisorCount where i&amp;nbsp;% n ==&amp;nbsp; 0&lt;BR&gt;(Once you try this out, you will find that with this approach, your highest divisor count will quickly reach 320 divisors, and will ultimately hang at around 480 before it starts to crawl...)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Finding the first triangle number to have over 1000 divisors, in under 10 seconds:&lt;BR&gt;&lt;/STRONG&gt;When things get even slightly complex, I turn to pen &amp;amp; paper... within minutes I saw the pattern I was looking for.&amp;nbsp; The following method will return a list of divisors for an int:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=code&gt;&lt;PRE&gt;static List&amp;lt;int&amp;gt; GetDivisors(int num) {
   List&amp;lt;int&amp;gt; divisors = new List&amp;lt;int&amp;gt;();
   int divisorCandidate = 1;
   int multiple = 1;
   do {
      if (num % divisorCandidate == 0) {
         multiple = num / divisorCandidate;
         divisors.Add(divisorCandidate);
         //for squares, divisorCandidate == multiple (3*3=9 etc), so only count it once
         if (divisorCandidate &amp;lt; multiple) divisors.Add(multiple); 
      }
      divisorCandidate++;
   } while (divisorCandidate &amp;lt; multiple);
   divisors.Sort();
   return divisors;
}&lt;/PRE&gt;&lt;/SPAN&gt;
&lt;P&gt;I doubt it's even remotely useful in production, but this method is a great example of how&amp;nbsp;a little analysis of the problem (especially away from the keyboard) can result in a much more elegant solution to your problem than brute force.&lt;/P&gt;&lt;img src="http://edsid.com/blog/aggbug/13026.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Gerry Heidenreich</dc:creator>
            <guid>http://edsid.com/blog/archive/2007/05/03/13026.aspx</guid>
            <pubDate>Thu, 03 May 2007 18:19:00 GMT</pubDate>
            <wfw:comment>http://edsid.com/blog/comments/13026.aspx</wfw:comment>
            <comments>http://edsid.com/blog/archive/2007/05/03/13026.aspx#feedback</comments>
            <wfw:commentRss>http://edsid.com/blog/comments/commentRss/13026.aspx</wfw:commentRss>
            <trackback:ping>http://edsid.com/blog/services/trackbacks/13026.aspx</trackback:ping>
        </item>
    </channel>
</rss>