SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
Approaching RIAs
 dhaval.dalal@software-artisan.com

        @softwareartisan
A
Real-time
Webapp
Nature of RIAs

• Significant use of JavaScript.
• Business and Presentation code in JavaScript.
  •   Are they tangled?

  •   Client-Side Domain Objects often represent their
      Server-Side counterparts.

• Organizing and Managing JavaScript.
• Fallacy to not test-drive JavaScript!
Some Basics...
• JavaScript supports constructor functions
  •   Have member variables in this function

  •   Instantiate object using the new keyword and make the
      function behave like a constructor.

  •   Inside the ctor, the this refers to the newly created
      object.

• Functions in JavaScript have a property called
  prototype
  •   Ctor call causes all the properties of prototype to be
      available to the new object.

• Prototypal Inheritance - object inherits object
Test Driving Tools
• JsTestDriver
 •   Is a Test Runner

 •   Captures Various Browsers

 •   Execute tests in parallel on different machines
     •   setup very useful for CI builds and tools that support server farms
Test Driving Tools

•   Is a BDD framework

•   Does not require DOM, i.e. can work with
    Server-Side JavaScript

•   Does not depend on any other JavaScript
    framework.

•   Can use SpecRunner.html to run test suite in
    a browser
Test Driving Tools
• JsUnit
• YUI
• ...and other framework related tools
• We’ll use...
 • JsTestDriver + Jasmine
 • Additionally, you can use Jasmine-
    Species for the Given-When-Then
    grammar and meta info.
Fun time!
    Lets create a
JavaScript Calculator
More fun!
Get the UI wired up.
Separation of Concerns                <<observable>>
                                                                                                                                                            ion
                                                                                                                                                        cat
                                               Model                                                                                        N oti
                                                                                                                                                    fi
                                                                                                                                                                         te
                                                                                                                                                                                Model
                              te                                                                                                       ge                            Sta
                        y Sta                                                                                                     an                            ry
                     dif                                                                                                       Ch                          e
                                                                                                                                                        Qu




                                        Change Notification
                  Mo                                                                                                                           ify/
                                                                                                                                            od




                                                             Query State
                                                                                                                                        M
<<Mediator>>

Controller                                                                                                           Presenter         1 U
                 1 S                                                                                                                        ser
                     elec                                                                                                                       Ge
                          t Vi                                                                                                                      stu
               Use             ew                                                                                                       Up              res
                   rG                 <<observer>>                                                                                         dat
                      estu        *                                                                                                            eV           1
                                                                                                                                                  iew
                           res
                                                     View                                                                                                                        View

                          MVC                                                                                                                                        MVP
                                                                                                  on
                                                                                               ati                    Model
                                                                                         ti fic
                                                                                    No                     te
                                                                              ng
                                                                                e                       ta
                                                                            ha                       yS
                                                                           C               er
                                                                                      y/ Qu
                                                                                  d if
                                                                               Mo
                                   <<observable>>
                                                                                                                                                                              Method Invocation
                                   ViewModel
                                                                                    Use                                                                                             Events
                                                                       1                   rG
                                                                    Ch                          estu
                                                                       ang                                res       <<observer>>
                                                                           e       No
                                                                                         tific                   *
                                                                                             atio
                                                                                                      n               View

                                                                                                MVVM
MVVM
• Term first used by WPF architect John Gossman
 •   View is primarily a responsibility of designer and hence
     should not contain code.

• Quite similar to Martin Fowler’s Presentation
  Model (PM)
 •   A full self-contained class that represents all the Data +
     Behavior of a View
     •   Data-fields for all the dynamic information of the view.


 •   View references PM and projects state of PM on itself.

 •   Synchronization between PM and View usually achieved by
     using a data binding framework
Various Frameworks
   http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed




We’ll use Knockout and you can additionally use KO External Template engine
(github.com/ifandelse/Knockout.js-External-Template-Engine) for composing views.
Organizing JavaScript
• Organizing Code
 •   Folder Hierarchy

 •   Namespaces (Logical or coupled with Folder Hierarchy)

