2012 mct summit presentation
DESCRIPTION
TRANSCRIPT
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
Deep Dive into WinJS
Dmitri Artamonov
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• The C# Legacy
• What’s under the hood?
• Where does WinJS fit?
• What’s new in WinJS?
• Patterns and practices
• Integration with enterprise systems
• Managing WinJS development
Agenda
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Implementation details
• WinJS features common with C#/XAML
• Process lifecycle management
• Etc…
Outside of scope
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Difference in thinking
• Code organization
• Available tools
• Is C# now obsolete?
Away from C# to WinJS
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Language projections
• Connected to same WinRT components
• Hardware-accelerated JS technology from IE
• Will WinJS evolve away?
Under the hood
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Rapid Development
• Reuse web monkeys
• Better view surface on top of C# logic
• Large existing ecosystem for developers
• Cheaper UI design process
The Fit
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• jQuery
• Graphing and Charting
• MVC
• You can even create apps without WinJS
The Fit - Other Libraries
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Async pattern
• function – then – done
• Potentially multi-threaded
• Careful accessing resources not yet returned
Patterns - Promises
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• MVVM had problems
• Poor balancing of responsibilities
• Implementation – one context per view
• Mostly wasted code-behind
• No two-way bindings in WinJS
Patterns – MV…
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Controllers for user input
• AM/DM conversion with namespaces and classes
• Classes and namespaces are observable
Patterns - MVC
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Data contexts defined for individual DOM elements
• data-win-bind and data-win-bindsource
• Declarative and programmatic ways
Patterns - Regions
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• C# good at logic and model manipulation
• Use it, expose data via component to WinJS
• Access it as normal namespace/class
• Take advantage of performance of C++/C#
Patterns – C# .winmd components
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Information hiding done via modules
• Anonymous self-executing function with parameters
• Code inside module is private
• Parameters allow dependency injection and testing
• Data exposed via namespaces and classes
Patterns – Modules and DI
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Deploy once, keep updating
• Forbidden by security for the Windows Store
• Uses execUnsafeLocalFunction
• Alternatives – iframe, Fragments API
Patterns - Dynamic code loading
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• File Picker API - fluid file system
• Roaming API – unified experience
• Share Contract – enterprise workflows
• Tiles – enterprise dashboards
• Windows Push Notification Services for communication through tile updates
Integration with Enterprise Systems
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Training
• Design
• Development
• Testing
• Deployment
• Maintenance
Managing WinJS - Costs
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Legacy Applications
• Browser -> WinJS != WinJS -> Browser
• Code compatibility and migration
• Deploying via the Enterprise Store
Managing WinJS (cont’d)
MCT Summit North America | October, 17th – October 20th, 2012 | Redmond
• Private store for the enterprise
• Enterprise machines can deploy from fixed set of apps
• Enforce security policies
• Restores controlled enterprise environment
Enterprise Store (unofficial)