SlideShare a Scribd company logo
Introduction to WinJS
        Dmitri Artamonov
       BlueMetal Architects
      dmitria@bluemetal.com
             #dartamon
MARQUEE SPONSOR
PLATINUM SPONSOR
PLATINUM SPONSOR
PLATINUM SPONSOR
GOLD SPONSORS
SILVER SPONSORS
Agenda
 Switching from C#
 What is WinJS?
 What’s under the hood?
 Where does WinJS fit?
 What’s new in WinJS?
 Patterns and Practices
 Managing WinJS on the Enterprise
 Testing WinJS for Store Submission
What I will not talk about
 Tiles and Notifications
 Content before Chrome
 Sensors/NFC
 Contracts/Charms
 New Controls
 Process Lifecycle Management
 Triggers/Background Tasks
 Etc…
Switching from C#/XAML to WinJS
 Difference in thinking – advantages of HTML5 over XAML
 XAML -> HTML5/CSS3
 C#/CLR -> Javascript/WinJS
 Code Organization
 MVVM -> MVC
 Available Tools
 Is C# now obsolete?
What is WinJS?
 A standard library to access native Windows 8 functionality through
  Javascript and HTML5
 Fully HTML5-compliant
 Uses attributes to add new Windows 8 functionality to standard
  HTML5 code
 Accessed as a standard object in Javascript
WinJS at NYC Code Camp 2012
What’s under the hood?
 Language projections
 Web hardware-accelerated rendering and Javascript interpretation
  technology originally started with IE9 (HTML5 compliant)
 Connects to the same .winmd components as the C#/XAML Windows
  8 applications
 Chakra JScript engine has its peculiarities – garbage collection is done
  at the end of script execution, can use up a lot of memory
 Will WinJS evolve away from IE roots?
Under the hood (cont’d)
 Chakra engine for Javascript interpretation
Where does WinJS fit?
 Rapid development, friendly to web developers
 Performance can be slower than other languages, may improve in the
  future
 Can fully interface with components written in other languages
 More maintainable by enterprises with web developer staff
 Development can be less frustrating and cheaper if you take
  advantage of libraries and resources already available to JS developers
 Lower costs and faster workflow – designers can work with HTML
  directly
WinJS at NYC Code Camp 2012
Other JS Libraries
 jQuery
 Graphing (HighCharts or Raphael)
 MVC libraries
 You can create applications without using WinJS at all!
What’s new?
 Page Structure/Navigation
 Promises
 Cloud Integration
 Contracts
 Tiles and Notifications
 Speech Integration
Page Structure and Navigation in WinJS
 Similar to the browser – HTML file that references JS files
 PageControlNavigator out of the box
 Navigation back stack
 Standard Project Template Demo
Promises
 Async pattern implemented in javascript, similar to try-catch-finally

WinJS.xhr({ url: urlString, responseType: "json" }).then(
      function handleResponse(result) {
                 // Handle the returned data
          },
        function handleException(exception) {
                 // Handle return exception
        }
).done(function afterResponse() {
        // Handle code to be executed once xhr returns
});
Cloud integration
 File Picker APIs – saving to the cloud and loading from the cloud –
  allows us to expose the cloud as part of the file system
 File Picker APIs – exposes a custom UI that allows users to pick files to
  open or a location to save - hosted view activation.
 File Picker APIs – what constitutes a file is up to you – aggregation?
 Roaming API – saving data in the cloud that is associated with your
  profile
 Roaming API - creating an experience, not just one app on one
  machine
 SkyDrive Demo
Patterns and Practices
 MVC?
 Regions
 Combining WinJS with C# via .winmd components
 Modules and Dependency Injection
 Dynamic code loading (requires disabling security)
MVVM
 There were problems with MVVM
 Lack of controllers in classic MVVM, debate between heavy VMs and
  use of controllers
 Dedicated classes to store information for presentation
 With XAML, only one DataContext per view
 Can’t be directly transitioned to WinJS – absence of two-way
  bindings, multiple data contexts per view
WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012
MVC on WinJS
 Where do we move from MVVM? Is MVVM dead?
 Current limitation: no two-way binding in WinJS
 Have to trap user input and respond to it
 Trapping can be done via a controller, get rid of classic MVVM
 Application/Domain Model conversion can be done via regions
 Use defined namespaces and classes to create observable objects;
  ways to make objects observable are also available
