Syndication

News

     

Archives

Miscelaneous

Programming

March 2009 - Posts

There are few groups within Microsoft that are as open and so quick to deliver as patterns & practices. When you give them feedback or request features, chances are you'll see them implemented within months, rather than years (if they get enough support of the rest of the community!).

It's now time to engage in shaping EntLib 5.0! From Grigori's blog:

At this point, we would like to invite you to select and prioritize candidate features/stories you care about. Please review them carefully along with the associated effort estimates and cast your votes.  Do remember to stay within the budget (100 points). Here's the link to the ...

Read full article

Posted by Daniel Cazzulino
Filed under: ,

If you're doing any kind of WPF development, you probably read at least some of the links in this entry on WPF Patterns.

One common theme across all variants of the ViewModel pattern is that it always has to implement the INotifyPropertyChanged interface, which is the core interface driving the whole data-binding infrastructure in both WinForms and WPF. Implementing this interface is quite boring and repetitive, more so if you're using C# 3.5 automatic properties:

public class Customer
{
    public string FirstName { get; set; }
    public Address Address { get; set; }
    // other properties
}...

Read full article

Posted by Daniel Cazzulino

Objective of the method: determine whether the given EnvDTE code class contains the given GeneratedCodeAttribute:

"old" foreach/if approach:

private bool IsPresentationModel(CodeClass2 baseClass)
{
    foreach (CodeClass2 pc in baseClass.PartialClasses)
    {
        foreach (CodeAttribute2 attr in pc.Attributes)
        {
            if (attr.FullName == typeof(GeneratedCodeAttribute).FullName &&
                attr.Value.Contains(ThisAssembly.Title))
            {
                return true;
            }
        }
    }

    foreach (CodeAttribute2 attr in baseClass.Attributes)
    {
        if (attr.FullName == typeof(GeneratedCodeAttribute).FullName &&
            attr.Value.Contains(ThisAssembly.Title))
        {
            return true;
        }
    }

    return false;
}
...

Read full article

Posted by Daniel Cazzulino
Filed under: ,

XML-dying

(does that answer Jeremy's question too?)

Read full article

Posted by Daniel Cazzulino
Filed under: ,

Over the years doing TDD, I'm getting increasingly concerned about the value my test fixtures are bringing to the table in terms of documenting features and expected behavior.

So far, I followed the typical pattern in TDD of creating one class (fixture) per object under test: if I have DirectoryService, I create DirectoryServiceFixture. Inside the fixture (and for the past couple years now), I've been pushing teams I work with to stick to a convention where every test method is prefixed with the word "Should": this seems to be at least a bit ...

Read full article

Posted by Daniel Cazzulino
Filed under: ,

You know that using WebOperationContext.Current is BAD for making your service implementation testable, don't you?

My friend Pablo Cibraro continued to evolve his ideas around decoupling your service implementation from this static dependency, and came up with the most simple yet totally unobtrusive (for production code) approach to this, which he calls WCFMock.

The idea is quite simple: you can leverage C# class aliasing functionality (which few know it even exists) to conditionally (i.e. DEBUG vs RELEASE builds) replace the WebOperationContext implementation, like so:...

Read full article

Posted by Daniel Cazzulino
Filed under: ,

I've just released the latest version of Moq :))))

It's quite late on an intense week at Redmond, so I'm just going to paste the relevant portion of the changelog:


Version 3.0


* Silverlight support! Finally integrated Jason's Silverlight contribution! Issue #73


* Brand-new simplified event raising syntax (#130): mock.Raise(foo => foo.MyEvent += null, new MyArgs(...));


* Support for custom event signatures (not compatible with EventHandler): mock.Raise(foo => foo.MyEvent += null, arg1, arg2, arg3);...







Read full article

Posted by Daniel Cazzulino
Filed under: ,

Last weekend, during the ALT.NET Seattle conference, I spoke for quite a while with Miguel de Icaza on the work we're doing with InSTEDD in the area of data synchronization. He was very excited, and wondered how come this wasn't more broadly known.

I realized that I hadn't blogged about it in a while, and it seems to me that this seemingly niche technology isn't getting the broad publicity it deserves. So I'll try to explain in simple terms what it is, and why it matters in many, many scenarios.

Imagine you have an application (mobile or desktop), which can be partially connected, and needs to synchronize data with a server, bi-directionally. That's not very innovative or disruptive, is it? Of course NOT. We have been doing this with various degrees of success and complexity for years....

Read full article

Posted by Daniel Cazzulino
Filed under: ,
More Posts