SlideShare uma empresa Scribd logo
1 de 31
Fabio Franzini
Designing complex applications using HTML5 and
KnockoutJS

fabio@fabiofranzini.com - @franzinifabio
About Me
                  Fabio franzini                 fabio@fabiofranzini.com - @franzinifabio




   Senior Consultant and Software Engineer
   MCT Trainer, MCPD Web Applications, MCTS SharePoint 2010/2007
   Official Ignite Trainer for SharePoint 2013 & 2010 in Italy
   Web Stack Lover
   Over 9 years experience in IT as a software engineer

Blog: www.fabiofranzini.com
Email: fabio@fabiofranzini.com
Agenda
                    Fabio franzini           fabio@fabiofranzini.com - @franzinifabio




1.   Introduction
2.   HTML5
3.   JavaScript and Client Side Frameworks
4.   Server Side Tools
5.   Multiplatform
6.   Demo
Introduction
              Fabio franzini              fabio@fabiofranzini.com - @franzinifabio




What is the keys to create complex applications in javascript
without becoming crazy?

1. Write clean code!!
2. Modularization and Reuse of code!!
3. Use frameworks or tools that simplify the work!!
Why HTML5?
             Fabio franzini           fabio@fabiofranzini.com - @franzinifabio




• Cross Browser
• Cross Platform
• W3C Standards
• All modern browsers and mobile devices supports
  HTML5
• Rich set of controls and APIs
JavaScript is…
                Fabio franzini                 fabio@fabiofranzini.com - @franzinifabio




• From Wikipedia:
   – A prototype-based scripting language that is dynamic, weakly
     typed and has first-class functions.
   – A multi-paradigm language, supporting object-oriented,
     imperative, and functional programming styles.


• In short, a big mess for most developers :)
Modularize your code using the module pattern!
                   Fabio franzini                      fabio@fabiofranzini.com - @franzinifabio




• Group several related elements such as classes, singletons, methods,
  globally used, into a simple object.
• It fakes classes in Javascript.

• Pros
    – Encapsulation, it gives us an API (public and private attributes or
      methods)
    – Avoid names conflicting with other function
    – Easier debugging (public functions are named)
• Cons:
    – Difficult to refactor
Module Pattern: Example
                 Fabio franzini                  fabio@fabiofranzini.com - @franzinifabio




 var testModule = ( function() {
      var counter = 0;
      var privateMethod = function() {
        // do something….
      }
      return {
        incrementCounter: function() { return counter++; },
        resetCounter: function() { counter = 0; }
      };
})();
Revealing Module Pattern
                  Fabio franzini              fabio@fabiofranzini.com - @franzinifabio




Coined by Christian Heilmann (Mozilla Foundation)
Pros
    – Sintax more consistent and easy to read
    – Easier to refactor
var myRevealingModule = ( function() {
     var name = 'John Smith';
     function updatePerson() {
               name = 'John Smith Updated';
     }
     function setPerson (value) {
               name = value;
     }
     return { set: setPerson };
}());
RequireJs for implement Module Pattern
                  Fabio franzini                     fabio@fabiofranzini.com - @franzinifabio




• RequireJs is a JavaScript file and module loader.
• Using a modular script loader like RequireJS will improve the speed
  and quality of your code!

[myPage.html]
<script data-main="scripts/main" src="scripts/require-jquery.js"></script>
…..
[main.js]
require(["jquery", "jquery.alpha", "jquery.beta"], function($) {
    //the jquery.alpha.js and jquery.beta.js plugins have been loaded.
    $(function() {
         $('body').alpha().beta();
    });
});
Another Pattern
                 Fabio franzini                  fabio@fabiofranzini.com - @franzinifabio




•   MV* Pattern
    – The MV* Pattern allows to separate the functionalities and
      introduce greater flexibility to customize the presentation of
      items
    – Provides a standard model interface to allow a wide range of data
      sources to be used with existing item views
    – Different implementation: MVC, MVP, MVVM
•   Observer (Pub/Sub) Pattern
    – It is a design pattern which allows an object (known as a
      subscriber) to watch another object (the publisher)
    – Loose coupling, ability to break down our applications into
      smaller, general manageability
KnockoutJs
                 Fabio franzini                  fabio@fabiofranzini.com - @franzinifabio




• Model: It uses the Observable property that can notify subscribers
  about changes and automatically detect dependencies
• View: A KnockoutJs View is simply a HTML document with
  declarative bindings to link it to the ViewModel
• ViewModel: The ViewModel can be considered a specialized
  Controller that acts as a data converter. It changes Model information
  into View information, passing commands from the View to the
  Model
KnockoutJs ViewModel
                     Fabio franzini                       fabio@fabiofranzini.com - @franzinifabio




function AppViewModel() {
  this.firstName = ko.observable("Bert");
  this.lastName = ko.observable("Bertington");

    this.fullName = ko.computed(function() {
       return this.firstName() + " " + this.lastName();
    }, this);

    this.capitalizeLastName = function() {
       var currentVal = this.lastName();
       this.lastName(currentVal.toUpperCase());
    };
}

// Activates knockout.js
ko.applyBindings(new AppViewModel());
KnockoutJs View
                    Fabio franzini                          fabio@fabiofranzini.com - @franzinifabio




<p>First name: <input data-bind="value: firstName" /></p>

<p>Last name: <input data-bind="value: lastName" /></p>

<p>Full name: <strong data-bind="text: fullName"></strong></p>

<button data-bind="click: capitalizeLastName">Go caps</button>
List of other Powerfull JavaScript FX
           Fabio franzini                  fabio@fabiofranzini.com - @franzinifabio




•   AmplifyJs
•   UnderscoreJs
•   LinqJs
•   DurandalJs
•   BreezeJS
AmplifyJs
                 Fabio franzini                   fabio@fabiofranzini.com - @franzinifabio




Is a set of components designed to solve common web application
problems with a simplistic API like
     – amplify.request provides a clean and elegant request abstraction
        for all types of data, even allowing for transformation prior to
        consumption.
     – amplify.publish/subscribe provides a clean, performant API for
        component to component communication.
     – amplify.store takes the confusion out of HTML5 localStorage. It
        doesn't get simpler than using amplify.store(key, data)! It even
        works flawlessly on mobile devices.
UnderscoreJs
                       Fabio franzini                                fabio@fabiofranzini.com - @franzinifabio




Underscore is a utility library that provides a lots of functions without
extending any of the built-in JavaScript objects



 UnderscoreJs Functions
  Collection   Arrays               Functions     Objects       Utility             Chaining
  •   Each     •   First            •   Bind      •   Keys      •   Random          • Chain
  •   Map      •   Initial          •   BindAll   •   Values    •   uniqueId        • Value
  •   Reduce   •   Union            •   Wrap      •   Extend    •   Escape
  •   Find     •   Etc…             •   Etc…      •   isEqual   •   Etc..
  •   Where                                       •   isEmpty
  •   Any                                         •   Etc…
  •   Etc…
linq.js - LINQ for JavaScript
                          Fabio franzini                                 fabio@fabiofranzini.com - @franzinifabio




•   implement all .NET 4.0 linq to object methods and extra methods
•   complete lazy evaluation
•   full IntelliSense support for VisualStudio
•   two versions: linq.js and jquery.linq.js (jQuery plugin)

var jsonArray = [
   { "user": { "id": 100, "screen_name": "d_linq" }, "text": "to objects" },
   { "user": { "id": 130, "screen_name": "c_bill" }, "text": "g" },
   { "user": { "id": 155, "screen_name": "b_mskk" }, "text": "kabushiki kaisha" },
   { "user": { "id": 301, "screen_name": "a_xbox" }, "text": "halo reach" }
];
var queryResult = Enumerable.From(jsonArray)
   .Where(function (x) { return x.user.id < 200 })
   .OrderBy(function (x) { return x.user.screen_name })
   .Select(function (x) { return x.user.screen_name + ':' + x.text })
   .ToArray();
DurandalJs
                        Fabio franzini                                fabio@fabiofranzini.com - @franzinifabio




Durandal is small JavaScript framework designed to make building Single Page Applications
(SPAs) simple and elegant. We didn't try to re-invent the wheel. Durandal is built on libs you know
and love like jQuery, Knockout and RequireJS. There's little to learn and building apps feels
comfortable and familiar.

