SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Using MVVM on
the web with Ignite
UI & Knockoutjs



                                        NISHANTH ANIL
                             TECHNICAL EVANGELIST
                      nanil@infragistics.com | nnish.com
                          facebook.com/InfragisticsIndia

                                                 @nishanil
Agenda
– Patterns
– What’s MVVM?
– What’s Knockoutjs?
  • Simple MVVM Demo
– What’s Ignite UI?
  • Building Enterprise Dashboard in HTML5/jQuery
    demo
– Comparing Javascript MV* frameworks


                                                @nishanil
Patterns – are guidelines not
              rules!
• UI patterns
  –   Model – View – Controller
  –   Model – View – Presenter
  –   Presentation Model
  –   Model – View – ViewModel


• Why do they exist?
  – Separation of concerns
  – Testability
  – Maintainability


                                  @nishanil
MVVM?

 View    ViewModel      Model
(HTML)               (jsonxml)




                                  @nishanil
MVVM recap – WPF
   –   INotifyPropertyChanged/INotifyCollectionChanged
   –   DataContext
   –   DataBinding
   –   Commanding

Read more:
http://nnish.in/myIGblog




                                                         @nishanil
MVVM on the web?




                   @nishanil
@nishanil
What’s knockoutjs?
– a compact javascript library
– implements the MVVM pattern for Javascript
– rich client-side interactivity
– supports all major browsers



     6+           2+

     http://knockoutjs.com/documentation/browser-support.html



                                                                @nishanil
Key Concepts




               @nishanil
Knockout in 3 steps
– Declarative Binding


– Dependency Tracking using Observable



– Activating knockout




                                         @nishanil
Observables
– Updates UI automatically when the
  ViewModel changes (UI notification)
– Very famous 2 way binding!
– Declare your properties as ko.observable()
– ko.observable() objects are functions, not a
  property!




                                                 @nishanil
Computed Observables
– Computes value based on one more
  dependent observable (for e.g, compute full
  name based on first name & last name)




                                            @nishanil
Declarative Binding
 – It’s all about data-bind attribute in HTML
 – Not native to HTML, but perfectly OK!
 – The binding value can be a single value, variable, or
   literal or almost any valid JavaScript expression.




         Built-in Bindings                     valueUpdate options
value, visible, text,                    change, keyup, keypre
uniqueName, click                        ss, afterkeydown
etc…
Not happy with built-in bindings? – roll your own! (custom bindings)
                                                                       @nishanil
Observable Array
– Tracks which objects are in the array, not the
  state of those objects
– Notifies changes for add & remove
– No notification for item changes! (use
 ko.observable())
Pre-populating ObservableArray




          Binding it



                                              @nishanil
Built-in Bindings
                        Text & Appearance

 visible      text        attr       style         css        html




                      Working with Form Fields


click       disable    submit       value        hasfocu     enable
                                                    s

event      checked      options    selectedOptions         uniqueName



            Or roll your own! Support s custom binding


                                                                      @nishanil
Binding – Control Flow
foreach
                     Foreach example
  if

 ifnot

 with




                                @nishanil
Knockout & jQuery
• Not a jQuery competitor, Knockout solves
  a different problem!
• Will work together!




                                         @nishanil
Knockoutjs Demo




                  @nishanil
Enterprise dashboards using
      HTML5/jQuery?



                         @nishanil
@nishanil
The World’s Most Advanced
  JavaScript & HTML5 UI
       Framework


                        @nishanil
@nishanil
and a lot more… www.igniteui.com
                                   @nishanil
Ignite UI Demo




                 @nishanil
Javascript MV* F/W           Web
                                       Composed                  Plays Nicely
        Framework        UI Bindings              Presentation
                                       Views                     With Others
                                                  Layer
        Backbone.js      ✗             ✗          ✓              ✓
        SproutCore 1.x   ✓             ✓          ✗              ✗
        Sammy.js         ✗             ✗          ✓              ✓
        Spine.js         ✗             ✗          ✓              ✓
        Cappuccino       ✓             ✓          ✗              ✗
        Knockout.js      ✓             ✗          ✓              ✓
        Javascript
                         ✗             ✓          ✓              ✓
        MVC
        Google Web
                         ✗             ✓          ✗              ✗
        Toolkit
        Google
                         ✗             ✓          ✓              ✗
        Closure
        Ember.js         ✓             ✓          ✓              ✓
        Angular.js       ✓             ✗          ✓              ✓
        Batman.js        ✓             ✗          ✓              ✓
