How HTML5 destroyed my CSLA dream

Let me start by stating, emphatically, I love CSLA.NET!

I first became aware of this excellent framework in 2008 when my boss dropped Rocky's book Expert C# 2008 Business Objects on my desk. In very short order I recognized the enormous benefits CSLA could provide to developers like myself who where trying to to produce great enterprise applications. The idea that I could create completely self-contained classes which would flow naturally between the various application layers and physical tiers made me fairly giddy with excitement. This excitement was reinforced by my efforts as I implemented user presentation layers for WinForms, WPF and Silverlight all based on the same business core with little impedance between the architectural layers or the physical tiers. Concerns such as validation and n-level undo were mostly handled by the CSLA framework with very little additional effort from the developer (me).

Then I attempted to write a presentation layer in HTML 5.

I started with ASP.NET MVC 4 because that framework is supported by CSLA and there are a variety of sample applications employing the two frameworks in tandem. I quickly found that, while you can develop an MVC application utilizing a CSLA based business core, it's almost impossible to take advantage of any of the benefits offered by CSLA from the client (i.e. browser). In the other UI technologies I'd previously implemented, object binding allowed for a vibrant user experience where, for example, clients could easily be notified when they'd made changes to an object or the object was not in a valid state. Due to the stateless nature of the MVC implementation such notification was simply impossible to leverage. Unfortunately, today's users expect exactly this type of client-side responsiveness in their applications.

I've continued building my HTML 5 application and over time I've slowly added more and more client-side "bells and whistles" all, of course, written in Javascript. What I've found is that I've functionally re-coded a large number of the business and functional rules once encapsulated solely in my CSLA business objects into client-side Javascript. I now maintain a significant number of these rules in two different code bases (and languages). My original CSLA based business objects are still the workhorses for the application when a users works with one of Microsoft's presentation technologies and they back all server-side activity but they provide very few meaningful functions when accessed through a web UI. This makes me very sad.

I had a dream of one unified code base providing a consistent experience across a variety of platforms. Over the last year and a half I've watched the HTML5/Javascript/CSS juggernaut roll onto the scene and relegate all other contenders for development of multi-platform capable applications to the fringe.