• OO support
 •   JavaScript does not support the concept of classes, but
     we can program as though it does.

 •   Emulate Privacy
     •   Closure approach
     •   Convention

 •   Emulate Interfaces and Abstract classes

 •   Simulate Classical Inheritance
Managing JavaScript
• Dependencies
 •   Imports and Exports

• Text Delivery System
 •   Size
     •   Whitespaces, comments are superfluous from execution point of view


 •   Privacy
     •   compromise security by gaining knowledge of the code.


 •   Minifier and Obfuscator (also minifies)

• Packaging
 •   Concatenate Obfuscated JS (avoid many requests)
Thank-you!
References
•   JsTestDriver Documentation

•   Jasmine Documentation

•   Knockout Documentation

•   java.sun.com/blueprints/MVC-detailed.html

•   martinfowler.com/eaaDev/uiArchs.html, martinfowler.com/eaaDev/PresentationModel.html

•   ak.channel9.msdn.com/teched/na/2011/mp4/DPR305.mp4

•   aspiringcraftsman.com/2007/08/25/interactive-application-architecture/

•   codeproject.com/Articles/42830/Model-View-Controller-Model-View-Presenter-and-Mod

•   addyosmani.com/resources/essential/designpatterns/book

•   crockford.com/javascript/inheritance.html

•   yuiblog.com/blog/2006/03/06/minification-v-obfuscation

•   www.phpied.com/3-ways-to-define-a-javascript-class

Más contenido relacionado

Similar a Approaching Rich Internet Applications

Constituent elements of mainframe processing
Constituent elements of mainframe processingConstituent elements of mainframe processing
Constituent elements of mainframe processingDennis Hoffman
 
6.09 Develop A Plan And Execute
6.09 Develop A Plan And Execute6.09 Develop A Plan And Execute
6.09 Develop A Plan And ExecuteRalphYoung
 
6.09 The Job Search Tool Box Presentation
6.09 The Job Search Tool Box Presentation6.09 The Job Search Tool Box Presentation
6.09 The Job Search Tool Box PresentationRalphYoung
 
High stakes world of Mobile Payments
High stakes world of Mobile PaymentsHigh stakes world of Mobile Payments
High stakes world of Mobile PaymentstxtNation
 
High stakes-world-of-mobile-payments-infographic
High stakes-world-of-mobile-payments-infographicHigh stakes-world-of-mobile-payments-infographic
High stakes-world-of-mobile-payments-infographicTyson Hackwood
 
Open Source Success: jQuery
Open Source Success: jQueryOpen Source Success: jQuery
Open Source Success: jQueryjeresig
 
Economics of Green Growth & National Innovation Strategies
Economics of Green Growth & National Innovation StrategiesEconomics of Green Growth & National Innovation Strategies
Economics of Green Growth & National Innovation StrategiesCambridgeIP Ltd
 
OpenID Overview - Seoul July 2007
OpenID Overview - Seoul July 2007OpenID Overview - Seoul July 2007
OpenID Overview - Seoul July 2007David Recordon
 
Roxo aracruz and_the_sustainability_english
Roxo aracruz and_the_sustainability_englishRoxo aracruz and_the_sustainability_english
Roxo aracruz and_the_sustainability_englishujgumilar
 
IPD Investment Income return; Residential vs Commercial
IPD Investment Income return; Residential vs CommercialIPD Investment Income return; Residential vs Commercial
IPD Investment Income return; Residential vs CommercialInspired Asset Management
 
웹 이후의 세계 제3장
웹 이후의 세계 제3장웹 이후의 세계 제3장
웹 이후의 세계 제3장Goodhyun Kim
 
Eduserv OpenID Meeting: OpenID Today
Eduserv OpenID Meeting: OpenID TodayEduserv OpenID Meeting: OpenID Today
Eduserv OpenID Meeting: OpenID TodayDavid Recordon
 
REFEDS MET, PEER and MDUI Presentation
REFEDS MET, PEER and MDUI PresentationREFEDS MET, PEER and MDUI Presentation
REFEDS MET, PEER and MDUI Presentationrefeds
 

Similar a Approaching Rich Internet Applications (20)