Source: http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/
                                                                                @nishanil
Resources
– Ignite UI
   • www.igniteui.com
– Infragistics Community
   • http://www.infragistics.com/community/
– KnockoutJS –
   • learn.knockoutjs.com
   • http://www.knockmeout.net/
– If you are new to Javascript
   •   https://developer.mozilla.org/en-US/docs/JavaScript/Guide
– Javascript MVC Frameworks reviewed
   • http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-
     reviewed/


                                                                   @nishanil
Slides & Samples
• You can download these slides from
  – http://www.slideshare.net/nishanthanil/
• Samples
  – Knockout
    • https://github.com/nishanil/koSamples
  – Ignite UI Grid & Knockoutjs
    • http://www.infragistics.com/products/jquery/sample
      /grid/grid-knockoutjs-integration



                                                     @nishanil
Q&A

@nishanil on twitter
facebook.com/InfragisticsIndia



                                                   NISHANTH ANIL
                                        TECHNICAL EVANGELIST
                                 nanil@infragistics.com | nnish.com

                                                            @nishanil

Weitere ähnliche Inhalte

Ähnlich wie MVVM on the web with Ignite UI & Knockoutjs

Building databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsBuilding databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsNish Anil
 
Infragistics: Getting Started with MVVM in WPF & Silverlight
Infragistics: Getting Started with MVVM in WPF & SilverlightInfragistics: Getting Started with MVVM in WPF & Silverlight
Infragistics: Getting Started with MVVM in WPF & SilverlightNish Anil
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayWesley Hales
 
A Smooth Transition to HTML5
A Smooth Transition to HTML5A Smooth Transition to HTML5
A Smooth Transition to HTML5Chris Bannon
 
Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Gill Cleeren
 
Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts weili_at_slideshare
 
Flu3nt highlights
Flu3nt highlightsFlu3nt highlights
Flu3nt highlightsdswork
 
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjsCodemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjsFabio Franzini
 
JS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJSJS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJSYuriy Silvestrov
 
Active Web Development
Active Web DevelopmentActive Web Development
Active Web DevelopmentDivya Manian
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Peter Lubbers
 
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
 
Structure mapping your way to better software
Structure mapping your way to better softwareStructure mapping your way to better software
Structure mapping your way to better softwarematthoneycutt
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaphp2ranjan
 
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 MVVMChris Bannon
 
Seattle bestpractices2010
Seattle bestpractices2010Seattle bestpractices2010
Seattle bestpractices2010Olaseni Odebiyi
 
Evaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devicesEvaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devicesMario Gonzalez
 
Kicking Up the Dust with Node JS
Kicking Up the Dust with Node JSKicking Up the Dust with Node JS
Kicking Up the Dust with Node JSBill Scott
 

Ähnlich wie MVVM on the web with Ignite UI & Knockoutjs (20)

Building databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsBuilding databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with Knockoutjs
 
Infragistics: Getting Started with MVVM in WPF & Silverlight
Infragistics: Getting Started with MVVM in WPF & SilverlightInfragistics: Getting Started with MVVM in WPF & Silverlight
Infragistics: Getting Started with MVVM in WPF & Silverlight
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies Today
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
A Smooth Transition to HTML5
A Smooth Transition to HTML5A Smooth Transition to HTML5
A Smooth Transition to HTML5
 
Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8
 
Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts
 
Flu3nt highlights
Flu3nt highlightsFlu3nt highlights
Flu3nt highlights
 
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjsCodemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
 
JS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJSJS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJS
 
Active Web Development
Active Web DevelopmentActive Web Development
Active Web Development
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)
 
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
 
