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

Building databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsBuilding databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsNish Anil
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSM R Rony
 
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 DataVizLohith Goudagere Nagaraj
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introductionBhagath Gopinath
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCSirwan Afifi
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentationMaslowB
 
Comparative analysis of java script framework
Comparative analysis of java script frameworkComparative analysis of java script framework
Comparative analysis of java script frameworkNishant Kumar
 
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training sessionHrichi Mohamed
 
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
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax Brij Mishra
 
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 3Alexandre Malavasi
 
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 UILohith Goudagere Nagaraj
 

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

Welcome to Wijmo 5
Welcome to Wijmo 5Welcome to Wijmo 5
Welcome to Wijmo 5Chris Bannon
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET WebskillsCaleb Jenkins
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologiesHosam Kamel
 
WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012Dmitri Artamonov
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsHaim Michael
 
MVVM+MEF in Silvelight - W 2010ebday
MVVM+MEF in Silvelight - W 2010ebdayMVVM+MEF in Silvelight - W 2010ebday
MVVM+MEF in Silvelight - W 2010ebdayRicardo Fiel
 
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 - IndiandotnetIndiandotnet
 
Wicket And Swing From One Codebase
Wicket And Swing From One CodebaseWicket And Swing From One Codebase
Wicket And Swing From One Codebasejcompagner
 
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) Againjonknapp
 
Microservice Websites (microXchg 2017)
Microservice Websites (microXchg 2017)Microservice Websites (microXchg 2017)
Microservice Websites (microXchg 2017)Gustaf Nilsson Kotte
 
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 beKyle Simpson
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe
 
A Smooth Transition to HTML5
A Smooth Transition to HTML5A Smooth Transition to HTML5
A Smooth Transition to HTML5Chris Bannon
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Angular JS Basics
Angular JS BasicsAngular JS Basics
Angular JS BasicsMounish Sai
 

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

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

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.