Rockford Lhotka

 Wednesday, April 25, 2012

I think this is interesting:

It is particularly interesting to me, because I’ve been publishing my ebooks and videos DRM-free for several years now, and have recently been thinking about rethinking my stance on DRM.

Specifically because there really is a lot of piracy. This does include being able to find my content on criminal warez sites, but that’s actually not my concern. My primary issue with piracy is that it is too easy for companies that use CSLA .NET to buy one copy (technically a content license for one person) of my books/videos and to then share that content with their entire development team.

Although that is technically a criminal act, I don’t think most development team managers intend to be criminals. I think they intend to be frugal. I can hear the discussions in my head: “If he really meant for us to buy a copy for each developer he’d have made it harder to copy.” Or variations on that theme.

(yes, I’ve worked in business too – for around 25 years – and I know exactly how these conversations unfold)

The reality is this: I believe most people are basically decent. I also know for a fact that DRM punishes honest consumers, and does little or nothing to stop true criminals.

So I’ve chosen for years to be DRM-free. This way an honest consumer who buys my content is able to get a PDF or WMV file that they can easily read/watch on nearly any device, as they choose. No worries about licenses expiring or losing keys or passwords.

And the fact is, that if I did use DRM, the really bad guys would crack the DRM in a matter of hours or days, and the content would still be on criminal warez sites.

I’ve been rethinking my stance on DRM, because it would encourage otherwise basically decent people to actually buy the required number of copies of the content.

And yet I really don’t want to cause pain to honest consumers by using DRM. So I’m torn.

I tweeted the other day that I am considering releasing some future “ebook” content as a Windows 8 Metro style app. Not as a PDF, but literally as an app. It is an interesting idea, because it would basically force each developer to purchase their own copy of the content (or share their Microsoft Live ID passwords with each other), and yet wouldn’t technically be DRM. The app would just work – no keys or passwords to lose or expire – because once you buy a Windows 8 app from the Microsoft Store, you own the app and there’s no muss or fuss.

There are drawbacks to this. As someone pointed out, not all CSLA users are on Windows (especially now that we support mono for Android, Linux, and OS X). And I’d have to write an app in addition to creating the content – not as simple as writing the content as a Word document obviously.

So I’ll be very interested to see what Tor Books finds out as they release all their books DRM-free. Will they dodge the DOJ/Apple/Amazon legal/distribution traps as they are trying to do? Will their content be pirated more than it already is? In short, it will be interesting to see if this turns out to be a win, loss, or draw for them over time.

In the meantime, I’ll keep working on CSLA version 4.5 and thinking about whether to remain DRM-free, go with DRM, or perhaps build a “book as an app”.

Wednesday, April 25, 2012 4:27:19 PM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Monday, April 23, 2012

The lack of the BindingExpression type and related functionality in WinRT is a serious issue to anyone trying to create custom controls. Hopefully this issue will be resolved post-beta.

Sadly, the only information I’ve been able to find on this topic from Microsoft is the suggestion to use LostFocus event handlers instead of binding. Obviously that’s a pretty useless workaround when trying to create a custom control Sad smile

I started writing a data binding engine for Android (because they don’t have one at all). It would be a serious shame if we’re forced to write a data binding engine for XAML in WinRT just to be able to implement basic custom control concepts…

Monday, April 23, 2012 4:10:32 PM (Central Standard Time, UTC-06:00)  #    Disclaimer

Microsoft recently posted some details regarding the way Windows 8 (specifically ARM-based tablets running Windows RT) will work in a domain.

This related article from Steven Vaughan-Nichols suggests that Microsoft’s strategy is flawed:

And he could be right, but I think there’s substantial room for hope.