Regions
 Using the magic of WinJS we can bind elements to objects, thus
  setting their datacontext
 Two ways we can do the binding: data-win-bind and data-win-
  bindsource
 data-win-bind is used for binding a single field to the data context
HTML5:
<span data-win-bind=“innerText: dto.title”></span>
JS:
WinJS.Binding.processAll(target element, data context object)
Regions (cont’d)
 data-win-bindsource allows to set the data context for an element
  declaratively instead of calling WinJS.Binding.processAll() in Javascript
 <div data-win-bindsource=“dto">
 Allows for more binding code to be moved into HTML5
Using .winmd components
 You can create your own .winmd components in other languages that
  your app can interface with, the same way it does with WinJS
 Take advantage of performance or library disparities – different
  components are implemented differently
Modules and dependency injection
 Javascript was born from simple scripting
 Modern applications require maintainable, testable code with private
  scope
 A module is an anonymous, self-executing function with parameters for
  dependency injection:

(function (internalParam1, internalParam2) {
       "use strict";
       // private code goes here
})(globalParam1, globalParam2);
Modules and namespaces
 Exposing endpoints for public access from the module via classes and
  namespaces:
WinJS.Namespace.define("ClassicCars", {
      FindCars: _findCars(), // can define members in namespaces
      RepairBills: WinJS.Class.define(function(quantity) { // constructor
      code goes here },
      { GetCost: _getCost }, // instance members
      { repairBillTypes: [ “S", “U" ] }) // static members
});
Dynamic code loading
 What if we could update the application dynamically, without having
  to re-distribute it?
 Can download HTML/JS code via iframe (security enabled, features
  disabled)
 Fragments API – able to load in HTML content from external web
  sources into the application
 Can download code directly into the app (requires unsecure calls, will
  not be allowed in the Windows Store)
 execUnsafeLocalFunction - overrides HTML injection security
Managing WinJS on the enterprise
 What are the development costs?
 Effectiveness vs. C#/XAML or C++
 Migration of previous code?
 What happens to legacy applications on C#?
 What happens to legacy web applications that we want to migrate to
  Windows 8?
 How to write internal applications and deploy – next slide
Enterprise story (unofficial)
 Internal Windows Store for enterprise applications
 Deployment by employees to their machines from a restricted pool of
  applications
 Enforces security policies
 Creates a contained environment for controlling what applications are
  on enterprise machines
WinJS at NYC Code Camp 2012
Testing for Submission - WACK
 The submission process involves automatic testing
 Windows App Certification Kit
 Microsoft provides a testing kit for developers to test their
  applications in advance
 Tests security, performance, etc.
 Subjectivity kept to a minimum, maximum transparency
Questions?
 dmitria@bluemetal.com
        #dartamon
http://blog.bluemetal.com
Ad

More Related Content

What's hot (20)

Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
CodeValue
 
Website development &amp; it's trends
Website development &amp; it's trendsWebsite development &amp; it's trends
Website development &amp; it's trends
SunCart Store
 
ASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NETASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NET
Eduardo Pires
 
UI frameworks
UI frameworksUI frameworks
UI frameworks
Denis Jakuzza
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
Xavier Fornés Arrabal
 
Intro to modern web technology
Intro to modern web technologyIntro to modern web technology
Intro to modern web technology
Chris Love
 
Dot Net Framework An Overview
Dot Net Framework   An OverviewDot Net Framework   An Overview
Dot Net Framework An Overview
MicrosoftFeed
 
A Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVMA Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVM
Chris Bannon
 
Node.js - Greece JS Meetup 2012
Node.js - Greece JS Meetup 2012Node.js - Greece JS Meetup 2012
Node.js - Greece JS Meetup 2012
Kostas Karolemeas
 
IBM Bluemix for Administrators with Focus on XPages
IBM Bluemix for Administrators with Focus on XPagesIBM Bluemix for Administrators with Focus on XPages
IBM Bluemix for Administrators with Focus on XPages
Niklas Heidloff
 
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
Idexcel Technologies
 
Component Based Development
Component Based DevelopmentComponent Based Development
Component Based Development
Ben McCormick
 
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
Lohith Goudagere Nagaraj
 
Inside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript ProductInside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript Product
Chris Bannon
 
