SlideShare a Scribd company logo
1 of 20
Chris Bannon, Product Manager, Wijmo
Migrating MVVM Applications to HTML5
about: me
Chris Bannon
Product Manager of Wijmo
We sell JavaScript UI Controls:
 Grids
 Charts
 Input, etc.
about: webinar
 Share our approach on migrating to HTML5
o General guidelines
o Tools
 Show some code!
 Discuss Results
Real World Example
Why Use HTML5?
“Virtually every computing device supports HTML
and JavaScript.”
How Can You Migrate to HTML5?
Use a familiar development pattern: MVVM
o Widely used by Silverlight/WPF/WinRT developers
Use a framework made for MVVM: AngularJS
o Use AngularJS for MVVM in JavaScript
o Use UI controls with MVVM support for quicker development
Use a familiar programming language: TypeScript
o Similar to C#
o Strongly-typed
o Compiles to JavaScript
What is MVVM?
 Model
o Data for an application
o Example: Web service or JSON
 ViewModel
o Pure code representation of UI Model
o Example: TypeScript (JS) Class
 View
o Visible and Interactive UI
o Example: HTML
AngularJS
 MVVM Framework
 Similar to .NET/XAML in JavaScript
 Two-way binding
 Components
TypeScript
 Language from Microsoft
 Created by Anders Hejlsberg, the creator of C#
 Object-oriented with Classes etc.
 Compiles to JavaScript (ES5 or ES6)
 Offers C#-like syntax and features
o Inheritance
o Type safety, design-time error checking
o Based on ECMAScript standards (ES 6)
 Adopted by Google in Angular 2
Porting the Model
Use the same Model/Datasource
o Most HTML5 apps can use the same services
o The JSON coming from services can serve as model
Porting the ViewModel
 CollectionView objects for Customers, Orders, Details
 Load same data using Ajax
 Similar to the Silverlight version, but simpler
C# (Silverlight)
// create ICollectionView
var customers =
new DataServiceCollection<Customer>();
// load data asynchronously
var context = new NWEntities(serviceUri);
var query = context.Customers;
customers.LoadAsync(query);
JavaScript (Wijmo)
// create ICollectionView
$scope.customers =
new wijmo.collections.CollectionView();
// load data asynchronously
loadData(serviceUri, $scope.customers,
'Customers');
HTML5 (Wijmo)
<wj-combo-box
items-source="customers"
display-member-path="CompanyName">
</wj-combo-box>
<wj-flex-grid
items-source="details">
<wj-flex-grid-column
binding="ProductID"
header="ProductID"
width="80*">
</wj-flex-grid-column>
Porting the View
 Built-in directives for all controls
 Similar to the Silverlight version, but simpler
XAML (Silverlight)
<ComboBox
ItemsSource="{Binding Source={StaticResource customers}}"
DisplayMemberPath="CompanyName">
</ComboBox>
<sdk:DataGrid
ItemsSource="{Binding Source={StaticResource details}}">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn
Binding="{Binding Path=ProductID}“
Header="Product ID“
Width="80*" />
Code
The Result
 Porting took about two hours
 Runs on desktop and mobile devices
 About 15% the size of the original sample (160k vs over 1meg)
 Responsive layout renders well on small screens
The Benefits of Using MVVM
Shorter Development Cycles
 MVVM separates development clearly between Data, Code and UI
 Each layer can be developed in parallel and individually
 Minimizes turnaround time
Improved Reliability & Easier Maintenance
 ViewModels are testable
 ViewModels easily integrate with Unit Tests
 Unit Tests become assets to the project during the lifecycle of the application
 Maintenance made easier with automated tests
Improved Quality
 Less overlap between developers and designers
 Each can focus on their specialty and deliver higher quality
 Both can work simultaneously
Flexibility
 Loose coupling between Views and ViewModels
 Multiple Views can use a single ViewModel
 Easily make Mobile, Desktop or other custom Views against a single ViewModel
Thanks!
 White Paper: Migrating from XAML to HTML 5 with Wijmo
http://wijmo.com/migrating-from-xaml-to-html5-with-wijmo/
 Read more about Wijmo’s HTML5/JavaScript controls at http://www.wijmo.com
 Questions?

More Related Content

What's hot

Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
MaslowB
 
Combining HTML5 with MVC framework to simplify realtime collaboration for we...
Combining HTML5 with MVC framework to simplify  realtime collaboration for we...Combining HTML5 with MVC framework to simplify  realtime collaboration for we...
Combining HTML5 with MVC framework to simplify realtime collaboration for we...
Gopikrishnan Sasikumar
 

