Thursday, November 15, 2012

At a .NET Rocks event a few weeks ago an attendee asked if there would be some add-on to Windows 7 that allowed running WinRT apps.

My answer: Yes! It is called Windows 8  :)

Thursday, November 15, 2012 10:57:19 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  | 
 Monday, November 12, 2012

Stephen Sinofsky’s departure from Microsoft was rather unexpected, but not unpleasant news, at least from my perspective as a business developer.

Before I explain that, let me say that I really love Windows 7, and feel that it is the best version of Windows ever released. I also really like Windows 8, and have high hopes for its future. These successes are to Sinofsky’s credit to be sure.

As a business developer however, I have been extremely disappointed in Microsoft over the past couple years as Sinofsky ‘flexed his muscles’ within the organization.

Enterprises require predictability and some reasonable level of transparency. Microsoft provided neither of these over the past couple of years. The complete ‘blanket of silence’ surrounding anything to do with Windows 8 was stifling. As a result people at Microsoft were unable to talk about anything useful at all for an extremely long time. The future of .NET, Visual Studio, Blend, and many other key developer technologies became completely opaque.

As a result, many organizations developed strategies to move their business development away from dependencies on Microsoft, at least in terms of any client software development.

If there was any ray of hope over the past couple years, it was in the server and cloud space. This is where all the best known developer advocates inside Microsoft moved to, if they stayed at Microsoft at all. As a result, many organizations felt comfortable using ASP.NET and other server-side technologies, but generally started assuming Windows would no longer be a viable target for client-side software.

Obviously this is horrible for Microsoft, and yet it is a direct result of Sinofsky’s influence on the company.

Even today the story around deployment of business applications to the WinRT platform is at best incomplete, and I think is more accurately described as non-existent. Sinofsky’s apparently dismissive attitude toward anything outside the consumer space has left Microsoft increasingly irrelevant to anyone considering building smart client applications.

In short, the one true stronghold where Windows is currently dominant has been largely abandoned by Microsoft, effectively pushing us all toward building HTML 5 cross-platform apps that don’t rely on Windows at all.

Clearly this is one of the primary areas that Sinofsky’s successor must address and correct – unless Microsoft really does intend to abdicate the business client to commodity browser-based devices (can you say Chromebook?).

Personally, and based on no knowledge of the new people in charge, I am hopeful that they will restore some level of predictability and transparency to the Windows platform and the related development platform. This will help restore some confidence around the idea of building applications for Windows in the small, medium, and enterprise spaces. And I am hopeful that they’ll develop a real strategy and mechanism for deploying business applications to the WinRT platform so Windows 8 can become relevant to more than just the consumer space.

All that said, and for all my criticisms of Sinofsky’s brutal blanket of silence and alienation of the developer community inside and outside Microsoft, he really did something that had to be done – reimagine Windows to bring it into the future. Windows 8 and WinRT really might be the future of smart client development for most organizations.

The foundation is there, and it is now up to his successors to make it viable.

Monday, November 12, 2012 10:32:14 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [14]  | 
 Sunday, October 28, 2012

I am of the opinion that classmates.com is a criminal organization.

In 2008 my wife decided to give them a try with their paid service. Every year since then she has tried to cancel the paid service. Every year they renew it anyway, and continue to increase the price each time.

This year we tried disputing the credit card charge. They sent the credit card company (Discover) a bunch of screen shots of the ancient transaction from 2008, but none of the subsequent requests for cancelation. I strongly suspect they’ve “lost” all our requests to cancel their service (which we never found remotely useful in the first place).

Discover sided with classmates.com and insists that the transaction is legal.

As a merchant, I find that the credit card companies never side with me. <scarcasm>Apparently I need to create better screen shots to send in the case of disputes, because that seems to be the trick to screwing over your customers.</sarcasm>

At this point I think we’ll end up canceling the credit card completely. Not only because Discover is assisting what seems like criminal theft of our money, but also because 12 months from now when classmates.com tries to steal some more money, they won’t be able to complete the transaction against a long-canceled credit card.

What recourse do I have as an individual in this case? In terms of raw cost, it’ll take thousands of dollars to sue classmates.com to get my $40/year from them, so it makes more financial sense to allow their continued theft of my money. Certainly there’s no way to get back the latest $40 theft…

Sunday, October 28, 2012 3:08:31 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [9]  | 
 Friday, October 26, 2012

At the .NET Rocks Road Trip event in Charlotte, NC this week an attendee asked if there’d be a way to run the new Windows Store apps on Windows 7.

These are apps running on the new Windows Runtime (WinRT) platform.

Basically the question was whether Microsoft would issue an update so WinRT apps can run on Windows 7.

My answer, which got a great laugh, but is actually serious, is that Windows 8 is the update to Windows 7 that allows it to run WinRT apps.

I acknowledge that this answer is loaded with humor. But I am also serious in my answer.

I’ve been running Windows 8 full time for a few months now, and haven’t run into any issues with Windows 7 apps not working on Windows 8 (except for a couple odd-ball Steam games that I suspect break some Win32 programming rules). All my work software, all my business software, and my important games (Battlefield 3, XCOM, Supreme Commander, L4D2) all work fine on Windows 8.

Windows 8 turns out to be a slightly faster version of Windows 7, that can also run WinRT apps. Hence, Windows 8 is the upgrade to Windows 7 that allows you to run Windows Store apps.

Friday, October 26, 2012 4:09:22 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, October 24, 2012