Top Node.JS Frameworks to Look at in 2020
Top Node.JS Frameworks to Look at in 2020Top Node.JS Frameworks to Look at in 2020
Top Node.JS Frameworks to Look at in 2020
Roshani Patel
 
BDD by example
BDD by exampleBDD by example
BDD by example
Xavier Fornés Arrabal
 
Ui technologies
Ui technologiesUi technologies
Ui technologies
Mallikarjuna G D
 
Access.net presentation
Access.net presentationAccess.net presentation
Access.net presentation
Waleed AlZoghby
 
Microservice intro
Microservice introMicroservice intro
Microservice intro
ramesh_sharma
 
Full stack devlopment using django main ppt
Full stack devlopment using django main pptFull stack devlopment using django main ppt
Full stack devlopment using django main ppt
SudhanshuVijay3
 
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
CodeValue
 
Website development &amp; it's trends
Website development &amp; it's trendsWebsite development &amp; it's trends
Website development &amp; it's trends
SunCart Store
 
ASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NETASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NET
Eduardo Pires
 
Intro to modern web technology
Intro to modern web technologyIntro to modern web technology
Intro to modern web technology
Chris Love
 
Dot Net Framework An Overview
Dot Net Framework   An OverviewDot Net Framework   An Overview
Dot Net Framework An Overview
MicrosoftFeed
 
A Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVMA Smooth Transition to HTML5 Using MVVM
A Smooth Transition to HTML5 Using MVVM
Chris Bannon
 
Node.js - Greece JS Meetup 2012
Node.js - Greece JS Meetup 2012Node.js - Greece JS Meetup 2012
Node.js - Greece JS Meetup 2012
Kostas Karolemeas
 
IBM Bluemix for Administrators with Focus on XPages
IBM Bluemix for Administrators with Focus on XPagesIBM Bluemix for Administrators with Focus on XPages
IBM Bluemix for Administrators with Focus on XPages
Niklas Heidloff
 
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
Idexcel Technologies
 
Component Based Development
Component Based DevelopmentComponent Based Development
Component Based Development
Ben McCormick
 
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
Lohith Goudagere Nagaraj
 
Inside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript ProductInside Wijmo 5, a Large-scale JavaScript Product
Inside Wijmo 5, a Large-scale JavaScript Product
Chris Bannon
 
Top Node.JS Frameworks to Look at in 2020
Top Node.JS Frameworks to Look at in 2020Top Node.JS Frameworks to Look at in 2020
Top Node.JS Frameworks to Look at in 2020
Roshani Patel
 
Full stack devlopment using django main ppt
Full stack devlopment using django main pptFull stack devlopment using django main ppt
Full stack devlopment using django main ppt
SudhanshuVijay3
 

Viewers also liked (20)

How I Became a WordPress Hacker
How I Became a WordPress HackerHow I Became a WordPress Hacker
How I Became a WordPress Hacker
Mike Zielonka
 
Id smm
Id smmId smm
Id smm
Dmitri Artamonov
 
WooCommerce WP-CLI Basics
WooCommerce WP-CLI BasicsWooCommerce WP-CLI Basics
WooCommerce WP-CLI Basics
corsonr
 
Modals
ModalsModals
Modals
mrzeledonb
 
2 pgt milano zona 2 - 20 settembre -casa della carita -pietro lembi
2 pgt milano zona 2 - 20 settembre -casa della carita -pietro lembi2 pgt milano zona 2 - 20 settembre -casa della carita -pietro lembi
2 pgt milano zona 2 - 20 settembre -casa della carita -pietro lembi
Libertà e Giustizia
 
20100916 presentatiekunstroute2010
20100916 presentatiekunstroute201020100916 presentatiekunstroute2010
20100916 presentatiekunstroute2010
Coen Franken
 
Local Food and Local Spirits Cocktail Party in support of the Cooperstown Far...
Local Food and Local Spirits Cocktail Party in support of the Cooperstown Far...Local Food and Local Spirits Cocktail Party in support of the Cooperstown Far...
Local Food and Local Spirits Cocktail Party in support of the Cooperstown Far...
Otsego2000
 
20130531 linq with_row_number
20130531 linq with_row_number20130531 linq with_row_number
20130531 linq with_row_number
LearningTech
 
e0108
e0108e0108
e0108
y8b6z9a7
 