What's hot (20)

Building databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsBuilding databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with Knockoutjs
 
Mvc summary
Mvc summaryMvc summary
Mvc summary
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
 
Easy HTML5 Data Visualization with Kendo UI DataViz
Easy HTML5 Data Visualization with Kendo UI DataVizEasy HTML5 Data Visualization with Kendo UI DataViz
Easy HTML5 Data Visualization with Kendo UI DataViz
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Angular js anupama
Angular js anupamaAngular js anupama
Angular js anupama
 
MVVM & Validation with Kendo UI
MVVM & Validation with Kendo UIMVVM & Validation with Kendo UI
MVVM & Validation with Kendo UI
 
Knockout js
Knockout jsKnockout js
Knockout js
 
Asp.net mvc 4
Asp.net mvc 4Asp.net mvc 4
Asp.net mvc 4
 
ASP.NET MVC 4 Introduction
ASP.NET MVC 4 IntroductionASP.NET MVC 4 Introduction
ASP.NET MVC 4 Introduction
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
 
Comparative analysis of java script framework
Comparative analysis of java script frameworkComparative analysis of java script framework
Comparative analysis of java script framework
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training session
 
Combining HTML5 with MVC framework to simplify realtime collaboration for we...
Combining HTML5 with MVC framework to simplify  realtime collaboration for we...Combining HTML5 with MVC framework to simplify  realtime collaboration for we...
Combining HTML5 with MVC framework to simplify realtime collaboration for we...
 
The RAW stack
The RAW stackThe RAW stack
The RAW stack
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
 
Modern Applications With Asp.net Core 5 and Vue JS 3
Modern Applications With Asp.net Core 5 and Vue JS 3Modern Applications With Asp.net Core 5 and Vue JS 3
Modern Applications With Asp.net Core 5 and Vue JS 3
 
Developing ASP.NET MVC Applications Quicker With Kendo UI
Developing ASP.NET MVC Applications Quicker With Kendo UIDeveloping ASP.NET MVC Applications Quicker With Kendo UI
Developing ASP.NET MVC Applications Quicker With Kendo UI
 

Similar to Migrating MVVM Applications to HTML5

WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012
Dmitri Artamonov
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe
 

Similar to Migrating MVVM Applications to HTML5 (20)

Welcome to Wijmo 5
Welcome to Wijmo 5Welcome to Wijmo 5
Welcome to Wijmo 5
 
RIA / SPA with ASP.NET
RIA / SPA with ASP.NETRIA / SPA with ASP.NET
RIA / SPA with ASP.NET
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET Webskills
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
 
WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid Applications
 
MVVM+MEF in Silvelight - W 2010ebday
MVVM+MEF in Silvelight - W 2010ebdayMVVM+MEF in Silvelight - W 2010ebday
MVVM+MEF in Silvelight - W 2010ebday
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
 
Wicket And Swing From One Codebase
Wicket And Swing From One CodebaseWicket And Swing From One Codebase
Wicket And Swing From One Codebase
 
Angular pres
Angular presAngular pres
Angular pres
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
 
Microservice Websites (microXchg 2017)
Microservice Websites (microXchg 2017)Microservice Websites (microXchg 2017)
Microservice Websites (microXchg 2017)
 
JavaScript UI Architecture: Be all that you can be
JavaScript UI Architecture: Be all that you can beJavaScript UI Architecture: Be all that you can be
JavaScript UI Architecture: Be all that you can be
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
A Smooth Transition to HTML5
A Smooth Transition to HTML5A Smooth Transition to HTML5
A Smooth Transition to HTML5
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Angular js
Angular jsAngular js
Angular js
 