I speculate that Microsoft is thinking along the following lines:

  1. If a company buys a Win8 tablet for an employee, they’ll probably buy an Intel-based tablet so it can be a tablet and also a laptop (with a keyboard/mouse), and most importantly so it can run existing line of business applications required for the employee to do their actual work.

    I have such a tablet today, and I truly love the fact that it is a tablet and a laptop so I get the best of both worlds. It is wonderful!

    And it can join an AD domain, and probably should join the domain, because it is corporate property.
  2. If a person buys a Win8 tablet for themselves, they may well buy a cheaper and lower-powered ARM-based tablet. Such a device is a tablet, I suspect most will also double as a laptop with Office 15 (with a keyboard/mouse) – but they won’t be able to run existing line of business applications because those applications are Windows Forms or WPF or Silverlight.

    A person, spending their own money to buy a device, is probably going to be unwilling to allow their corporate IT folks to set policies and perform administration tasks on their personal device. If my company wants to muck around with my devices, they can buy me the device! The last thing most people would ever want is for corporate IT to muck around with their own personal property.

    So the fact that a Windows RT tablet can’t join a domain might be a true blessing. Microsoft is doing us a favor by eliminating the possibility that your corporate IT might insist on managing your personal property – because it just doesn’t work that way.

I’ve talked to people quite a lot over the past few months, about a possible dystopic future where employees are required to buy and support their own devices. All you have to do is take BYOD to its logical conclusion, and things look (to me) quite bleak. Surprisingly I’m finding that quite a few people in our industry thing this could be a good thing.

So here’s my train of thought.

One reason companies like BYOD is that the cost of computing shifts from the company to the employee. The company no longer has to buy the employee a laptop, because the employee chose to shell out $800 to get an iPad, and then insists that they be able to use it at work. As a result, IT can just say “OK, use it, but we don’t really support it”, and away you go. The company saves hardware and software purchase, licensing, and support costs. The burden of having a machine on which to do work falls on the employee – including the costs of acquisition, licensing, software, and support.

Now we’re not quite to that point yet. But I have heard CIO or IT director level people say, in so many words, that they see this BYOD thing as a way of cutting costs. So they are thinking exactly along this line, and it is a small step from employees insisting that they get to use their own devices, to employers requiring that employees supply and use their own devices.

And this is important, because true BYOD is incredibly expensive! In the long run, it means that all line of business apps must either be written in the highly volatile HTML 5 world, and tested on every conceivable device. Or they must be written and tested numerous times – in .NET, Objective C, Java, etc.

Magenic does quite a lot of mobile development these days, targeting iOS and Android mostly. And every time we get an Android project we have to go buy a whole new set of tablets for testing – because that platform is changing so fast, and is so inconsistent across devices and OS versions. This is true for native and HTML 5 apps – in all cases we have to test across a wide array of devices due to differences in the hardware, OS, and/or browsers.

So I feel confident saying BYOD is extremely expensive. And that might be fine if IT can figure out how to offset that expense. One way to help do that is to entirely eliminate the costs associated with hardware, OS, and support by shifting that responsibility to employees.

“You want to work in our shipping department for $17/hr? Great! Just make sure to bring your $800 iPad to work on Monday when you start. Oh, you don’t have an iPad? You don’t have $800 laying around? Well sorry, then you can’t work here.”

You think this won’t happen? Maybe not. I hope not.

But at some point IT is going to have to justify and/or offset the costs of BYOD. At some point in the next couple years the CEO/CFO or board of directors is going to ask why IT costs have spiraled out of control, and the answer will be “because you said we had to support the iPads used by our executives”. At that point the proverbial sh*t will hit the fan, and some IT directors will lose their jobs, and BYOD will come to a sudden and inglorious end.

In the meantime, we can all be happy that there’s no way IT can join our Windows RT tablets (or iPads or Kindle Fires) to the AD domain. Because those are our personal property and shouldn’t be subject to corporate administrative policies and more than our cars, our televisions, or our other personal property.

Monday, April 23, 2012 10:10:41 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Thursday, April 12, 2012

Last year Magenic held a series of free one-day technical training events in cities around the US. These events were popular and successful, so we’re doing it again this year.

I am pleased to announce that our first event is Code Mastery Boston on May 2 – so coming up soon!

These are FREE events, open to anyone wanting to get in-depth technical information. In Boston we have two tracks: .NET software development, and SQL Server/Business Intelligence.