Constituent elements of mainframe processing
Constituent elements of mainframe processingConstituent elements of mainframe processing
Constituent elements of mainframe processing
 
The Singles Lifecycle
The Singles LifecycleThe Singles Lifecycle
The Singles Lifecycle
 
6.09 Develop A Plan And Execute
6.09 Develop A Plan And Execute6.09 Develop A Plan And Execute
6.09 Develop A Plan And Execute
 
6.09 The Job Search Tool Box Presentation
6.09 The Job Search Tool Box Presentation6.09 The Job Search Tool Box Presentation
6.09 The Job Search Tool Box Presentation
 
Soldier tech Brochure 2011
Soldier tech Brochure 2011Soldier tech Brochure 2011
Soldier tech Brochure 2011
 
High stakes world of Mobile Payments
High stakes world of Mobile PaymentsHigh stakes world of Mobile Payments
High stakes world of Mobile Payments
 
High stakes-world-of-mobile-payments-infographic
High stakes-world-of-mobile-payments-infographicHigh stakes-world-of-mobile-payments-infographic
High stakes-world-of-mobile-payments-infographic
 
Open Source Success: jQuery
Open Source Success: jQueryOpen Source Success: jQuery
Open Source Success: jQuery
 
Economics of Green Growth & National Innovation Strategies
Economics of Green Growth & National Innovation StrategiesEconomics of Green Growth & National Innovation Strategies
Economics of Green Growth & National Innovation Strategies
 
Intimacy Web
Intimacy WebIntimacy Web
Intimacy Web
 
Spiral Of Knowledge - 1967
Spiral Of Knowledge - 1967Spiral Of Knowledge - 1967
Spiral Of Knowledge - 1967
 
OpenID Overview - Seoul July 2007
OpenID Overview - Seoul July 2007OpenID Overview - Seoul July 2007
OpenID Overview - Seoul July 2007
 
Roxo aracruz and_the_sustainability_english
Roxo aracruz and_the_sustainability_englishRoxo aracruz and_the_sustainability_english
Roxo aracruz and_the_sustainability_english
 
IPD Investment Income return; Residential vs Commercial
IPD Investment Income return; Residential vs CommercialIPD Investment Income return; Residential vs Commercial
IPD Investment Income return; Residential vs Commercial
 
Mobile Marketing May 2011
Mobile Marketing May 2011Mobile Marketing May 2011
Mobile Marketing May 2011
 
웹 이후의 세계 제3장
웹 이후의 세계 제3장웹 이후의 세계 제3장
웹 이후의 세계 제3장
 
85 0079 vds insert
85 0079 vds insert85 0079 vds insert
85 0079 vds insert
 
Eduserv OpenID Meeting: OpenID Today
Eduserv OpenID Meeting: OpenID TodayEduserv OpenID Meeting: OpenID Today
Eduserv OpenID Meeting: OpenID Today
 
REFEDS MET, PEER and MDUI Presentation
REFEDS MET, PEER and MDUI PresentationREFEDS MET, PEER and MDUI Presentation
REFEDS MET, PEER and MDUI Presentation
 
Q1 2009 Earning Report of Meadwestvaco Corp.
Q1 2009 Earning Report of Meadwestvaco Corp.Q1 2009 Earning Report of Meadwestvaco Corp.
Q1 2009 Earning Report of Meadwestvaco Corp.
 

Más de Dhaval Dalal

Test Pyramid in Microservices Context
Test Pyramid in Microservices ContextTest Pyramid in Microservices Context
Test Pyramid in Microservices ContextDhaval Dalal
 
Booting into functional programming
Booting into functional programmingBooting into functional programming
Booting into functional programmingDhaval Dalal
 
Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)Dhaval Dalal
 
Creating Lazy stream in CSharp
Creating Lazy stream in CSharpCreating Lazy stream in CSharp
Creating Lazy stream in CSharpDhaval Dalal
 
Json Viewer Stories
Json Viewer StoriesJson Viewer Stories
Json Viewer StoriesDhaval Dalal
 
Mars rover-extension
Mars rover-extensionMars rover-extension
Mars rover-extensionDhaval Dalal
 