Angular JS Basics
Angular JS BasicsAngular JS Basics
Angular JS Basics
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Migrating MVVM Applications to HTML5

  • 1. Chris Bannon, Product Manager, Wijmo Migrating MVVM Applications to HTML5
  • 2. about: me Chris Bannon Product Manager of Wijmo We sell JavaScript UI Controls:  Grids  Charts  Input, etc.
  • 3. about: webinar  Share our approach on migrating to HTML5 o General guidelines o Tools  Show some code!  Discuss Results
  • 5. Why Use HTML5? “Virtually every computing device supports HTML and JavaScript.”
  • 6. How Can You Migrate to HTML5? Use a familiar development pattern: MVVM o Widely used by Silverlight/WPF/WinRT developers Use a framework made for MVVM: AngularJS o Use AngularJS for MVVM in JavaScript o Use UI controls with MVVM support for quicker development Use a familiar programming language: TypeScript o Similar to C# o Strongly-typed o Compiles to JavaScript
  • 7. What is MVVM?  Model o Data for an application o Example: Web service or JSON  ViewModel o Pure code representation of UI Model o Example: TypeScript (JS) Class  View o Visible and Interactive UI o Example: HTML
  • 8. AngularJS  MVVM Framework  Similar to .NET/XAML in JavaScript  Two-way binding  Components
  • 9. TypeScript  Language from Microsoft  Created by Anders Hejlsberg, the creator of C#  Object-oriented with Classes etc.  Compiles to JavaScript (ES5 or ES6)  Offers C#-like syntax and features o Inheritance o Type safety, design-time error checking o Based on ECMAScript standards (ES 6)  Adopted by Google in Angular 2
  • 10. Porting the Model Use the same Model/Datasource o Most HTML5 apps can use the same services o The JSON coming from services can serve as model
  • 11. Porting the ViewModel  CollectionView objects for Customers, Orders, Details  Load same data using Ajax  Similar to the Silverlight version, but simpler C# (Silverlight) // create ICollectionView var customers = new DataServiceCollection<Customer>(); // load data asynchronously var context = new NWEntities(serviceUri); var query = context.Customers; customers.LoadAsync(query); JavaScript (Wijmo) // create ICollectionView $scope.customers = new wijmo.collections.CollectionView(); // load data asynchronously loadData(serviceUri, $scope.customers, 'Customers');
  • 12. HTML5 (Wijmo) <wj-combo-box items-source="customers" display-member-path="CompanyName"> </wj-combo-box> <wj-flex-grid items-source="details"> <wj-flex-grid-column binding="ProductID" header="ProductID" width="80*"> </wj-flex-grid-column> Porting the View  Built-in directives for all controls  Similar to the Silverlight version, but simpler XAML (Silverlight) <ComboBox ItemsSource="{Binding Source={StaticResource customers}}" DisplayMemberPath="CompanyName"> </ComboBox> <sdk:DataGrid ItemsSource="{Binding Source={StaticResource details}}"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Binding="{Binding Path=ProductID}“ Header="Product ID“ Width="80*" />
  • 13. Code
  • 14. The Result  Porting took about two hours  Runs on desktop and mobile devices  About 15% the size of the original sample (160k vs over 1meg)  Responsive layout renders well on small screens
  • 15. The Benefits of Using MVVM
  • 16. Shorter Development Cycles  MVVM separates development clearly between Data, Code and UI  Each layer can be developed in parallel and individually  Minimizes turnaround time
  • 17. Improved Reliability & Easier Maintenance  ViewModels are testable  ViewModels easily integrate with Unit Tests  Unit Tests become assets to the project during the lifecycle of the application  Maintenance made easier with automated tests
  • 18. Improved Quality  Less overlap between developers and designers  Each can focus on their specialty and deliver higher quality  Both can work simultaneously
  • 19. Flexibility  Loose coupling between Views and ViewModels  Multiple Views can use a single ViewModel  Easily make Mobile, Desktop or other custom Views against a single ViewModel
  • 20. Thanks!  White Paper: Migrating from XAML to HTML 5 with Wijmo http://wijmo.com/migrating-from-xaml-to-html5-with-wijmo/  Read more about Wijmo’s HTML5/JavaScript controls at http://www.wijmo.com  Questions?

Editor's Notes

  1. Run SL and HTML5 versions in browser
  2. Mobile Performance Shared code in multiple platforms Mobile Web Native Mobile (PhoneGap) Desktop Web Native Desktop (Universal Windows Platform, Electron)
  3. The first step in porting the application was porting the ViewModel (logic). In this case, we created three CollectionViews (cust > orders > details). We loaded them with data from the same source as the original app. We synchronized using the currentChanged event to load orders for the selected customer and details for the selected order. The new ViewModel is about 100 lines of code, much simpler than the original.
  4. The second step was porting the View. This was easy because we used AngularJS and Wijmo 5 includes directives for all the controls. The slide compares pieces of markup in the original app to the ported app. Notice how the syntax is similar, down to property names. Again the HTML5 version is similar but simpler than the original.
  5. The port was done in about hours, and the HTML5 version of the app has significant advantages over the original. Let’s see it in action.