I am delivering the keynote speech at the event, where I’ll be talking about the state of the Microsoft development platform and overall ecosystem. We are at an exciting point in the history of Microsoft, where yet again they are an underdog forced to innovate to overcome tough competition in the form of the iPhone/iPad devices, while also dealing with the commoditization of client computing, the emergence of HTML 5 as a real development platform, and the potential of cloud computing.

Our breakout sessions cover web, cloud, service, and Windows 8 software development, and SQL Server 2012, data warehousing, and business intelligence.

This is not an event to be missed, so if you are anywhere in the northeast it will be worth your time to spend the day with us at Code Mastery!

Thursday, April 12, 2012 7:43:05 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Friday, April 6, 2012

I've been watching a number of discussion threads regarding the usability of Windows 8, especially regarding the start screen, Desktop application usage, and multi-monitor scenarios.

All I can say is don’t knock it until you try it.

I’ve been running Win8 on my tablet and laptop for a few weeks now. The work I do on my laptop is often multi-monitor, and is real work.

There are three themes I’d like to address, based on my full-time usage experience thus far.

First, some people feel that Microsoft is making a mistake by having WinRT (Metro style) and Desktop apps run on the same machine at the same time. I vehemently disagree. I absolutely want one machine that I can use as a tablet on the plane, and as a real computer when I get to my destination. My tablet does this (Samsung from //build/) for almost everything, except when I’m doing distributed computing demos and need my full laptop to run virtual machines (because my laptop has tons of memory and an i7, vs the tablet with less memory and an i5).

I love the fact that I have WinRT apps, which are far superior to most web sites, for consuming news, weather, etc. And I love the fact that the same machine, plugged into a small portable dock, has a keyboard, mouse, second monitor, and can run Visual Studio just fine!

Second, there’s this idea floating around that the Win7 start menu is superior to the new Win8 start screen. That doesn’t hold true for me. Let me explain why.

When I read the Microsoft blog post about the Win7 telemetry data they used to design the start screen, they were describing me. When I use Win7 I pin my common apps and web sites to the start bar, and to run any other apps I press the Windows key and type part of the application name, then press enter. Almost never do I actually use the start menu to browse for apps.

In Win8 (keyboard/mouse – desktop/laptop computer) I pin my common desktop apps to the start bar, and my WinRT apps to the first page or two of the start screen. And I still press the Windows key and type the first part of the application name to run other applications. In other words, THERE IS NO DIFFERENCE between Win7 and Win8 from my perspective – other than that the live tiles from news/weather/stocks/etc. make the start screen a useful dashboard – so it is BETTER than Win7.

(as an aside, I do have some Desktop apps on my start page tiles too – but I find that I rarely use those tiles, preferring instead to tap the Desktop tile and then launch from the start bar – a personal quirk I suppose)

Third, the multi-monitor problems aren’t as bad as they are being portrayed. But the story isn’t good either, and I truly hope it improves over the next few months.

If you are doing “real work” today, you are probably spending 90% of your time (or more) in desktop mode. And if you’ve pinned your common apps to the start bar (like Win7, and I have done this) then you’ll probably never leave desktop mode. And in this case, multi-monitor works just like Win7, but slightly better because the start bar works better in Win8 (or at least it has new options I find useful).

Where the multi-monitor falls down is if you are using a mix of WinRT apps and Desktop applications at the same time.

WinRT only runs on the primary monitor, and that’s just lame. It completely prevents the use of WinRT for many business scenarios where multi-monitor is critical. I honestly don’t expect this to get fixed in WinRT v1, but I hope we don’t have to wait for Windows 9 (2014?) for this to be solved, because it is a major blocker for WinRT development in the real world.

Between the Dev and Consumer previews, they did change the way WinRT apps use the primary monitor. At least now in the Consumer preview it is possible to keep a WinRT app running on the primary monitor while using a Desktop app on other monitors. I do find though, that it is too easy for some errant Desktop app to use the primary monitor, thus making the WinRT app disappear – and this is frustrating.

Sadly it is not possible to keep the start page visible while using a Desktop app on a secondary monitor – reducing its otherwise high value as a dashboard L

To summarize the multi-monitor scenario: if you are a Desktop app user, Win8 is as good or better than Win7, because you’ll only see the start screen when you press the Windows key to launch some non-pinned app. If you are a WinRT user multi-monitor is useless. If you are a hybrid user (like me) the experience is workable, but unpredictable and frustrating.

Clearly Microsoft needs to do more work in this area.

In final summary, don’t knock it until you try it full-time on real machines. The experience overall is quite good, and I VERY much like having WinRT apps that I can use on my main computer instead of using web pages with their inferior usability and aesthetics. Given that most of my main laptop usage is in Visual Studio, Word, and PowerPoint, I find the experience with multi-monitor to be adequate, and Win8 is just as productive for those scenarios as Win7.

Friday, April 6, 2012 9:50:13 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Thursday, March 29, 2012

Here are the slides for my Windows Forms to Windows Runtime talk today at Dev Connections.

Thursday, March 29, 2012 10:39:13 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Wednesday, March 21, 2012

I’ve been spending quite a bit of time working with WinRT over the past couple weeks. Specifically prepping for next week’s Visual Studio Live! and VS Connections conferences.

As part of this process, I have a super early version of CSLA 4 version 4.5 that builds and (mostly) runs on WinRT. I’d done a lot of the work months ago when the Windows 8 developer preview came out, so getting it to work on the consumer preview took only a couple hours.

The only new feature I’ve added so far is support for the new async and await keywords for WinRT data portal code. I still need to add async/await support for the .NET data portal. I might refine some of my implementation, but right now I can use async/await to call the data portal in WinRT, and that’s cool!

The primary observation I want to make right now though, is that business classes created using CSLA 4 that target Silverlight will now recompile for WinRT with no code changes required. I took the entire ProjectTracker business library project and just recompiled it for WinRT and it works – unchanged.

If you want direct reuse of your business logic from .NET/Silverlight to WinRT, you should consider using CSLA 4.

Because I did add the async/await data portal support, I chose to add async factory methods to my business classes, alongside the existing .NET and Silverlight factory methods. From a porting/reuse perspective this is not necessary, but in terms of writing new code for .NET 4.5 and/or WinRT I think we’ll all tend to write these async factory methods.

In short, I added code like this:

    public async static System.Threading.Tasks.Task<ProjectList> GetProjectListAsync()
      return await Csla.DataPortal.FetchAsync<ProjectTracker.Library.ProjectList>();

This allows the viewmodel or other presentation layer code to retrieve business objects like this:

var obj = await ProjectList.GetProjectListAsync();

No need for async callback handlers or the other messy goo from a typical WPF/Silverlight application. Of course WPF 4.5 will be able to use the await keyword too, so only SL/WP7 will still require the callback handler model when all is said and done.

Although these are early days, and I am still working through all the features of CSLA .NET to make sure they work on WinRT, it is nice to know that data binding, business/validation rules, and the data portal are all functional already. I expect to still do some work around authorization rules, and the local data portal implementation – but the vast majority of CSLA 4 functionality is already working just fine on WinRT and that makes me very happy!

Wednesday, March 21, 2012 8:49:28 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Wednesday, March 14, 2012

One issue I’ve encountered while building Metro-style WinRT apps on Windows 8 is the need to have my app interact with a WCF service running on the same machine.

This is obviously a common scenario for any n-tier or SOA app development. The challenge we face is that WinRT apps are blocked from calling back to localhost ( The challenge and solution are described here:

To find the real application name (moniker) necessary, I wrote a simple command line utility to read the registry:

using System;
using Microsoft.Win32;

namespace WinRtAppList
  class Program
    static void Main(string[] args)
      var reg = Registry.
        OpenSubKey("Local Settings").

      var items = reg.GetSubKeyNames();
      string query = null;
      if (args.Length > 0)
        query = args[0].ToLower();

      foreach (var item in items)
        var app = reg.OpenSubKey(item);
        var displayName = app.GetValue("DisplayName").ToString();
        if (string.IsNullOrEmpty(query) || displayName.ToLower().Contains(query))
          Console.WriteLine("  SID:     " + item);
          Console.WriteLine("  Moniker: " + app.GetValue("Moniker"));


Nothing fancy, but it helps avoid the need to dig around in the registry with regedit just to find the application moniker.

Wednesday, March 14, 2012 7:57:34 PM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Tuesday, March 13, 2012

I just read this article about what’s wrong with Windows 8:

The author makes some valid points. Most notably, in the consumer preview there are a ton of inconsistencies where the user is dumped into legacy mode (sorry, Desktop mode) when doing things as common as setting up a printer. That’s clearly confusing, and Microsoft has their work cut out to replace all the OS dialogs between now and release.

And the fact that there’s no obvious way out of Desktop mode once you get there is a problem. If you happen to accidentally get your mouse in the far lower-left corner of the screen you might escape, otherwise normal users just get trapped there with no way out. That’s pretty silly.

But toward the end of the article he makes an observation that I think is completely faulty:

“I don’t see touch being that important of a driver to either sell new PCs or a new operating system. Outside of Microsoft and a small number of power users, I don’t really see a demand for touch for PCs from either enterprise of consumer markets. Instead, what we have is Microsoft trying — once again — to stir up interest in touch devices.”

Apparently the author hasn’t noticed the massive uptake of iPad and Kindle Fire devices all over the place – at the consumer and corporate level. It is an understatement to say that demand exists for touch devices, and it would be absurd to think Microsoft would ignore that demand.

Or perhaps the author is suggesting that nobody wants a PC with touch. That they’d rather carry a PC for work, and a totally different type of device for touch? That is possible, but it seems unlikely that people would choose to spend twice the money and carry twice the hardware just to have two different experiences – at least if they have a choice of carrying one device that is good for work and play.

There are many reasons I’m motivated to see Windows 8 be successful (though I agree that success isn’t a foregone conclusion). Perhaps the biggest though, is apps. For touch, keyboard, and mouse, I want apps.


Because apps are the resurgence of the smart client and distributed computing. And there are no apps on the PC, so PC users are increasingly stuck using the second-class web interfaces to interact with the world.

Take almost anything – news, weather, stocks, social services like Facebook – you name it. PC users have to interact with these things via the web, reducing their super-powerful PC to a dumb terminal. But mobile device users get rich, smooth apps that are a lot more fun to use.

Given a choice, would you interact with Facebook via a web UI, or a nice app with clear navigation, nice animations, and well-considered user interaction? People have spoken – Facebook apps for tablets and phones are the primary way to interact with the social service over the web UI.

As a PC user I am increasingly left out. Left to suffer with browser-based experiences while my wife uses her iPad to interact with the same services in a more enjoyable manner.

It seems obvious now that apps will never come to the Win32/.NET PC world. So the only way to have decent interaction with the world at large is to figure out a way to get apps on the PC – and that is clearly via WinRT and Metro.

I think the lack of apps on the PC is because there’s no store, so no easy way to find and install such apps. Microsoft could have created an app store for Windows 7, but Win7 doesn’t offer a fully sandboxed runtime environment where such apps can be virus and harm-free to the end user.

I also think Microsoft could have created such a sandbox world based on Silverlight, without the need to create a whole new operating system. It would have been possible to enable Silverlight apps to be directly hosted on Win7, and to be purchased from a centralized and curated store.

But that wouldn’t have addressed the tablet and touch issues.

So what we’ve got is a new operating system, with a runtime designed from the ground up to support safe apps that are deployed from a store. And from a .NET developer perspective this new Windows Runtime (WinRT) is extremely close to Silverlight in terms of its development model. So in a sense Microsoft is doing exactly what you’d expect to enable apps – but they are also enabling tablets and touch.

In short, I am looking forward to Windows 8 because it breathes new life into the smart client and distributed computing world – and because as a user I can finally get a first-class experience for interacting with news, weather, and social services on the “web”.

Tuesday, March 13, 2012 9:56:44 AM (Central Standard Time, UTC-06:00)  #    Disclaimer