I am pleased to announce the final release of CSLA 4 version 4.5 with support for the following platforms:

  • .NET 4.5
  • Windows Runtime (WinRT)
  • .NET 4
  • Silverlight 5

The new release is available via nuget and the CSLA download page.

This release includes a number of important features and changes, including:

  • Support for Windows Runtime (WinRT), so you can simply recompile your existing CSLA .NET business classes for WinRT with little or no changes required to migrate to the new platform
  • Support for the new async and await keywords in .NET 4.5 (and in .NET 4 and SL5 via the async targeting pack)
  • Enhancements to the business rules engine
  • Enhancements to Windows Forms support via the Csla.Windows namespace

The entire CSLA .NET dev team has put a lot of work into this release, and we hope you enjoy it and find it useful!

Wednesday, October 24, 2012 4:00:51 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, October 17, 2012

CSLA 4 version 4.5 release candidate 1 is now online via installer and nuget.

This is a relatively minor update from the previous beta, with a small number of bug fixes. The big thing is that Tiago and Jonny put a lot of work into making sure the samples are all working with CSLA .NET 4.5.

My plan is to release version 4.5 by the middle of next week.

Wednesday, October 17, 2012 4:53:46 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Tuesday, October 09, 2012

CSLA 4 version 4.5 supports the async and await keywords across all platforms (WinRT, .NET 4.5, .NET 4, Silverlight 5).

You can use these async features to implement async rules in the CSLA rules engine. Here’s one such rule:

public class CustomRule : Csla.Rules.BusinessRule
{
  public CustomRule(Csla.Core.IPropertyInfo primaryProperty)
    : base(primaryProperty)
  {
    InputProperties.Add(primaryProperty);
    IsAsync = true;
  }

  protected async override void Execute(Csla.Rules.RuleContext context)
  {
    var cmd = new LongRunningCommand();
    cmd = await DataPortal.ExecuteAsync(cmd);
    context.AddInformationResult("Rule complete: " + cmd.Output);
    context.Complete();
  }

  [Serializable]
  public class LongRunningCommand : CommandBase<LongRunningCommand>
  {
    public static readonly PropertyInfo<string> OutputProperty = RegisterProperty<string>(c => c.Output);
    public string Output
    {
      get { return ReadProperty(OutputProperty); }
      private set { LoadProperty(OutputProperty, value); }
    }

    protected new async Task DataPortal_Execute()
    {
      Output = "Before delay";
      await Task.Delay(3000);
      Output = "After delay";
    }
  }
}

Notice that the rule’s constructor sets the rule’s IsAsync property to true. This tells the CSLA rules engine that the rule will be async.

Also notice that the rule’s Execute method is marked with the async keyword, allowing the use of the await keyword within the method. In this example, the rule uses the data portal to asynchronously execute a command object by awaiting the ExecuteAsync method.

Because the rule has IsAsync true, the Execute method must call context.Complete to indicate that the rule has finished processing. If you don’t call context.Complete the CSLA rule engine will never process the rule’s result, and you’ll have a bug in your application.

The command object itself also uses the async keyword to implement the DataPortal_Execute method. Notice that this method returns a Task. The server-side data portal components are smart enough to detect when a DataPortal_XYZ method returns type Task, so the DataPortal_XYZ method is invoked correctly.

Within the DataPortal_Execute method I just use Task.Delay to create an artificial delay. This represents some long-running operation such as calling a slow web service, invoking an intensive oData query, or something like that.

The end result is that a business object can attach this CustomRule to a property, and the rule will run asynchronously. This is done in the business class’s AddBusinessRules method.

In your UI you can use helper components such as Csla.Xaml.PropertyInfo to determine that the property is running an async rule. For example, you might use XAML like this in WinRT:

<StackPanel Orientation="Horizontal">
  <TextBox Text="{Binding Path=Name, Mode=TwoWay}"/>
  <TextBlock Text="{Binding ElementName=NameInfo,Path=RuleDescription}" Foreground="Yellow"/>
  <ProgressRing IsActive="{Binding ElementName=NameInfo,Path=IsBusy}"/>
  <csla:PropertyInfo Name="NameInfo" Source="{Binding}" Property="Name"/>
</StackPanel>

The specific XAML syntax is a little different in WPF/Silverlight because the XAML language is more mature there than in WinRT. But the basic concept of building a rich user experience based on an async rule is the same across all smart client platforms.

Tuesday, October 09, 2012 3:59:52 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Thursday, October 04, 2012

I have put CSLA 4 version 4.5 beta 2 online as we continue toward the planned final release of version 4.5 on or before Oct 26.

Version 4.5.3 is available via nuget and from the CSLA download page.

The change log contains a list of all changes. Highlights include:

  1. Substantial changes to CslaActionExtender for Windows Forms
  2. Substantial (and some breaking) changes to pre- and post-processing methods around the data portal
  3. Added the ability to global implement pre- and post-processing handler to server-side data portal to enable logging/tracing and IoC scenarios

At this point we are feature complete, so any releases between now and final release will be bug fixes or stabilization.

Version 4.5 supports the following platforms:

  • .NET 4 (with async targeting pack)
  • Silverlight 5 (with async targeting pack)
  • .NET 4.5
  • WinRT

If you are using any of these platforms, please download and test this new release. Here are some notes regarding upgrading from version 4 to 4.5.

Thursday, October 04, 2012 8:13:38 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |