More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  Brownie PointsProfileFriendsBlogMore Tools Explore the Spaces community

Brownie Points

The Tale of a .NET Conv...Fanatic.
August 30

What I'm Working On

Here's a screen shot/teaser of "Flow", a pet project of mine.

image

It may not look like much, but it's deceptive. Seeing it in action is a totally different experience. I'm not quite ready to show that to you though :P

August 27

PnP Design for Operations

So while I was testing out "Flow", I came across a link to a Patterns and Practices project that I hadn't seen before called Design for Operations. Basically, this project provides guidance and tools for placing instrumentation and management hooks into your application so that it can work with System Center and other management tools. There have been a number of times where I thought it would be nice to add this kind of functionality into an enterprise app and leverage the capabilities of SCOM (formerly MOM) to provide rich management and metrics; but I didn't have a clue where to start. This package looks like it would give a huge jumpstart into doing just that.

August 26

Turn Off Vista Autotuning

If you have an older router, Vista's network auto tuning feature will cause it to get confused. Some suggest turning off Stateful Packet Inspection (or SPI) on the router will fix the issue. Others say updating the firmware will work. If your router does not have an option to turn off SPI or you do not want to do so, or if your router manufacturer no longer provides firmware updates, the last option is to turn off autotuning.

Here's the magic command line to do so:

c:\>netsh interface tcp set global autotuninglevel=disabled 

I recently rebuilt a laptop and had a hard time finding this solution again. Now it's documented in a well known place for me (and you as well).

August 22

LiveID SDK

I'm trying out the sample app in the Windows Live ID SDK.
August 14

NDepend

Recently, Patrick Smacchia dropped by and left a note showing how he used NDepend to see numerically what has changed between 3.5 and 3.5 SP! This prompted me to look a little closer at the tool. If you want to capture metrics on your .NET code, NDepend does a great job at doing it.

Similar to the capabilities that TestDriven.NET gives to the lower entries in the Visual Studio product line in the arena of Unit Testing, NDepend provides code metrics for those who aren't using Team System. I would argue it goes a bit beyond the built-in Team System code metrics tools. NDepend has a query language called CQL that allows you to specify what metrics are important to you and what your alert levels are for those metrics.

There is a lot to explore in this area, especially when looking at continuous integration and build verification. Before I even spend my time looking at code for a review, I can have NDepend look over the code and tell me what's missing. Once I've made the queries, NDepend will consistently catch code that breaks my rules. Giving me more time to focus on building another O/RM.

August 08

VS2008/.NET Framework 3.5 SP1 Coming Soon

According to this blurb on MSDN Subscriber Downloads

image

the VS2008/.NET 3.5 SP1 download will be available on the 11th. Some people have noticed that SQL Server 08 installs .NET 3.5 SP1. So it's almost here. I played around with the SP1 beta and liked what I saw. So it's going to a tough weekend for me.

August 07

SQL Server 08 Get It While It's Hot

The final piece of the 2008 Launch, SQL Server 2008 (formerly known as Katmai), has finally gone Gold. For those with an MSDN subscription, you can download the bits now on subscriber downloads.

I'm not the person to ask for a full-blown tour of Katmai, but some of the features that have had my radar pinging include:

  1. Spatial Data: With native support for geographic data, SQL 2008 provides a powerful platform for storing and retrieving your data based on location.
  2. Separate Date and Time Data Types: If you're only concerned about a date, you no longer have to store it as August 6, 2008 12:00:00.00 AM. Likewise if you're only concerned about a given time (for instance if you want a recurring appointment to happen every day at 10:00 AM), you no longer are burdened with specifying a date in addition.
  3. Table Value Parameters: Table value parameters allow you to pass a table of data into a stored procedure. While you could emulate the same effect using XML in SQL Server 2005, native support for passing in tabular data means your stored procedures do not have to deal with parsing XML or complicated XQuery.
  4. HierarchyID: This is an interesting beast. It is a system defined SQL-CLR data type that can be used as a column type in your table. Basically the HierarchyID allows you to store a hierarchical relationship between rows in your table. (Look for an update to the Employees tables in the Northwind samples to demonstrate how to take advantage of this new feature).