How Is Homeopathy Near To Yoga?
How Is Homeopathy Near To Yoga?How Is Homeopathy Near To Yoga?
How Is Homeopathy Near To Yoga?Dhaval Dalal
 
Approaching ATDD/BDD
Approaching ATDD/BDDApproaching ATDD/BDD
Approaching ATDD/BDDDhaval Dalal
 
Paradigms Code jugalbandi
Paradigms Code jugalbandiParadigms Code jugalbandi
Paradigms Code jugalbandiDhaval Dalal
 
Data Reconciliation
Data ReconciliationData Reconciliation
Data ReconciliationDhaval Dalal
 
DRYing to Monad in Java8
DRYing to Monad in Java8DRYing to Monad in Java8
DRYing to Monad in Java8Dhaval Dalal
 
4-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr2015
4-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr20154-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr2015
4-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr2015Dhaval Dalal
 
Jumping-with-java8
Jumping-with-java8Jumping-with-java8
Jumping-with-java8Dhaval Dalal
 
3-CodeJugalbandi-currying-pfa-healthycodemagazine#mar2015
3-CodeJugalbandi-currying-pfa-healthycodemagazine#mar20153-CodeJugalbandi-currying-pfa-healthycodemagazine#mar2015
3-CodeJugalbandi-currying-pfa-healthycodemagazine#mar2015Dhaval Dalal
 
CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015
CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015
CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015Dhaval Dalal
 
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-IssueCodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-IssueDhaval Dalal
 
The tao-of-transformation-workshop
The tao-of-transformation-workshopThe tao-of-transformation-workshop
The tao-of-transformation-workshopDhaval Dalal
 

Más de Dhaval Dalal (20)

Test Pyramid in Microservices Context
Test Pyramid in Microservices ContextTest Pyramid in Microservices Context
Test Pyramid in Microservices Context
 
Code Retreat
Code RetreatCode Retreat
Code Retreat
 
Booting into functional programming
Booting into functional programmingBooting into functional programming
Booting into functional programming
 
Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)Currying and Partial Function Application (PFA)
Currying and Partial Function Application (PFA)
 
Creating Lazy stream in CSharp
Creating Lazy stream in CSharpCreating Lazy stream in CSharp
Creating Lazy stream in CSharp
 
Json Viewer Stories
Json Viewer StoriesJson Viewer Stories
Json Viewer Stories
 
Value Objects
Value ObjectsValue Objects
Value Objects
 
Mars rover-extension
Mars rover-extensionMars rover-extension
Mars rover-extension
 
How Is Homeopathy Near To Yoga?
How Is Homeopathy Near To Yoga?How Is Homeopathy Near To Yoga?
How Is Homeopathy Near To Yoga?
 
Approaching ATDD/BDD
Approaching ATDD/BDDApproaching ATDD/BDD
Approaching ATDD/BDD
 
Paradigms Code jugalbandi
Paradigms Code jugalbandiParadigms Code jugalbandi
Paradigms Code jugalbandi
 
Data Reconciliation
Data ReconciliationData Reconciliation
Data Reconciliation
 
DRYing to Monad in Java8
DRYing to Monad in Java8DRYing to Monad in Java8
DRYing to Monad in Java8
 
CodeRetreat
CodeRetreatCodeRetreat
CodeRetreat
 
4-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr2015
4-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr20154-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr2015
4-Code-Jugalbandi-destructuring-patternmatching-healthycode#apr2015
 
Jumping-with-java8
Jumping-with-java8Jumping-with-java8
Jumping-with-java8
 
3-CodeJugalbandi-currying-pfa-healthycodemagazine#mar2015
3-CodeJugalbandi-currying-pfa-healthycodemagazine#mar20153-CodeJugalbandi-currying-pfa-healthycodemagazine#mar2015
3-CodeJugalbandi-currying-pfa-healthycodemagazine#mar2015
 
CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015
CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015
CodeJugalbandi-Sequencing-HealthyCode-Magazine-Feb-2015
 
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-IssueCodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
CodeJugalbandi-Expression-Problem-HealthyCode-Magazine#Jan-2015-Issue
 
