Decision

What’s the best way to develop user interface components for both WPF and HTML5? I don’t have a general answer, but here are two possible choices:

  1. Productivity mode: Develop once using JavaScript, and then write a wrapper for the HTML component using WebBrowser control of WPF?
    • Advantages:
      • Development is way faster;
      • Core source code base is reused, internal bugs can be solved once for both outputs;
      • Second delivery is earlier, as the WPF version can be almost immediate after HTML version;
    • Disadvantages:
      • WPF component is not .NET native, some customers may not like this;
      • WPF component will offer less performance due to JavaScript code being interpreted when running;
      • Some features may not look nor work as expected in an output WPF application when reusing the component (e.g. globalization, Windows themes, touch events), unless you develop custom handlers for all these situations into the “bridge” as WebBrowser control has limitations for passing the proper behavior from the HTML world to the .NET world.
        • Note: building the missing part of the WPF-HTML bridge may be time consuming, but still if you develop multiple components you may reuse things already developed; maybe this is an idea to be enhanced as developing a separate framework that minimizes these issues, thus removing part of this disadvantage, but not all things can be resolved since WebBrowser may internally run differently than a normal browser itself and simply completely hide, prevent access to, or not provide specific features you might otherwise expect.
  2. Performance mode: Develop separately for JavaScript and WPF, each time using the native target framework components and features.
    • Advantages:
      • Both components are native for the target platform, most customers will appreciate this;
      • WPF component will offer better performance;
      • WPF component will offer standard looks, customizability, and behavior, as developers and end users expect.
    • Disadvantages:
      • Development takes more;
      • Source code flows are duplicated, bugs need to be resolved separately;
      • Delivery for the second component is late, but still, you have the option to decide which one you deliver first (and many times you will want to deliver WPF version first, especially if you sell the components, since WPF is Microsoft-related and the community is more oriented to purchasing licenses than the JavaScript developers who are more into open source packages).
Advertisements

About Sorin Dolha

My passion is software development, but I also like physics.
This entry was posted in Development, Miscellaneous. Bookmark the permalink.

One Response to Decision

  1. Pingback: We need support for developing WinRT components on JavaScript®! | Code {Sections}

Add a reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s