Home >Documents >Lessons Learnt implementing a Worklight-based eCommerce ... › wug › ... ·...

Lessons Learnt implementing a Worklight-based eCommerce ... › wug › ... ·...

Date post:30-May-2020
Category:
View:2 times
Download:0 times
Share this document with a friend
Transcript:
  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 1 of 16http://localhost:8000/?print-pdf#/

    LESSONS LEARNT IMPLEMENTING A WORK‐LESSONS LEARNT IMPLEMENTING A WORK‐ LIGHT-BASED ECOMMERCE MOBILE SOLUTIONLIGHT-BASED ECOMMERCE MOBILE SOLUTION

    / / Sean Bedford @bedfordsean [email protected]

    http://seanbedford.com/ http://twitter.com/bedfordsean mailto:[email protected]

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 2 of 16http://localhost:8000/?print-pdf#/

    WHAT IS WORKLIGHT? - SERVER SIDEWHAT IS WORKLIGHT? - SERVER SIDE

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 3 of 16http://localhost:8000/?print-pdf#/

    WHAT IS WORKLIGHT? - CLIENT SIDEWHAT IS WORKLIGHT? - CLIENT SIDE

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 4 of 16http://localhost:8000/?print-pdf#/

    THE BIGGER PICTURETHE BIGGER PICTURE

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 5 of 16http://localhost:8000/?print-pdf#/

    WHY IS IT GOOD?WHY IS IT GOOD? Out-of-box support for app analytics (Device, OS, code version) Direct update provides a powerful way to quickly patch issues App versioning scheme allows operational management of multiple deployed versions Security model provides easy control of back end resources Not "just Cordova (PhoneGap)" - native APIs for iOS, Android, and devices running JavaME

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 6 of 16http://localhost:8000/?print-pdf#/

    CORDOVA PRIMERCORDOVA PRIMER API layer between web container and native functionality You can write a new Cordova plugin with native implementations on each platform you want to support This plugin can then be wrapped in to JavaScript to allow for calling from a web container

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 7 of 16http://localhost:8000/?print-pdf#/

    CLIENT SIDE CODECLIENT SIDE CODE MVC APPROACHMVC APPROACH

    How do you store data? How do you display data? How do you handle the business rules?

    Pick a framework that supports MVC such as jQuery Mobile, AngularJS, or Dojo. It will make your life MUCH easier :-)

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 8 of 16http://localhost:8000/?print-pdf#/

    THINK OF THE USERTHINK OF THE USER Think about how the user is going to interact with your app Consider controls, text sizes, readability. Apple recommends >= 44px * 44px tappable area and 17pt+ font size Design, prototype, and test with actual end-users Don't be afraid to scrap a design and start again

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 9 of 16http://localhost:8000/?print-pdf#/

    COMMON UI PATTERNSCOMMON UI PATTERNS

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 10 of 16http://localhost:8000/?print-pdf#/

    SERVER SIDE CODESERVER SIDE CODE CONSISTENT ENDPOINT MANAGEMENTCONSISTENT ENDPOINT MANAGEMENT

    Common problem: How to handle errors, timeouts, bad responses consistently? Solution: Provide a consistent client- and server-side endpoint

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 11 of 16http://localhost:8000/?print-pdf#/

    GO-LIVE CONSIDERATIONSGO-LIVE CONSIDERATIONS Think about end-end versioning - does your back end support multiple live versions? Think about security - validation in the front end only is never enough Think about how the application will load and service frequent requests (startup, browse, login...) Think about operational management (logging, reporting, information for support)

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 12 of 16http://localhost:8000/?print-pdf#/

    BASIC WORKLIGHT USER AUTHENTICATIONBASIC WORKLIGHT USER AUTHENTICATION A key feature of Worklight is it's security model This allows the securing of a back end call with a single line of code (once it is set up)

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 13 of 16http://localhost:8000/?print-pdf#/

    AUTHENTICATION FLOWAUTHENTICATION FLOW

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 14 of 16http://localhost:8000/?print-pdf#/

    EXAMPLE - SET UPEXAMPLE - SET UP Create a challenge handler in your code. This will need to issue a username/password, or some other authentication toekn Set up a realm and security test in authenticationConfig.xml. In this security test, state you want to use adapter functions to authenticate the user

    ...

    com.worklight.integration.auth.AdapterAuthenticator

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 15 of 16http://localhost:8000/?print-pdf#/

    EXAMPLE - SECURING A FUNCTIONEXAMPLE - SECURING A FUNCTION In your adapter's XML file, add a security test to a function

    This will trigger the security test against the realm you've defined in authenticationConfig.xml This in turn will issue a challenge for "MySecureRealm" if there is no user logged in for that realm At this point, your client code can handle the challenge, by providing authentication details, tokens, or similar After authenticating, Worklight can re-issue the original request and return a result from the back end service

  • 26/03/2014 10:04Lessons Learnt implementing a Worklight-based eCommerce mobile solution

    Page 16 of 16http://localhost:8000/?print-pdf#/

    QUESTIONS?QUESTIONS?

Click here to load reader

Reader Image
Embed Size (px)
Recommended