There are a number of other new features in SQL Server 2008 and we haven't even left the realm of the database engine itself. Reporting Services (including a server that does not rely on IIS), Analysis Services, and Integration Services have all received significant upgrades.

I guess this gives me a nice toy to play with while waiting for the release of .NET 3.5/VS 2008 SP1.

July 25

Fixing WPF Command Routing

Bill Kempf, a fellow WPF Disciple, was lamenting the fact that by default a CommandBinding can only refer to a handler defined in the code behind of the Window/Page/UserControl in which it's defined. He wished that a syntax similar to the following was possible

 

<Window>
    <Window.CommandBindings>
        <CommandBinding Command="foo:MyCommands.FooCommand" Executed="{Event Target={StaticResource MyPresenter}, Handler=OnFooCommand}"/>
    </Window.CommandBindings>
</Window>

I took that scenario as my starting point. The first issue I saw was that I needed a markup extension that let's you specify a Target Object and the name of a handler on that Target returning a ExecutedRoutedEventHandler. So I made one.

The Markup Extension exposes two properties: Target (of type object) and Handler of Type String. The ProvideValue override (shown below) uses reflection to get a handle on the function and creates a lambda that invokes it for the result. (I love lambdas as much as I loved anon functions before them.)

public override object ProvideValue(IServiceProvider serviceProvider)
{
    ExecutedRoutedEventHandler retval=null;
    if (Target == null)
    {
        throw new Exception("Target cannot be Null.");
    }
    var type = Target.GetType();
    var function = type.GetMethod( Handler, new[]{typeof (Object),typeof (ExecutedRoutedEventArgs)});
    if (function != null)
    {
        retval = ((obj, args) => function.Invoke(Target, new[] {obj, args}));
    }
    return retval;
}

So I plug my new markup extension into a sample window, anticipating some good command routing lovin'. Of course it's never as easy as it looks at first. The Executed property on CommandBinding, although an event, expects a string in markup (the XAML compiler does some trickery to turn the string into an event handler). Well I know, I'll create an Attached Property to do my magic...

(To be continued...)

July 20

Generic Extension Methods

I've discovered that if an extension method is generic and the generic type is used as the "this" parameter, you do not have to write out the generic discriminator. The compiler is smart enough to infer it for you. For example, the range validation function I shared a few weeks ago can be called like so:

int myInt=5;
myInt.ValidateRange(2,20);

Jeff would be happy.

July 18

Frameworks! Frameworks! Frameworks!

If I haven't blogged about t before, I meant to but have been extremely busy. The first release of Prism or Composite App Guidance for WPF is available. Oh wait...I've blogged about it already (Did I mention how much I love Live Writer?). If you're looking at WPF for enterprise "Line of Business" applications, you should really look at it, not just for the framework but for the guidance assets themselves. I participated in the advisory board for the guidance and had a blast giving feedback to the PnP team and seeing that feedback integrated into the package. I even got my name on the MSDN page for the package

fameandfortune 

It's the little things that make me smile :P

Anyway, this post isn't about me. It's about some cool announcements coming from Microsoft. (Slow down guys or there won't be much left to announce by the time PDC arrives.) First up is the Managed Extensibility Framework or MEF for short. The short explanation for it is native Dependency Injection in the .NET Framework. There is a CTP available for it, which I'm downloading as we speak.

Next on the list is the upcoming second edition of Framework Design Guidelines. The first edition is a book that I recommend that anyone doing significant .NET development have on their shelf...within easy reach. Krzysztof Cwalina, Brad Abrams, and others on the Framework team have continued to provide addenda for the book. But there has been a major release of the framework since the first edition was published, and there is enough new stuff to talk about to merit a new edition. I've already got it pre-ordered.

Speaking of the MEF and the PnP team, Glenn Block recently announced his move from PM for PnP to PM on the MEF team. I can't think of a better person to provide leadership for this initiative.

View more entries
 

Brownie

View spaceSend a message
Occupation:
Age:
Location:
I'm an "unofficial" Microsoft Tech Evangelist for Client Application Development.
"Unofficial" means that all of my observations are completely my own and I imply absolutely no endorsement by Microsoft, any of their agents, my employer, or any of their agents.

All code is provided "as is" with no warranty either expressed or implicit.