•   Clean MV* Architecture
•   JS & HTML Modularity
•   Simple App Lifecycle
•   Eventing, Modals, Message Boxes, etc.
•   Navigation & Screen State Management
•   Consistent Async Programming w/ Promises
•   App Bundling and Optimization
•   Use any Backend Technology
•   Built on top of jQuery, Knockout & RequireJS
•   Integrates with other libraries such as SammyJS & Bootstrap
•   Make jQuery & Bootstrap widgets templatable and bindable (or build your own widgets).
DurandalJs – Demo
Fabio franzini          fabio@fabiofranzini.com - @franzinifabio




             DEMO
           DurandalJs
BreezeJs
                                 Fabio franzini                                                fabio@fabiofranzini.com - @franzinifabio




Breeze is a library for rich client applications written in HTML and JavaScript.
It concentrates on the challenge of building and maintaining highly responsive, data-intensive applications in which users
      search, add, update, and view complex data from different angles as they pursue solutions to real problems in real time.

Features include:
•    Rich queries using a LINQ-like query syntax
•    Client-side caching
•    Change tracking
•    Validation
•    Pluggable back-end
       •    Full integration with the Entity Framework.
       •    Supports WebAPI and OData back-ends.
       •    Works with NoSQL, non-.NET, and SOA back-ends
•    Data management
•    Batched saves
•    Library and Tooling support
       •    Out-of-box support for Knockout, Angular, and Backbone.
       •    TypeScript support for compile-time type checking, classes, interfaces, and inheritance.
       •    IntelliSense support for Visual Studio 2012.
       •    RequireJS-enabled for modular applications.
       •    Open API that allows additional front or back-ends to be plugged in.
BreezeJs
Fabio franzini   fabio@fabiofranzini.com - @franzinifabio
BreezeJs– Demo
Fabio franzini              fabio@fabiofranzini.com - @franzinifabio




                  DEMO
                 BreezeJs
Server Side Tools
           Fabio franzini     fabio@fabiofranzini.com - @franzinifabio




• TypeScript
• ScriptSharp
TypeScript
                    Fabio franzini                      fabio@fabiofranzini.com - @franzinifabio




TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.

•   TypeScript starts from the syntax and semantics that millions of JavaScript
    developers know today.

•   You can use existing JavaScript code, incorporate popular JavaScript
    libraries, and be called from other JavaScript code.

•   Compiles to clean, simple JavaScript code which runs on any browser, in
    Node.js, or in any other ES3-compatible environment.
TypeScript – Simple Example
                       Fabio franzini                     fabio@fabiofranzini.com - @franzinifabio




            TypeScript                                 JavaScript
class Greeter {                           var Greeter = (function () {
   greeting: string;                         function Greeter(message) {
   constructor (message: string) {              this.greeting = message;
      this.greeting = message;               }
   }                                         Greeter.prototype.greet =
   greet() {                                 function () {
      return "Hello, " + this.greeting;         return "Hello, " + this.greeting;
   }                                         };
}                                           return Greeter;
                                          })();
var greeter = new Greeter("world");       var greeter = new Greeter("world");
alert(greeter.greet());                   alert(greeter.greet());
ScriptSharp
                    Fabio franzini                       fabio@fabiofranzini.com - @franzinifabio




Script# is a free tool that generates JavaScript by compiling C# source code.

•   The goal is to enable you to leverage the productivity of C#, the Visual Studio
    IDE, and .NET tools and apply them to your HTML5 development.

•   The Script# compiler is a development/build-time tool that takes a
    pragmatic approach to generating script for use in real-world script-based
    applications, without introducing any unnecessary layers of abstraction.
Package Apps
         Fabio franzini   fabio@fabiofranzini.com - @franzinifabio




• Apache Cordova
• AppJs
Apache Cordova (PhoneGap)
                   Fabio franzini                     fabio@fabiofranzini.com - @franzinifabio




Is a platform for building native mobile applications using HTML, CSS
and JavaScript
• Pros
     – The Power of HTML5
     – Build native App
     – Interact with Device API’s
• Conts
     – Performance of WebBrowser
        Control on target device…
AppJs
                  Fabio franzini                   fabio@fabiofranzini.com - @franzinifabio




AppJS is an SDK to develop desktop applications using Node.js melded
with Chromium.

You get all the following in one package:
• JS, HTML5, CSS, SVG, WebGL — by Chromium
• mature HTTP/HTTPS servers and client APIs — by Node.js
• filesystem, DNS, cryptography, subprocesses, OS APIs — by Node.js
• sandboxed code execution environements, virtual machines — by Node.js
• tools for exposing native C++ bindings to JavaScript — by Node.js
Q&A
    Fabio franzini   fabio@fabiofranzini.com - @franzinifabio




           ;-)
Questions & Answer time!

Mais conteúdo relacionado

Mais procurados

Single page applications & SharePoint
Single page applications & SharePointSingle page applications & SharePoint
Single page applications & SharePointFabio Franzini
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointMark Rackley
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien
 
STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010Shakir Majeed Khan
 
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien
 
Bringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePointBringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePointChad Schroeder
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien
 
SharePoint REST vs CSOM
SharePoint REST vs CSOMSharePoint REST vs CSOM
SharePoint REST vs CSOMMark Rackley
 
Getting Started with SharePoint Development
Getting Started with SharePoint DevelopmentGetting Started with SharePoint Development
Getting Started with SharePoint DevelopmentChakkaradeep Chandran
 
Industrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netIndustrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netPankaj Kushwaha
 
O365Con18 - Site Templates, Site Life Cycle Management and Modern SharePoint ...
O365Con18 - Site Templates, Site Life Cycle Management and Modern SharePoint ...O365Con18 - Site Templates, Site Life Cycle Management and Modern SharePoint ...
O365Con18 - Site Templates, Site Life Cycle Management and Modern SharePoint ...NCCOMMS
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopMark Rackley
 
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...Mark Roden
 
IBM Digital Experience Theme Customization
IBM Digital Experience Theme CustomizationIBM Digital Experience Theme Customization
IBM Digital Experience Theme CustomizationVan Staub, MBA
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the webIvano Malavolta
 
Hard learned CSOM and REST tips
Hard learned CSOM and REST tipsHard learned CSOM and REST tips
Hard learned CSOM and REST tipsSPC Adriatics
 
Share point apps the good, the bad, and the pot of gold at the end of the r...
Share point apps   the good, the bad, and the pot of gold at the end of the r...Share point apps   the good, the bad, and the pot of gold at the end of the r...
Share point apps the good, the bad, and the pot of gold at the end of the r...Bill Ayers
 
More object oriented development with Page Type Builder
More object oriented development with Page Type BuilderMore object oriented development with Page Type Builder
More object oriented development with Page Type Builderjoelabrahamsson
 

Mais procurados (20)

Single page applications & SharePoint
Single page applications & SharePointSingle page applications & SharePoint
Single page applications & SharePoint
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePoint
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
 
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...Chris O'Brien - Modern SharePoint development: techniques for moving code off...
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
 
STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010
 
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
 
Bringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePointBringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePoint
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developers
 
SharePoint REST vs CSOM
SharePoint REST vs CSOMSharePoint REST vs CSOM
SharePoint REST vs CSOM
 
Getting Started with SharePoint Development
Getting Started with SharePoint DevelopmentGetting Started with SharePoint Development
Getting Started with SharePoint Development
 
Industrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netIndustrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.net
 
O365Con18 - Site Templates, Site Life Cycle Management and Modern SharePoint ...
O365Con18 - Site Templates, Site Life Cycle Management and Modern SharePoint ...O365Con18 - Site Templates, Site Life Cycle Management and Modern SharePoint ...
O365Con18 - Site Templates, Site Life Cycle Management and Modern SharePoint ...
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
 
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
 
IBM Digital Experience Theme Customization
IBM Digital Experience Theme CustomizationIBM Digital Experience Theme Customization
IBM Digital Experience Theme Customization
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the web
 
Hard learned CSOM and REST tips
Hard learned CSOM and REST tipsHard learned CSOM and REST tips
Hard learned CSOM and REST tips
 
Share point apps the good, the bad, and the pot of gold at the end of the r...
Share point apps   the good, the bad, and the pot of gold at the end of the r...Share point apps   the good, the bad, and the pot of gold at the end of the r...
Share point apps the good, the bad, and the pot of gold at the end of the r...
 
More object oriented development with Page Type Builder
More object oriented development with Page Type BuilderMore object oriented development with Page Type Builder
More object oriented development with Page Type Builder
 

Semelhante a Codemotion 2013 - Designing complex applications using html5 and knockoutjs

JavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadJavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadRuss Fustino
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Jeremy Likness
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a bossFrancisco Ribeiro
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAmir Barylko
 
jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesTeamstudio
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
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
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationSean Burgess
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design PatternsLilia Sfaxi
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government DevelopersFrank La Vigne
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_uDoris Chen
 
RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014Henry Van Styn
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineYared Ayalew
 
Cordova: Making Native Mobile Apps With Your Web Skills
Cordova: Making Native Mobile Apps With Your Web SkillsCordova: Making Native Mobile Apps With Your Web Skills
Cordova: Making Native Mobile Apps With Your Web SkillsClay Ewing
 
2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficiently2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficientlyBruno Capuano
 
Building assets on the fly with Node.js
Building assets on the fly with Node.jsBuilding assets on the fly with Node.js
Building assets on the fly with Node.jsAcquisio
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)Jia Mi
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 

Semelhante a Codemotion 2013 - Designing complex applications using html5 and knockoutjs (20)

JavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadJavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) upload
 
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
Wintellect - Devscovery - Enterprise JavaScript Development 2 of 2
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescript
 
jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPages
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
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
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government Developers
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
 
Life outside WO
Life outside WOLife outside WO
Life outside WO
 
RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
 
Cordova: Making Native Mobile Apps With Your Web Skills
Cordova: Making Native Mobile Apps With Your Web SkillsCordova: Making Native Mobile Apps With Your Web Skills
Cordova: Making Native Mobile Apps With Your Web Skills
 
2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficiently2017 03 25 Microsoft Hacks, How to code efficiently
2017 03 25 Microsoft Hacks, How to code efficiently
 
Service worker API
Service worker APIService worker API
Service worker API
 
Building assets on the fly with Node.js
Building assets on the fly with Node.jsBuilding assets on the fly with Node.js
Building assets on the fly with Node.js
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 

Mais de Fabio Franzini

Use the PnP SharePoint Starter Kit to create your intranet in a box
Use the PnP SharePoint Starter Kit to create your intranet in a boxUse the PnP SharePoint Starter Kit to create your intranet in a box
Use the PnP SharePoint Starter Kit to create your intranet in a boxFabio Franzini
 
All about Office UI Fabric
All about Office UI FabricAll about Office UI Fabric
All about Office UI FabricFabio Franzini
 
Introduction to SharePoint Framework (SPFx)
Introduction to SharePoint Framework (SPFx)Introduction to SharePoint Framework (SPFx)
Introduction to SharePoint Framework (SPFx)Fabio Franzini
 
Whymca - Sviluppare applicazioni mobile native in html e javascript
Whymca - Sviluppare applicazioni mobile native in html e javascriptWhymca - Sviluppare applicazioni mobile native in html e javascript
Whymca - Sviluppare applicazioni mobile native in html e javascriptFabio Franzini
 
Sviluppare applicazioni mobile native in html e java script
Sviluppare applicazioni mobile native in html e java scriptSviluppare applicazioni mobile native in html e java script
Sviluppare applicazioni mobile native in html e java scriptFabio Franzini
 

Mais de Fabio Franzini (6)

Use the PnP SharePoint Starter Kit to create your intranet in a box
Use the PnP SharePoint Starter Kit to create your intranet in a boxUse the PnP SharePoint Starter Kit to create your intranet in a box
Use the PnP SharePoint Starter Kit to create your intranet in a box
 
All about Office UI Fabric
All about Office UI FabricAll about Office UI Fabric
All about Office UI Fabric
 
All about SPFx
All about SPFxAll about SPFx
All about SPFx
 
Introduction to SharePoint Framework (SPFx)
Introduction to SharePoint Framework (SPFx)Introduction to SharePoint Framework (SPFx)
Introduction to SharePoint Framework (SPFx)
 
Whymca - Sviluppare applicazioni mobile native in html e javascript
Whymca - Sviluppare applicazioni mobile native in html e javascriptWhymca - Sviluppare applicazioni mobile native in html e javascript
Whymca - Sviluppare applicazioni mobile native in html e javascript
 
Sviluppare applicazioni mobile native in html e java script
Sviluppare applicazioni mobile native in html e java scriptSviluppare applicazioni mobile native in html e java script
Sviluppare applicazioni mobile native in html e java script
 

Último

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 WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Último (20)

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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Codemotion 2013 - Designing complex applications using html5 and knockoutjs

  • 1. Fabio Franzini Designing complex applications using HTML5 and KnockoutJS fabio@fabiofranzini.com - @franzinifabio
  • 2. About Me Fabio franzini fabio@fabiofranzini.com - @franzinifabio  Senior Consultant and Software Engineer  MCT Trainer, MCPD Web Applications, MCTS SharePoint 2010/2007  Official Ignite Trainer for SharePoint 2013 & 2010 in Italy  Web Stack Lover  Over 9 years experience in IT as a software engineer Blog: www.fabiofranzini.com Email: fabio@fabiofranzini.com
  • 3. Agenda Fabio franzini fabio@fabiofranzini.com - @franzinifabio 1. Introduction 2. HTML5 3. JavaScript and Client Side Frameworks 4. Server Side Tools 5. Multiplatform 6. Demo
  • 4. Introduction Fabio franzini fabio@fabiofranzini.com - @franzinifabio What is the keys to create complex applications in javascript without becoming crazy? 1. Write clean code!! 2. Modularization and Reuse of code!! 3. Use frameworks or tools that simplify the work!!
  • 5. Why HTML5? Fabio franzini fabio@fabiofranzini.com - @franzinifabio • Cross Browser • Cross Platform • W3C Standards • All modern browsers and mobile devices supports HTML5 • Rich set of controls and APIs
  • 6. JavaScript is… Fabio franzini fabio@fabiofranzini.com - @franzinifabio • From Wikipedia: – A prototype-based scripting language that is dynamic, weakly typed and has first-class functions. – A multi-paradigm language, supporting object-oriented, imperative, and functional programming styles. • In short, a big mess for most developers :)
  • 7. Modularize your code using the module pattern! Fabio franzini fabio@fabiofranzini.com - @franzinifabio • Group several related elements such as classes, singletons, methods, globally used, into a simple object. • It fakes classes in Javascript. • Pros – Encapsulation, it gives us an API (public and private attributes or methods) – Avoid names conflicting with other function – Easier debugging (public functions are named) • Cons: – Difficult to refactor
  • 8. Module Pattern: Example Fabio franzini fabio@fabiofranzini.com - @franzinifabio var testModule = ( function() { var counter = 0; var privateMethod = function() { // do something…. } return { incrementCounter: function() { return counter++; }, resetCounter: function() { counter = 0; } }; })();
  • 9. Revealing Module Pattern Fabio franzini fabio@fabiofranzini.com - @franzinifabio Coined by Christian Heilmann (Mozilla Foundation) Pros – Sintax more consistent and easy to read – Easier to refactor var myRevealingModule = ( function() { var name = 'John Smith'; function updatePerson() { name = 'John Smith Updated'; } function setPerson (value) { name = value; } return { set: setPerson }; }());
  • 10. RequireJs for implement Module Pattern Fabio franzini fabio@fabiofranzini.com - @franzinifabio • RequireJs is a JavaScript file and module loader. • Using a modular script loader like RequireJS will improve the speed and quality of your code! [myPage.html] <script data-main="scripts/main" src="scripts/require-jquery.js"></script> ….. [main.js] require(["jquery", "jquery.alpha", "jquery.beta"], function($) { //the jquery.alpha.js and jquery.beta.js plugins have been loaded. $(function() { $('body').alpha().beta(); }); });
  • 11. Another Pattern Fabio franzini fabio@fabiofranzini.com - @franzinifabio • MV* Pattern – The MV* Pattern allows to separate the functionalities and introduce greater flexibility to customize the presentation of items – Provides a standard model interface to allow a wide range of data sources to be used with existing item views – Different implementation: MVC, MVP, MVVM • Observer (Pub/Sub) Pattern – It is a design pattern which allows an object (known as a subscriber) to watch another object (the publisher) – Loose coupling, ability to break down our applications into smaller, general manageability
  • 12. KnockoutJs Fabio franzini fabio@fabiofranzini.com - @franzinifabio • Model: It uses the Observable property that can notify subscribers about changes and automatically detect dependencies • View: A KnockoutJs View is simply a HTML document with declarative bindings to link it to the ViewModel • ViewModel: The ViewModel can be considered a specialized Controller that acts as a data converter. It changes Model information into View information, passing commands from the View to the Model
  • 13. KnockoutJs ViewModel Fabio franzini fabio@fabiofranzini.com - @franzinifabio function AppViewModel() { this.firstName = ko.observable("Bert"); this.lastName = ko.observable("Bertington"); this.fullName = ko.computed(function() { return this.firstName() + " " + this.lastName(); }, this); this.capitalizeLastName = function() { var currentVal = this.lastName(); this.lastName(currentVal.toUpperCase()); }; } // Activates knockout.js ko.applyBindings(new AppViewModel());
  • 14. KnockoutJs View Fabio franzini fabio@fabiofranzini.com - @franzinifabio <p>First name: <input data-bind="value: firstName" /></p> <p>Last name: <input data-bind="value: lastName" /></p> <p>Full name: <strong data-bind="text: fullName"></strong></p> <button data-bind="click: capitalizeLastName">Go caps</button>
  • 15. List of other Powerfull JavaScript FX Fabio franzini fabio@fabiofranzini.com - @franzinifabio • AmplifyJs • UnderscoreJs • LinqJs • DurandalJs • BreezeJS
  • 16. AmplifyJs Fabio franzini fabio@fabiofranzini.com - @franzinifabio Is a set of components designed to solve common web application problems with a simplistic API like – amplify.request provides a clean and elegant request abstraction for all types of data, even allowing for transformation prior to consumption. – amplify.publish/subscribe provides a clean, performant API for component to component communication. – amplify.store takes the confusion out of HTML5 localStorage. It doesn't get simpler than using amplify.store(key, data)! It even works flawlessly on mobile devices.
  • 17. UnderscoreJs Fabio franzini fabio@fabiofranzini.com - @franzinifabio Underscore is a utility library that provides a lots of functions without extending any of the built-in JavaScript objects UnderscoreJs Functions Collection Arrays Functions Objects Utility Chaining • Each • First • Bind • Keys • Random • Chain • Map • Initial • BindAll • Values • uniqueId • Value • Reduce • Union • Wrap • Extend • Escape • Find • Etc… • Etc… • isEqual • Etc.. • Where • isEmpty • Any • Etc… • Etc…
  • 18. linq.js - LINQ for JavaScript Fabio franzini fabio@fabiofranzini.com - @franzinifabio • implement all .NET 4.0 linq to object methods and extra methods • complete lazy evaluation • full IntelliSense support for VisualStudio • two versions: linq.js and jquery.linq.js (jQuery plugin) var jsonArray = [ { "user": { "id": 100, "screen_name": "d_linq" }, "text": "to objects" }, { "user": { "id": 130, "screen_name": "c_bill" }, "text": "g" }, { "user": { "id": 155, "screen_name": "b_mskk" }, "text": "kabushiki kaisha" }, { "user": { "id": 301, "screen_name": "a_xbox" }, "text": "halo reach" } ]; var queryResult = Enumerable.From(jsonArray) .Where(function (x) { return x.user.id < 200 }) .OrderBy(function (x) { return x.user.screen_name }) .Select(function (x) { return x.user.screen_name + ':' + x.text }) .ToArray();
  • 19. DurandalJs Fabio franzini fabio@fabiofranzini.com - @franzinifabio Durandal is small JavaScript framework designed to make building Single Page Applications (SPAs) simple and elegant. We didn't try to re-invent the wheel. Durandal is built on libs you know and love like jQuery, Knockout and RequireJS. There's little to learn and building apps feels comfortable and familiar. • Clean MV* Architecture • JS & HTML Modularity • Simple App Lifecycle • Eventing, Modals, Message Boxes, etc. • Navigation & Screen State Management • Consistent Async Programming w/ Promises • App Bundling and Optimization • Use any Backend Technology • Built on top of jQuery, Knockout & RequireJS • Integrates with other libraries such as SammyJS & Bootstrap • Make jQuery & Bootstrap widgets templatable and bindable (or build your own widgets).
  • 20. DurandalJs – Demo Fabio franzini fabio@fabiofranzini.com - @franzinifabio DEMO DurandalJs
  • 21. BreezeJs Fabio franzini fabio@fabiofranzini.com - @franzinifabio Breeze is a library for rich client applications written in HTML and JavaScript. It concentrates on the challenge of building and maintaining highly responsive, data-intensive applications in which users search, add, update, and view complex data from different angles as they pursue solutions to real problems in real time. Features include: • Rich queries using a LINQ-like query syntax • Client-side caching • Change tracking • Validation • Pluggable back-end • Full integration with the Entity Framework. • Supports WebAPI and OData back-ends. • Works with NoSQL, non-.NET, and SOA back-ends • Data management • Batched saves • Library and Tooling support • Out-of-box support for Knockout, Angular, and Backbone. • TypeScript support for compile-time type checking, classes, interfaces, and inheritance. • IntelliSense support for Visual Studio 2012. • RequireJS-enabled for modular applications. • Open API that allows additional front or back-ends to be plugged in.
  • 22. BreezeJs Fabio franzini fabio@fabiofranzini.com - @franzinifabio
  • 23. BreezeJs– Demo Fabio franzini fabio@fabiofranzini.com - @franzinifabio DEMO BreezeJs
  • 24. Server Side Tools Fabio franzini fabio@fabiofranzini.com - @franzinifabio • TypeScript • ScriptSharp
  • 25. TypeScript Fabio franzini fabio@fabiofranzini.com - @franzinifabio TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. • TypeScript starts from the syntax and semantics that millions of JavaScript developers know today. • You can use existing JavaScript code, incorporate popular JavaScript libraries, and be called from other JavaScript code. • Compiles to clean, simple JavaScript code which runs on any browser, in Node.js, or in any other ES3-compatible environment.
  • 26. TypeScript – Simple Example Fabio franzini fabio@fabiofranzini.com - @franzinifabio TypeScript JavaScript class Greeter { var Greeter = (function () { greeting: string; function Greeter(message) { constructor (message: string) { this.greeting = message; this.greeting = message; } } Greeter.prototype.greet = greet() { function () { return "Hello, " + this.greeting; return "Hello, " + this.greeting; } }; } return Greeter; })(); var greeter = new Greeter("world"); var greeter = new Greeter("world"); alert(greeter.greet()); alert(greeter.greet());
  • 27. ScriptSharp Fabio franzini fabio@fabiofranzini.com - @franzinifabio Script# is a free tool that generates JavaScript by compiling C# source code. • The goal is to enable you to leverage the productivity of C#, the Visual Studio IDE, and .NET tools and apply them to your HTML5 development. • The Script# compiler is a development/build-time tool that takes a pragmatic approach to generating script for use in real-world script-based applications, without introducing any unnecessary layers of abstraction.
  • 28. Package Apps Fabio franzini fabio@fabiofranzini.com - @franzinifabio • Apache Cordova • AppJs
  • 29. Apache Cordova (PhoneGap) Fabio franzini fabio@fabiofranzini.com - @franzinifabio Is a platform for building native mobile applications using HTML, CSS and JavaScript • Pros – The Power of HTML5 – Build native App – Interact with Device API’s • Conts – Performance of WebBrowser Control on target device…
  • 30. AppJs Fabio franzini fabio@fabiofranzini.com - @franzinifabio AppJS is an SDK to develop desktop applications using Node.js melded with Chromium. You get all the following in one package: • JS, HTML5, CSS, SVG, WebGL — by Chromium • mature HTTP/HTTPS servers and client APIs — by Node.js • filesystem, DNS, cryptography, subprocesses, OS APIs — by Node.js • sandboxed code execution environements, virtual machines — by Node.js • tools for exposing native C++ bindings to JavaScript — by Node.js
  • 31. Q&A Fabio franzini fabio@fabiofranzini.com - @franzinifabio ;-) Questions & Answer time!