I made the preview release of StoryTeller a couple months ago as soon as I got some sort of "intelligent editor" functionality going in the WPF client so you very rarely ever had to expose your tender eyes to the horrors of the underlying Xml storage. Fine, except for one little problem: the UX and usability suck (and I know because my team uses it and I'm irritated with it when I use it. Hooray for dogfooding). It's also butt ugly.
Flash forward to the past couple months. My team at Dovetail is putting the finishing touches on our online rules engine editor feature in our product (I'm blogging about it soon). We basically use StoryTeller as our "DSL" engine, but we built a completely web based editor for the StoryTeller grammars and integrated that into our web application. I had originally envisioned this module as being written in Silverlight because of the complexity of the dynamic layout and behavior. Instead, we decided to build the UI out with client side JavaScript. We do generate HTML templates on the server representing the DSL grammars that embed behavioral directives with class attributes and copious usage of the jQuery Metadata plugin, but all the behavior of the UI is accomplished through client side scripting. My team might not completely agree, but frankly I'm thrilled with how it's gone. The UI looks pretty good and the screen behavior was relatively easy to create with the HTML/JavaScript/CSS/jQuery combination. We were even able to TDD quite a bit of the JavaScript development using QUnit.
So here's my dilemma, I'm committed to making StoryTeller rock and I absolutely need to replace the existing test editor functionality. At this point I have two options -- either write a new version using WPF that closely mimics the improved usability that we built at Dovetail or stick with JavaScript/jQuery/HTML and embed a WebBrowser control into StoryTeller's WPF client (which I already do). Here are the facts as I see them and I'm obviously biased at the moment toward the HTML/JavaScript model -- but I'm looking for other people's opinions, especially about WPF:
Pro-WPF
- It's an excuse/reason to learn a lot more about WPF for me. I think I'd finally have to dig into data templates, styling, and attached behaviors to do this well.
- Embedding a WebBrowser control into a WPF app and letting more COM stuff in the door is kloogey and occasionally error prone. The integration is odd
- Might run faster
- Richer editing controls
Pro-HTML/JavaScript/jQuery
- The amazing jQuery ecosystem of plugins and support. At a minimum, I'd be using the jQuery UI sortable/draggable stuff, jQuery Validation, and jQuery Metadata. I went looking today and I just don't see any substantial OSS community around WPF other than more copycat MVVM frameworks than you can shake a stick at.
- I'm much more familiar with the jQuery way of doing things and HTML
- I've got a successful working prototype to start from
- Many of the mechanics are much simpler with jQuery than with WPF. For example, I want users to be able to reorder parts of the StoryTeller specification by dragging elements around. This is just a matter of some declarative class names in HTML with jQuery, but the WPF equivalent looks exceptionally nasty.
- I actually like coding with JavaScript and the dynamic features make it relatively easy to extend the model with less ceremony than a static typed language
- The feedback cycle is faster with JavaScript than C#
- I'd really love to be able to allow users to embed the StoryTeller editor in their own applications, and the HTML/JavaScript model has much more reach than a WPF or even a Silverlight model would.
- I think this model is actually much easier to test than the WPF model. It's hard to write automated tests against WPF without something special like TypeMock that can get around how the WPF team sealed so many of the routed event classes or an expensive 3rd party tool that screen scrapes.
- Truth be told, I don't really like WPF. It's weird and has more "oddball-ness" to it than any other technology I've ever used. There are parts of it that I love (the layout system comes to mind), and others that drive me batty (XAML's runaway verbosity, binding expressions, routed events). I don't hate it on first sight the way I did WebForms back in the day, but something about it just doesn't agree with me.
Call it a Wash
- I've got JetBrains RubyMine for the JavaScript editing, so the tooling support is not really an advantage for the WPF/C# solution anymore
- qUnit isn't that hard to use, so I'm not sure that the C# code is any easier to test and I have a recipe for integrating qUnit tests into an automated build anyway.
Anyway, it's been interesting. Now, what do you think?
Posted
Mon, Nov 9 2009 4:31 PM
by
Jeremy D. Miller