The first conditional
The first conditionalThe first conditional
The first conditional
joseandresmolina
 
การทำตัวอักษรควันบุหรี่
การทำตัวอักษรควันบุหรี่การทำตัวอักษรควันบุหรี่
การทำตัวอักษรควันบุหรี่
Lovevy Poi
 
Glori A
Glori AGlori A
Glori A
lacortes
 
Net neutrality &amp; it’s legal issues
Net neutrality &amp; it’s legal issuesNet neutrality &amp; it’s legal issues
Net neutrality &amp; it’s legal issues
mruns_96
 
2011 12-08 tudelft goes mobile
2011 12-08 tudelft goes mobile2011 12-08 tudelft goes mobile
2011 12-08 tudelft goes mobile
Moqub M
 
Cracked Pot
Cracked  PotCracked  Pot
Cracked Pot
adnilz78
 
Búsqueda y gestión de la información en la web
Búsqueda y gestión de la información en la webBúsqueda y gestión de la información en la web
Búsqueda y gestión de la información en la web
gladysloor93
 
み言葉の黙想(2013年3月・4月)~テゼ共同体の昼の祈りから
み言葉の黙想(2013年3月・4月)~テゼ共同体の昼の祈りからみ言葉の黙想(2013年3月・4月)~テゼ共同体の昼の祈りから
み言葉の黙想(2013年3月・4月)~テゼ共同体の昼の祈りから
Mokusou to Inori
 
YouTube presentación
YouTube presentaciónYouTube presentación
YouTube presentación
Aleix123456789
 
Exercises during Pregnancy
Exercises during PregnancyExercises during Pregnancy
Exercises during Pregnancy
PSRI Hospital
 
How I Became a WordPress Hacker
How I Became a WordPress HackerHow I Became a WordPress Hacker
How I Became a WordPress Hacker
Mike Zielonka
 
WooCommerce WP-CLI Basics
WooCommerce WP-CLI BasicsWooCommerce WP-CLI Basics
WooCommerce WP-CLI Basics
corsonr
 
2 pgt milano zona 2 - 20 settembre -casa della carita -pietro lembi
2 pgt milano zona 2 - 20 settembre -casa della carita -pietro lembi2 pgt milano zona 2 - 20 settembre -casa della carita -pietro lembi
2 pgt milano zona 2 - 20 settembre -casa della carita -pietro lembi
Libertà e Giustizia
 
20100916 presentatiekunstroute2010
20100916 presentatiekunstroute201020100916 presentatiekunstroute2010
20100916 presentatiekunstroute2010
Coen Franken
 
Local Food and Local Spirits Cocktail Party in support of the Cooperstown Far...
Local Food and Local Spirits Cocktail Party in support of the Cooperstown Far...Local Food and Local Spirits Cocktail Party in support of the Cooperstown Far...
Local Food and Local Spirits Cocktail Party in support of the Cooperstown Far...
Otsego2000
 
20130531 linq with_row_number
20130531 linq with_row_number20130531 linq with_row_number
20130531 linq with_row_number
LearningTech
 
การทำตัวอักษรควันบุหรี่
การทำตัวอักษรควันบุหรี่การทำตัวอักษรควันบุหรี่
การทำตัวอักษรควันบุหรี่
Lovevy Poi
 
Net neutrality &amp; it’s legal issues
Net neutrality &amp; it’s legal issuesNet neutrality &amp; it’s legal issues
Net neutrality &amp; it’s legal issues
mruns_96
 
2011 12-08 tudelft goes mobile
2011 12-08 tudelft goes mobile2011 12-08 tudelft goes mobile
2011 12-08 tudelft goes mobile
Moqub M
 
Cracked Pot
Cracked  PotCracked  Pot
Cracked Pot
adnilz78
 
Búsqueda y gestión de la información en la web
Búsqueda y gestión de la información en la webBúsqueda y gestión de la información en la web
Búsqueda y gestión de la información en la web
gladysloor93
 
み言葉の黙想(2013年3月・4月)~テゼ共同体の昼の祈りから
み言葉の黙想(2013年3月・4月)~テゼ共同体の昼の祈りからみ言葉の黙想(2013年3月・4月)~テゼ共同体の昼の祈りから
み言葉の黙想(2013年3月・4月)~テゼ共同体の昼の祈りから
Mokusou to Inori
 