The tao-of-transformation-workshop
The tao-of-transformation-workshopThe tao-of-transformation-workshop
The tao-of-transformation-workshop
 

Último

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[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
 
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
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[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
 
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...
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 

Approaching Rich Internet Applications

  • 3. Nature of RIAs • Significant use of JavaScript. • Business and Presentation code in JavaScript. • Are they tangled? • Client-Side Domain Objects often represent their Server-Side counterparts. • Organizing and Managing JavaScript. • Fallacy to not test-drive JavaScript!
  • 4. Some Basics... • JavaScript supports constructor functions • Have member variables in this function • Instantiate object using the new keyword and make the function behave like a constructor. • Inside the ctor, the this refers to the newly created object. • Functions in JavaScript have a property called prototype • Ctor call causes all the properties of prototype to be available to the new object. • Prototypal Inheritance - object inherits object
  • 5. Test Driving Tools • JsTestDriver • Is a Test Runner • Captures Various Browsers • Execute tests in parallel on different machines • setup very useful for CI builds and tools that support server farms
  • 6. Test Driving Tools • Is a BDD framework • Does not require DOM, i.e. can work with Server-Side JavaScript • Does not depend on any other JavaScript framework. • Can use SpecRunner.html to run test suite in a browser
  • 7. Test Driving Tools • JsUnit • YUI • ...and other framework related tools • We’ll use... • JsTestDriver + Jasmine • Additionally, you can use Jasmine- Species for the Given-When-Then grammar and meta info.
  • 8. Fun time! Lets create a JavaScript Calculator
  • 9. More fun! Get the UI wired up.
  • 10. Separation of Concerns <<observable>> ion cat Model N oti fi te Model te ge Sta y Sta an ry dif Ch e Qu Change Notification Mo ify/ od Query State M <<Mediator>> Controller Presenter 1 U 1 S ser elec Ge t Vi stu Use ew Up res rG <<observer>> dat estu * eV 1 iew res View View MVC MVP on ati Model ti fic No te ng e ta ha yS C er y/ Qu d if Mo <<observable>> Method Invocation ViewModel Use Events 1 rG Ch estu ang res <<observer>> e No tific * atio n View MVVM
  • 11. MVVM • Term first used by WPF architect John Gossman • View is primarily a responsibility of designer and hence should not contain code. • Quite similar to Martin Fowler’s Presentation Model (PM) • A full self-contained class that represents all the Data + Behavior of a View • Data-fields for all the dynamic information of the view. • View references PM and projects state of PM on itself. • Synchronization between PM and View usually achieved by using a data binding framework
  • 12. Various Frameworks http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed We’ll use Knockout and you can additionally use KO External Template engine (github.com/ifandelse/Knockout.js-External-Template-Engine) for composing views.
  • 13. Organizing JavaScript • Organizing Code • Folder Hierarchy • Namespaces (Logical or coupled with Folder Hierarchy) • OO support • JavaScript does not support the concept of classes, but we can program as though it does. • Emulate Privacy • Closure approach • Convention • Emulate Interfaces and Abstract classes • Simulate Classical Inheritance
  • 14. Managing JavaScript • Dependencies • Imports and Exports • Text Delivery System • Size • Whitespaces, comments are superfluous from execution point of view • Privacy • compromise security by gaining knowledge of the code. • Minifier and Obfuscator (also minifies) • Packaging • Concatenate Obfuscated JS (avoid many requests)
  • 16. References • JsTestDriver Documentation • Jasmine Documentation • Knockout Documentation • java.sun.com/blueprints/MVC-detailed.html • martinfowler.com/eaaDev/uiArchs.html, martinfowler.com/eaaDev/PresentationModel.html • ak.channel9.msdn.com/teched/na/2011/mp4/DPR305.mp4 • aspiringcraftsman.com/2007/08/25/interactive-application-architecture/ • codeproject.com/Articles/42830/Model-View-Controller-Model-View-Presenter-and-Mod • addyosmani.com/resources/essential/designpatterns/book • crockford.com/javascript/inheritance.html • yuiblog.com/blog/2006/03/06/minification-v-obfuscation • www.phpied.com/3-ways-to-define-a-javascript-class