Structure mapping your way to better software
Structure mapping your way to better softwareStructure mapping your way to better software
Structure mapping your way to better software
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
Angular js gtg-27feb2013
Angular js gtg-27feb2013Angular js gtg-27feb2013
Angular js gtg-27feb2013
 
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
 
Seattle bestpractices2010
Seattle bestpractices2010Seattle bestpractices2010
Seattle bestpractices2010
 
Evaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devicesEvaluation and prototyping of an HTML5 Client for iOS devices
Evaluation and prototyping of an HTML5 Client for iOS devices
 
Kicking Up the Dust with Node JS
Kicking Up the Dust with Node JSKicking Up the Dust with Node JS
Kicking Up the Dust with Node JS
 

Mehr von Nish Anil

[MobConf] Go mobile with C#, Visual Studio & Xamarin
[MobConf] Go mobile with C#, Visual Studio & Xamarin[MobConf] Go mobile with C#, Visual Studio & Xamarin
[MobConf] Go mobile with C#, Visual Studio & XamarinNish Anil
 
[MobConf] Programming wearables in c#
[MobConf] Programming wearables in c#[MobConf] Programming wearables in c#
[MobConf] Programming wearables in c#Nish Anil
 
APAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsAPAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsNish Anil
 
[Bdotnet] Cloud connected mobile apps
[Bdotnet] Cloud connected mobile apps[Bdotnet] Cloud connected mobile apps
[Bdotnet] Cloud connected mobile appsNish Anil
 
Evolve recap XHackers, Bangalore
Evolve recap XHackers, BangaloreEvolve recap XHackers, Bangalore
Evolve recap XHackers, BangaloreNish Anil
 
iOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using XamariniOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using XamarinNish Anil
 
Building mvvm & single pageapps in js
Building mvvm & single pageapps in jsBuilding mvvm & single pageapps in js
Building mvvm & single pageapps in jsNish Anil
 

Mehr von Nish Anil (7)

[MobConf] Go mobile with C#, Visual Studio & Xamarin
[MobConf] Go mobile with C#, Visual Studio & Xamarin[MobConf] Go mobile with C#, Visual Studio & Xamarin
[MobConf] Go mobile with C#, Visual Studio & Xamarin
 
[MobConf] Programming wearables in c#
[MobConf] Programming wearables in c#[MobConf] Programming wearables in c#
[MobConf] Programming wearables in c#
 
APAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.FormsAPAC Webinar: Say Hello To Xamarin.Forms
APAC Webinar: Say Hello To Xamarin.Forms
 
[Bdotnet] Cloud connected mobile apps
[Bdotnet] Cloud connected mobile apps[Bdotnet] Cloud connected mobile apps
[Bdotnet] Cloud connected mobile apps
 
Evolve recap XHackers, Bangalore
Evolve recap XHackers, BangaloreEvolve recap XHackers, Bangalore
Evolve recap XHackers, Bangalore
 
iOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using XamariniOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using Xamarin
 
Building mvvm & single pageapps in js
Building mvvm & single pageapps in jsBuilding mvvm & single pageapps in js
Building mvvm & single pageapps in js
 