Exercises during Pregnancy
Exercises during PregnancyExercises during Pregnancy
Exercises during Pregnancy
PSRI Hospital
 
Ad

Similar to WinJS at NYC Code Camp 2012 (20)

Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
Amir Zuker
 
The Enterprise Dilemma: Native vs. Web
The Enterprise Dilemma: Native vs. WebThe Enterprise Dilemma: Native vs. Web
The Enterprise Dilemma: Native vs. Web
Motorola Mobility - MOTODEV
 
CODE IGNITER
CODE IGNITERCODE IGNITER
CODE IGNITER
Yesha kapadia
 
Cloud application architecture with sql azure and windows azure
Cloud application architecture with sql azure and windows azureCloud application architecture with sql azure and windows azure
Cloud application architecture with sql azure and windows azure
Eduardo Castro
 
PPT with Flash ry
PPT with Flash ryPPT with Flash ry
PPT with Flash ry
marina2207
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
Hosam Kamel
 
Security strategies for html5 enterprise mobile apps
Security strategies for html5 enterprise mobile appsSecurity strategies for html5 enterprise mobile apps
Security strategies for html5 enterprise mobile apps
Gizmox
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET Webskills
Caleb Jenkins
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
WAD - WaveMaker tutorial
WAD - WaveMaker tutorial WAD - WaveMaker tutorial
WAD - WaveMaker tutorial
marina2207
 
WaveMaker tutorial with Flash
WaveMaker tutorial with FlashWaveMaker tutorial with Flash
WaveMaker tutorial with Flash
marina2207
 
Microsoft Azure: Desarrollando en la Nube con PHP y Control de Código Fuente ...
Microsoft Azure: Desarrollando en la Nube con PHP y Control de Código Fuente ...Microsoft Azure: Desarrollando en la Nube con PHP y Control de Código Fuente ...
Microsoft Azure: Desarrollando en la Nube con PHP y Control de Código Fuente ...
Peter Concha
 
Angular JS Basics
Angular JS BasicsAngular JS Basics
Angular JS Basics
Mounish Sai
 
WaveMaker Presentation
WaveMaker PresentationWaveMaker Presentation
WaveMaker Presentation
Alexandru Chica
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
Richard Banks
 
Development of Multiplatform CMS System with Zend Framework
Development of Multiplatform CMS System with Zend FrameworkDevelopment of Multiplatform CMS System with Zend Framework
Development of Multiplatform CMS System with Zend Framework
Sinisa Vukovic
 
WindowsAzureWebSites cucuxuxifuztays7(,7,6,8?)
WindowsAzureWebSites cucuxuxifuztays7(,7,6,8?)WindowsAzureWebSites cucuxuxifuztays7(,7,6,8?)
WindowsAzureWebSites cucuxuxifuztays7(,7,6,8?)
LohithSinghJ1
 
Sybase sup hybrid_web_container_article_wp
Sybase sup hybrid_web_container_article_wpSybase sup hybrid_web_container_article_wp
Sybase sup hybrid_web_container_article_wp
Prabhakar Manthena
 
Front End Development | Introduction
Front End Development | IntroductionFront End Development | Introduction
Front End Development | Introduction
JohnTaieb
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
Amir Zuker
 
Cloud application architecture with sql azure and windows azure
Cloud application architecture with sql azure and windows azureCloud application architecture with sql azure and windows azure
Cloud application architecture with sql azure and windows azure
Eduardo Castro
 
PPT with Flash ry
PPT with Flash ryPPT with Flash ry
PPT with Flash ry
marina2207
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
Hosam Kamel
 
Security strategies for html5 enterprise mobile apps
Security strategies for html5 enterprise mobile appsSecurity strategies for html5 enterprise mobile apps
Security strategies for html5 enterprise mobile apps
Gizmox
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET Webskills
Caleb Jenkins
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
WAD - WaveMaker tutorial
WAD - WaveMaker tutorial WAD - WaveMaker tutorial
WAD - WaveMaker tutorial
marina2207
 
WaveMaker tutorial with Flash
WaveMaker tutorial with FlashWaveMaker tutorial with Flash
WaveMaker tutorial with Flash
marina2207
 
