Skip to main content

Posts

Windows Azure Billing Overview

Some useful links around Azure billing: Windows Azure Billing overview: http://blogs.msdn.com/b/patrick_butler_monterde/archive/2010/02/10/windows-azure-billing-overview.aspx Windows Azure Offers: http://www.microsoft.com/windowsazure/offers/ Windows Azure Platform Offer Comparison: http://www.microsoft.com/windowsazure/offers/popup/popup.aspx?lang=en&locale=en-US&offer=COMPARE_PUBLIC Windows Azure 30 days pass: http://www.windowsazurepass.com/ Some customers also asked me where they can find their billing info. Therefore go to http://windows.azure.com and login with your live id.   On the Windows Azure Portal, you can find a link to the billing information in the right corner. If you click this link, you will be redirected to the Microsoft Online Customer Service Portal (MOCP) where the info is available.

Enterprise Library 5 Exception Handling

Last week I discovered a nice feature inside the Enterprise Library 5 Exception Handlin g application block. On the ExceptionManager class a new method is available called Process(). This method automatically performs exception management and throws the exception based on the configuration. It accepts the policy name and a delegate or a lambda expression; the application block manages any exception that occurs while executing the method or lambda expression, also if the postHandlingAction is set to ThrowNewException then the application block throws the exception as a result of the respective execution of the configured exception handlers. This minimizes the amount of exception logic you need to write a lot. Typical usage of the Process method will be similar to the code snippet given next: 1: //Get instance of ExceptionManager using static method of Enterprise Library Container 2:   3: ExceptionManager exManager = EnterpriseLibraryContainer.Current.GetInstance<Ex...

Replacing inheritance by closures

For a long time I have been using inheritance to allow other developers to extend my code. Imagine I have the following class responsible for managing a unit of work: 1: public class UnitOfWork:IUnitOfWork 2: { 3: public virtual ITransaction CreateTransaction() 4: { 5: return new Transaction(){TimeOut= new Timespan(0,0,60)}; 6: } 7: } Important here is the CreateTransaction() method which  just creates a transaction with some default time out settings. Now what if you want to change this timeout value. I could change the implementation so that you can pass some extra settings when calling this method. But the next time I want to add another setting, I have to change my class again. Therefore I made this method virtual allowing the developer to override my default implementation. The problem is that in this case I find it overkill to create a new class just for changing this one small setting. Another option is the usage of closures....

Technology discussions today and tomorrow

For as long as I can remember, developers(but also all other kind of IT people) have religious descussions about ‘there’ technology; Java vs .NET, stored procedures vs dynamic SQL, client side vs server side and so on.. And just when you think people start agreeing the next discussion knocks on your front door. One interesting discussion I followed closely last year(it already seems so long ago) was ASP.NET WebForms vs MVC . I especially liked the post by Scott Guthrie showing some common sense on the debate. I totally agree with Scott’s point about the nature of technical debates, and the acceptance that some technologies suit better for some problems. However with the emergence of new web technologies like CSS 3 and HTML 5, the growth of REST and the renewed interest in Javascript, I want to re-open the discussion. I think that architecting ASP.NET MVC applications will have a lot more potential than WebForms. Just think for a second what you have to do to transform your curren...

TFS vs Subversion continued

A while ago I blogged about some differences between Team Foundation Server Source Control and Subversion . It seems that I am not the only one who compared features between the 2 systems. As a lot of things are improved in TFS 2010, an update is required. For an interesting discussion I suggest you read this post by Martin Hinshelwood. To summarize the important Source Control improvements in TFS 2010: Better branching visualization(In TFS 2008 branches were just folders) Multi-platform support Easy to install Gated check-in’s Source and Symbol server support(my favorite!)

RhinoMocks: execute a specific action when a method is called

When writing unit tests sooner or later you are confronted with mocking . I always try to keep my mocking code as simple as possible. Sometimes this means creating a mock object manually and sometimes it means using a mocking framework. The mocking framework I use the most is RhinoMocks created by Ayende Rahien . Last week I had to mock a call to a specific method and execute some code when this method is called to test some specific behavior. Creating a mock object myself for this would be rather cumbersome, with Rhinomocks this becomes really simple: 1: var repository=MockRepository.GenerateMock<IDeliveryRepository>(); 2: repository.Expect(rep => rep.ReadDeliveryData( null , null )) 3: .IgnoreArguments() 4: .Do( new Action(()=>task.Process(data, delivery))); 5:   It’s important that the code you execute in the Do() matches the signature of the method that is called in the Expect(). The first time I impl...

Cannot convert lambda expression to type 'System.Delegate' because it is not a delegate type

Last week I was trying to pass a lambda as a parameter to a method that expected a delegate. However doing this resulted in the following compiler error “Cannot convert lambda expression to type 'System.Delegate' because it is not a delegate type.”     1: public void CreateAndExecuteLambda() 2: { 3: //Does not compile 4: InvokeDelegate(() => MessageBox.Show( "Hello World" )); 5: } 6:   7: public void InvokeDelegate(Delegate @ delegate ) 8: { 9: @ delegate .DynamicInvoke(); 10: } At first I found this very strange, if I remembered it well a lambda expression is just a new syntax for anonymous methods and anonymous methods are nothing more than inline delegates. So why the compiler does not agree? The reason is that a lambda expression can either be converted to a delegate type or an expression tree - but it has to know which delegate type. Just knowing the signature isn't enough. For instance, suppose ...