Kürzlich hochgeladen

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Kürzlich hochgeladen (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

MVVM on the web with Ignite UI & Knockoutjs

  • 1. Using MVVM on the web with Ignite UI & Knockoutjs NISHANTH ANIL TECHNICAL EVANGELIST nanil@infragistics.com | nnish.com facebook.com/InfragisticsIndia @nishanil
  • 2. Agenda – Patterns – What’s MVVM? – What’s Knockoutjs? • Simple MVVM Demo – What’s Ignite UI? • Building Enterprise Dashboard in HTML5/jQuery demo – Comparing Javascript MV* frameworks @nishanil
  • 3. Patterns – are guidelines not rules! • UI patterns – Model – View – Controller – Model – View – Presenter – Presentation Model – Model – View – ViewModel • Why do they exist? – Separation of concerns – Testability – Maintainability @nishanil
  • 4. MVVM? View ViewModel Model (HTML) (jsonxml) @nishanil
  • 5. MVVM recap – WPF – INotifyPropertyChanged/INotifyCollectionChanged – DataContext – DataBinding – Commanding Read more: http://nnish.in/myIGblog @nishanil
  • 6. MVVM on the web? @nishanil
  • 8. What’s knockoutjs? – a compact javascript library – implements the MVVM pattern for Javascript – rich client-side interactivity – supports all major browsers 6+ 2+ http://knockoutjs.com/documentation/browser-support.html @nishanil
  • 9. Key Concepts @nishanil
  • 10. Knockout in 3 steps – Declarative Binding – Dependency Tracking using Observable – Activating knockout @nishanil
  • 11. Observables – Updates UI automatically when the ViewModel changes (UI notification) – Very famous 2 way binding! – Declare your properties as ko.observable() – ko.observable() objects are functions, not a property! @nishanil
  • 12. Computed Observables – Computes value based on one more dependent observable (for e.g, compute full name based on first name & last name) @nishanil
  • 13. Declarative Binding – It’s all about data-bind attribute in HTML – Not native to HTML, but perfectly OK! – The binding value can be a single value, variable, or literal or almost any valid JavaScript expression. Built-in Bindings valueUpdate options value, visible, text, change, keyup, keypre uniqueName, click ss, afterkeydown etc… Not happy with built-in bindings? – roll your own! (custom bindings) @nishanil
  • 14. Observable Array – Tracks which objects are in the array, not the state of those objects – Notifies changes for add & remove – No notification for item changes! (use ko.observable()) Pre-populating ObservableArray Binding it @nishanil
  • 15. Built-in Bindings Text & Appearance visible text attr style css html Working with Form Fields click disable submit value hasfocu enable s event checked options selectedOptions uniqueName Or roll your own! Support s custom binding @nishanil
  • 16. Binding – Control Flow foreach Foreach example if ifnot with @nishanil
  • 17. Knockout & jQuery • Not a jQuery competitor, Knockout solves a different problem! • Will work together! @nishanil
  • 18. Knockoutjs Demo @nishanil
  • 19. Enterprise dashboards using HTML5/jQuery? @nishanil
  • 21. The World’s Most Advanced JavaScript & HTML5 UI Framework @nishanil
  • 23. and a lot more… www.igniteui.com @nishanil
  • 24. Ignite UI Demo @nishanil
  • 25. Javascript MV* F/W Web Composed Plays Nicely Framework UI Bindings Presentation Views With Others Layer Backbone.js ✗ ✗ ✓ ✓ SproutCore 1.x ✓ ✓ ✗ ✗ Sammy.js ✗ ✗ ✓ ✓ Spine.js ✗ ✗ ✓ ✓ Cappuccino ✓ ✓ ✗ ✗ Knockout.js ✓ ✗ ✓ ✓ Javascript ✗ ✓ ✓ ✓ MVC Google Web ✗ ✓ ✗ ✗ Toolkit Google ✗ ✓ ✓ ✗ Closure Ember.js ✓ ✓ ✓ ✓ Angular.js ✓ ✗ ✓ ✓ Batman.js ✓ ✗ ✓ ✓ Source: http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/ @nishanil
  • 26. Resources – Ignite UI • www.igniteui.com – Infragistics Community • http://www.infragistics.com/community/ – KnockoutJS – • learn.knockoutjs.com • http://www.knockmeout.net/ – If you are new to Javascript • https://developer.mozilla.org/en-US/docs/JavaScript/Guide – Javascript MVC Frameworks reviewed • http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks- reviewed/ @nishanil
  • 27. Slides & Samples • You can download these slides from – http://www.slideshare.net/nishanthanil/ • Samples – Knockout • https://github.com/nishanil/koSamples – Ignite UI Grid & Knockoutjs • http://www.infragistics.com/products/jquery/sample /grid/grid-knockoutjs-integration @nishanil
  • 28. Q&A @nishanil on twitter facebook.com/InfragisticsIndia NISHANTH ANIL TECHNICAL EVANGELIST nanil@infragistics.com | nnish.com @nishanil