Microsoft Azure: Desarrollando en la Nube con PHP y Control de Código Fuente ...
Microsoft Azure: Desarrollando en la Nube con PHP y Control de Código Fuente ...Microsoft Azure: Desarrollando en la Nube con PHP y Control de Código Fuente ...
Microsoft Azure: Desarrollando en la Nube con PHP y Control de Código Fuente ...
Peter Concha
 
Angular JS Basics
Angular JS BasicsAngular JS Basics
Angular JS Basics
Mounish Sai
 
Architecting Microservices in .Net
Architecting Microservices in .NetArchitecting Microservices in .Net
Architecting Microservices in .Net
Richard Banks
 
Development of Multiplatform CMS System with Zend Framework
Development of Multiplatform CMS System with Zend FrameworkDevelopment of Multiplatform CMS System with Zend Framework
Development of Multiplatform CMS System with Zend Framework
Sinisa Vukovic
 
WindowsAzureWebSites cucuxuxifuztays7(,7,6,8?)
WindowsAzureWebSites cucuxuxifuztays7(,7,6,8?)WindowsAzureWebSites cucuxuxifuztays7(,7,6,8?)
WindowsAzureWebSites cucuxuxifuztays7(,7,6,8?)
LohithSinghJ1
 
Sybase sup hybrid_web_container_article_wp
Sybase sup hybrid_web_container_article_wpSybase sup hybrid_web_container_article_wp
Sybase sup hybrid_web_container_article_wp
Prabhakar Manthena
 
Front End Development | Introduction
Front End Development | IntroductionFront End Development | Introduction
Front End Development | Introduction
JohnTaieb
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
WebStackAcademy
 
Ad

Recently uploaded (20)

Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 

