420 likes | 615 Views
Accelerate Your User Experience With Client-side JavaScript Lessons Learned From QuickBooks Online (QBO). Joe Wells Engineering Fellow, Intuit. Intuit ’ s Mission:. SMALL BUSINESSES. ACCOUNTING PROFESSIONALS.
E N D
Accelerate Your User Experience With Client-side JavaScriptLessons Learned From QuickBooks Online (QBO) Joe Wells Engineering Fellow, Intuit
Intuit’s Mission: SMALLBUSINESSES ACCOUNTINGPROFESSIONALS To improve our customers’ financial livesso profoundly…they can’t imagine going back to the old way CONSUMERS
A Premiere Innovative Growth Company Founded1983 Public 1993INTU Employees8,000+ Global OfficesUS, UK, India,Canada, Australia Revenue4.2B Customers45M
Key Concepts • Everything as a service • Client-side frameworks to accelerate coding • Designing services from the UI-first • Plugin framework to unlock innovation • Putting it all together: working with your experience designers
QBO 2001-2010 Architecture Server-Side Presentation JSP / Custom Java UI Single Data Center
QBO 2014 Architecture • Client Rendering • HTML5 • iOS • Android Data-Only Transport Intuit Partner Platform JMSMessaging Developer API Services Accounting Standards Configurable Tax Model eInvoicing & Payments Global & AppStore Billing Global Accounting Engine World-Wide Data Centers
QBO Technologies • Client Rendering • HTML5 • iOS • Android WAA (FY’14) Data-Only Transport logging (FY’14) Developer API Services Global Accounting Engine World-Wide Data Centers (FY’14)
Frameworks • You’re using require.js, right? • And SASS/LESS please? • What about two-way binding?
Example: Two-way Binding <div data-qbo-bind="visible: showDate"> <div>${nls.date}</div> <input class="dateInput" type="text" data-qbo-bind="value: date" data-dojo-type="qbo/widgets/DateTextBox”/> </div> visible: showDate Hide/Show bound to this.model properties ${nls.date} Externalization of strings value: date 2-way value binding
A common mistake is to design your services and then adapt your UI to those services. This is backwards! And it results in extra complexity in your client code.
What Not to Do: Services First /companyPreferences /invoice { phoneNumber: “650-944-1111”, defaultTerms: “30 Days”, reportingMethod: “cash”, payrollPeriod: “weekly”, hasShipping: true } { date: “2014-06-26”, amount: 100.00, customer: “John” } Which ones apply to an Invoice? What is the logic to interpret them?
if (invoice.isNew && prefs.hasShipping) { $(‘#shippingAddress’).show(); $(‘#shippingAmount’).show(); } else if (invoice.isEdit && !!invoice.shippingAddress) { $(‘#shippingAddress’).show(); $(‘#shippingAmount’).show(); } Repeated over dozens of preferences!
Alternative: UI First <input data-qbo-bind= ”value: shippingAddress, visible: hasShipping” /> <input data-qbo-bind= ”value: shippingAmount, visible: hasShipping” /> /invoice?txnId=45 /invoice?txnId=-1 { hasShipping: true } { hasShipping: true }
Our JSON { "txnId" : -1, "txnTypeId" : 4, "date" : "2014-06-26", "txnProps" : { "hasShipping" : true, "hasDiscount" : true, "hasLocation" : true, "hasCharges" : true, "hasReimbExpense" : true, "taxReimbExpense" : false, … { "txnId" : 101, "txnTypeId" : 4, "date" : "2014-06-26", ”amount" : 100.00, ”customer" : ”John”, "txnProps" : { "hasShipping" : true, "hasDiscount" : true, "hasLocation" : true, "hasCharges" : true, "hasReimbExpense" : true, "taxReimbExpense" : false, …
Workflow – QA Chrome browser QA Server Resource Request Serve json requests, images, js, css, fonts, … Response from QA Server
Workflow – Node.js localhost Chrome browser Node.jslocalhost QA Server Local Content? Serve json requests, images, js, css, fonts, … Resource Request No Response from Node.js Response from QA Server
Node.js localhost var express = require("express"); var httpProxy = require("http-proxy"); var https = require("https"); var fs = require("fs"); //load ssl cert
Key Concepts • Everything as a service • Client-side frameworks to accelerate coding • Designing services from the UI-first • Plugin framework to unlock innovation • Putting it all together: working with your experience designers
Thanks! • Joe_Wells@Intuit.com