WinJS at NYC Code Camp 2012

  • 1. Introduction to WinJS Dmitri Artamonov BlueMetal Architects [email protected] #dartamon
  • 8. Agenda  Switching from C#  What is WinJS?  What’s under the hood?  Where does WinJS fit?  What’s new in WinJS?  Patterns and Practices  Managing WinJS on the Enterprise  Testing WinJS for Store Submission
  • 9. What I will not talk about  Tiles and Notifications  Content before Chrome  Sensors/NFC  Contracts/Charms  New Controls  Process Lifecycle Management  Triggers/Background Tasks  Etc…
  • 10. Switching from C#/XAML to WinJS  Difference in thinking – advantages of HTML5 over XAML  XAML -> HTML5/CSS3  C#/CLR -> Javascript/WinJS  Code Organization  MVVM -> MVC  Available Tools  Is C# now obsolete?
  • 11. What is WinJS?  A standard library to access native Windows 8 functionality through Javascript and HTML5  Fully HTML5-compliant  Uses attributes to add new Windows 8 functionality to standard HTML5 code  Accessed as a standard object in Javascript
  • 13. What’s under the hood?  Language projections  Web hardware-accelerated rendering and Javascript interpretation technology originally started with IE9 (HTML5 compliant)  Connects to the same .winmd components as the C#/XAML Windows 8 applications  Chakra JScript engine has its peculiarities – garbage collection is done at the end of script execution, can use up a lot of memory  Will WinJS evolve away from IE roots?
  • 14. Under the hood (cont’d)  Chakra engine for Javascript interpretation
  • 15. Where does WinJS fit?  Rapid development, friendly to web developers  Performance can be slower than other languages, may improve in the future  Can fully interface with components written in other languages  More maintainable by enterprises with web developer staff  Development can be less frustrating and cheaper if you take advantage of libraries and resources already available to JS developers  Lower costs and faster workflow – designers can work with HTML directly
  • 17. Other JS Libraries  jQuery  Graphing (HighCharts or Raphael)  MVC libraries  You can create applications without using WinJS at all!
  • 18. What’s new?  Page Structure/Navigation  Promises  Cloud Integration  Contracts  Tiles and Notifications  Speech Integration
  • 19. Page Structure and Navigation in WinJS  Similar to the browser – HTML file that references JS files  PageControlNavigator out of the box  Navigation back stack  Standard Project Template Demo
  • 20. Promises  Async pattern implemented in javascript, similar to try-catch-finally WinJS.xhr({ url: urlString, responseType: "json" }).then( function handleResponse(result) { // Handle the returned data }, function handleException(exception) { // Handle return exception } ).done(function afterResponse() { // Handle code to be executed once xhr returns });
  • 21. Cloud integration  File Picker APIs – saving to the cloud and loading from the cloud – allows us to expose the cloud as part of the file system  File Picker APIs – exposes a custom UI that allows users to pick files to open or a location to save - hosted view activation.  File Picker APIs – what constitutes a file is up to you – aggregation?  Roaming API – saving data in the cloud that is associated with your profile  Roaming API - creating an experience, not just one app on one machine  SkyDrive Demo
  • 22. Patterns and Practices  MVC?  Regions  Combining WinJS with C# via .winmd components  Modules and Dependency Injection  Dynamic code loading (requires disabling security)
  • 23. MVVM  There were problems with MVVM  Lack of controllers in classic MVVM, debate between heavy VMs and use of controllers  Dedicated classes to store information for presentation  With XAML, only one DataContext per view  Can’t be directly transitioned to WinJS – absence of two-way bindings, multiple data contexts per view
  • 27. MVC on WinJS  Where do we move from MVVM? Is MVVM dead?  Current limitation: no two-way binding in WinJS  Have to trap user input and respond to it  Trapping can be done via a controller, get rid of classic MVVM  Application/Domain Model conversion can be done via regions  Use defined namespaces and classes to create observable objects; ways to make objects observable are also available
  • 28. Regions  Using the magic of WinJS we can bind elements to objects, thus setting their datacontext  Two ways we can do the binding: data-win-bind and data-win- bindsource  data-win-bind is used for binding a single field to the data context HTML5: <span data-win-bind=“innerText: dto.title”></span> JS: WinJS.Binding.processAll(target element, data context object)
  • 29. Regions (cont’d)  data-win-bindsource allows to set the data context for an element declaratively instead of calling WinJS.Binding.processAll() in Javascript  <div data-win-bindsource=“dto">  Allows for more binding code to be moved into HTML5
  • 30. Using .winmd components  You can create your own .winmd components in other languages that your app can interface with, the same way it does with WinJS  Take advantage of performance or library disparities – different components are implemented differently
  • 31. Modules and dependency injection  Javascript was born from simple scripting  Modern applications require maintainable, testable code with private scope  A module is an anonymous, self-executing function with parameters for dependency injection: (function (internalParam1, internalParam2) { "use strict"; // private code goes here })(globalParam1, globalParam2);
  • 32. Modules and namespaces  Exposing endpoints for public access from the module via classes and namespaces: WinJS.Namespace.define("ClassicCars", { FindCars: _findCars(), // can define members in namespaces RepairBills: WinJS.Class.define(function(quantity) { // constructor code goes here }, { GetCost: _getCost }, // instance members { repairBillTypes: [ “S", “U" ] }) // static members });
  • 33. Dynamic code loading  What if we could update the application dynamically, without having to re-distribute it?  Can download HTML/JS code via iframe (security enabled, features disabled)  Fragments API – able to load in HTML content from external web sources into the application  Can download code directly into the app (requires unsecure calls, will not be allowed in the Windows Store)  execUnsafeLocalFunction - overrides HTML injection security
  • 34. Managing WinJS on the enterprise  What are the development costs?  Effectiveness vs. C#/XAML or C++  Migration of previous code?  What happens to legacy applications on C#?  What happens to legacy web applications that we want to migrate to Windows 8?  How to write internal applications and deploy – next slide
  • 35. Enterprise story (unofficial)  Internal Windows Store for enterprise applications  Deployment by employees to their machines from a restricted pool of applications  Enforces security policies  Creates a contained environment for controlling what applications are on enterprise machines
  • 37. Testing for Submission - WACK  The submission process involves automatic testing  Windows App Certification Kit  Microsoft provides a testing kit for developers to test their applications in advance  Tests security, performance, etc.  Subjectivity kept to a minimum, maximum transparency
  • 38. Questions? [email protected] #dartamon http://blog.bluemetal.com

Editor's Notes

  • #11: Advantages of HTML5 over XAML, better organization Role of WinRT Components and C# in the new Javscript world
  • #13: WinRT through .winmd components provides the functionality. Language projections connect the individual languages down to the .winmd components. Runtime Broker provides sandboxing and guards against illegal API calls
  • #22: Demo skydriveHave a web application for data entry and work on analysis using the tablet, sync the files as part of the file systemHosted view activation – the view inside the app trying to open or save the file actually opens a frame that displays your application
  • #36: Migration - Salvaging business logic vs. presentation layer