Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Â
Building Effective and Rapid Applications with IBM MobileFirst Platform
1. Š 2015 IBM Corporation
Building Effective
Applications with the IBM
MobileFirst Platform
Andrew Ferrier
andrew.ferrier@uk.ibm.com
Technical Lead, IBM Cloud Lab
Services EMEA
2. Agenda
â˘âŻ Review of IBM MobileFirst Platform
â˘âŻ Tips:
â˘âŻ #1: Choose your client-side architecture wisely
â˘âŻ #2: If youâre going hybrid, think about your tools
â˘âŻ #3: Do Continuous Integration
â˘âŻ #4: External properties for environment promotion
â˘âŻ #5: Think about deployment to phones
â˘âŻ #6: Consider your tests
â˘âŻ #7: Consider adapter versioning
â˘âŻ Further Learning
1
3. What is MobileFirst Platform?
Mobile Enterprise Application Platform =
A platform for construction of hybrid and
native mobile applications, along with
supporting mobile backend services such as
service adapters, unified push
notifications, a unified security and
authentication framework, operational
analytics, and so on.
2
6. JMS Queue /
Topic
Web / RESTfil
service
DB
HTTP (REST, SOAP)
SQL JMS
HTTP (CAST IRON)
JSON
Adaptors
MobileFirst
SERVER
Cloud
Service
WindowsAndroid Blackberry
Apple
Adapters
8. 3
 diďŹerent
 ways
 to
 write
 the
 client-ÂâsideâŚ
Â
(weâre
 not
 considering
 Windows
 Mobile,
 Blackberry)
Â
NaFve
Â
(aka
 NaFve
 API)
Â
Xamarin
 HTML5
Â
(aka
 Hybrid)
Â
9. Hybrid
â˘âŻ (aka
 Web,
 Cordova,
 etc.)
Â
â˘âŻ Core
 skills:
 HTML,
 CSS,
 JS,
 and
 a
 JS
 toolkit
Â
8
MFP Studio
Xcode
Android Studio
HTML CSS JS
Framework / Toolkit
Your App
MFP CLI
10. â˘âŻ Apache
 Cordova
 -Ââ
Â
hSp://cordova.apache.org/
Â
Â
Â
â˘âŻ Previously
 known
 as
Â
PhoneGap
Â
â˘âŻ Provides
 a
 wrapper
 around
Â
web
 content
 to
 make
 it
Â
appear
 as
 a
 naFve
 app
Â
â˘âŻ Also
 provides
 access
 to
Â
device
 APIs
Â
Cordova enables Hybrid
11. JS
 Toolkits
Â
â˘âŻ AngularJS + Ionic
â˘âŻ Dojo Mobile
â˘âŻ jQuery + jQuery Mobile
â˘âŻ Sencha Touch
â˘âŻ Many many othersâŚ
12. â˘âŻ âWhat
 all
 the
 cool
 kids
 are
 usingâ
Â
â˘âŻ Maintained
 by
Â
â˘âŻ Focus
 Areas:
Â
â˘âŻ One-Ââpage
 applicaFons
Â
â˘âŻ MVC
 â
 strong
 data
 binding
Â
capabiliFes
Â
â˘âŻ Not
 speciďŹcally
 focused
 on
 mobile
Â
applicaFons,
 soâŚ
Â
13. â˘âŻ AngularJS
 +
 Ionic
 is
 a
 good
 âdefaultâ
 choice.
Â
â˘âŻ There
 are
 established
 paSerns
 and
 examples
 for
Â
using
 it
 with
 MobileFirst
 Pla_orm:
Â
14. â˘âŻ Open-source toolkit, IBM has some
involvement in development.
â˘âŻ âAll-in-oneâ toolkit answer
â˘âŻ Latest version (1.10.x) brings iOS 8
support
â˘âŻ Strong support for structuring large
applications
â˘âŻ e.g. AMD, Class system (dojo/
declare), dojox/app
â˘âŻ Good option for multi-channel or desktop
apps
â˘âŻ Good option for Blackberry or other
esoteric platforms
15. â˘âŻ NOT
Â
â˘âŻ Focuses
 on
 âcoreâ
Â
funcFonality:
Â
â˘âŻ DOM
 traversal
 and
Â
manipulaFon
Â
â˘âŻ Event
 Handling
Â
â˘âŻ AJAX
 /
 XHR
Â
â˘âŻ Mobile
 Framework
Â
separate:
Â
Â
16. Tip #2: If youâre going hybrid, think about the toolsâŚ
â˘âŻ Frameworks such as Bootstrap, Ionic, etc. can help a lot in
creating the quality and performance you need for hybrid
15
â˘âŻ Module
 systems/Loaders:
 RequireJS/AMD,
 Dojo/
AMD,
 CommonJS,
 ExtJS
 deďŹne,
 Flight/AMD,
Â
YUI.use()
Â
â˘âŻ Package
 manager:
 Bower,
 Dojo
 Packages,
 CPM,
Â
Volo,
 yeoman
Â
â˘âŻ Build
 systems:
 r.js(requirejs),
 dojo
 build,
Â
Component,
 ClosureBuilder,
 Shiger,
 grunt
Â
â˘âŻ Templates:
 AngularJS,
 Hogan.js,
 Mustache.js,
Â
Handlebars,
 Dijit
 templates,
 UnderscoreJS,
 Lo-Ââ
Dash,
 Y.Template.Micro
Â
â˘âŻ Data
 Binding:
 ReacFve,
 Rivets,
 Knockout,
Â
Backbone,
 AngularJS,
 Flight,
 Dojo
 Observable
Â
â˘âŻ Rou>ng:
 dojo/router,
 Backbone
Â
â˘âŻ App
 Controllers:
 dojox/app
 (+ISSW),
 Backbone,
Â
AuraJS
Â
â˘âŻ Sync:
 component/model,
 AngularJS
 services,
 Dojo
Â
Object
 Store,
 YUI,
 Backbone
 Sync
Â
â˘âŻ Widgets:
 Closure
 Library,
 Dijit,
 Dojo
 mobile,
Â
jQuery/jQuery
 Mobile,
 etc.etc.,
 Bootstrap
 (jQuery),
Â
YUI,
 Sencha,
 EXTJS
Â
â˘âŻ Bower - Package
Management â
bower.io
â˘âŻ Grunt â âTask
Runnerâ â
gruntjs.com
17. Android
 NaFve
Â
â˘âŻ Use
 Java
 to
 code
 against
 Android
 SDK
Â
â˘âŻ Use
 Android
 Studio
 (hSp://developer.android.com/sdk/index.html)
 -Ââ
Â
based
 on
 IntelliJ
Â
â˘âŻ Eclipse
 plugins
 (ADT)
 will
 likely
 be
 phased
 out
Â
19. iOS
 NaFve
 -Ââ
 UIKit
Â
â˘âŻ On
 iOS,
 you
 broadly
 have
 two
 technology
 choices:
Â
â˘âŻ ObjecFve-ÂâC
 â
 Older,
 harder
 to
 learn
Â
â˘âŻ Swig
 â
 Only
 introduced
 in
 2014.
Â
20. iOS
 NaFve
Â
â˘âŻ For
 all
 apps
 (not
 just
 naFve),
 you
 need
 to
 register
 to
 deploy
 to
 ârealâ
Â
devices
Â
â˘âŻ Also
 need
 Xcode
 development
 environment
 (only
 supported
 on
 Mac)
Â
21. How
 can
 we
 mix
 all
 of
 these?
Â
â˘âŻ Two
 basic
 styles:
Â
â˘âŻ Hybrid
 web
 container
 is
 master
 -Ââ
 in
 MobileFirst
 Pla_orm,
 this
 is
 a
Â
Hybrid
 applicaFon
 (i.e.
 Cordova)
Â
â˘âŻ NaFve
 code
 is
 master
 -Ââ
 in
 MobileFirst
 Pla_orm,
 this
 is
 a
 Na>ve
 API
Â
applicaFon
Â
22. Xamarin
â˘âŻ Build applications natively in C# for Android and iOS
â˘âŻ Develop business logic in C#
â˘âŻ Develop UI design either in Xamarin.Forms (common cross-
platform) or in native tools/code
21
23. Summary
 â
 so
 which
 is
 best?
Â
â˘âŻ AngularJS
 +
 Ionic
 is
 a
 good
 default
 choice
 for
Â
those
 with
 web
 skills
Â
â˘âŻ Maximises
 cross-Ââpla_orm
 compaFbility
Â
â˘âŻ Disadvantages:
 tuning,
 Android
 variants
Â
â˘âŻ iOS
 NaFve
 and
 Android
 NaFve
 are
 best
 for
Â
those
 looking
 for
 the
 most
 sophisFcated
Â
cupng-Ââedge
 UX
Â
â˘âŻ Disadvantages:
 Typically
 requires
 more
Â
in-Ââdepth,
 specialised
 skill.
Â
â˘âŻ Xamarin
 suitable
 for
 naFve
 developers
 with
Â
C#
 skill
Â
25. Key artifacts
Server-side
â˘âŻ .war
â˘âŻ (aka Project / customisation
WAR â not to be confused
with MFP administration
WAR)
â˘âŻ .wlapp
â˘âŻ Per-application content,
a.k.a. application
understanding
â˘âŻ .adapter
â˘âŻ Per-adapter
24
Client-side
â˘âŻ .ipa
â˘âŻ Application for iOS
â˘âŻ .apk
â˘âŻ Application for Android
26. Building Artifacts
â˘âŻ MFP provides the <war-builder>, <app-
builder> and <adapter-builder> ANT
tasks
â˘âŻ Only builds the Server portion of the projects -
the .war customisation file, the .wlapp file, and
the .adapter files.
â˘âŻ You will need to build the .apk and .ipa files
using platform-native process.
â˘âŻ You need a Mac for iOS
27. Tip #4: Externalise properties for environment
promotion
â˘âŻ worklightserverhost in <app-builder>
task â also can be exposed through user
screen:
<iphone bundleId="com.ibm.myapp" version="1.0â>!
!<worklightSettings include="true"/>!
âŚ!
</iphone>!
28. Tip #4: Externalise properties for environment
promotion
â˘âŻ server/conf/worklight.properties!
!
!
!
worklight.properties contains:!
!
myadapter.path = /mypath/somerestservice!
!!
Which becomes JNDI property:
<property name="myadapter.path" value="/myserver/somepath/service"/>!
27
For more
information:
http://
tinyurl.com/
losx42b)!
29. Tip #4: Externalise properties for environment
promotion
â˘âŻ domain, port for the backend service in adapter.xml
28
30. Deploying
â˘âŻ Deploy the .war using relevant application
server method
â˘âŻ Deploy the .wlapp and .adapter server-side
portions of the application using <app-
deployer> and <adapter-deployer> ANT
tasks.
â˘âŻ Deploy JNDI properties.
31. Tip #5: Think about deployment to phones
â˘âŻ You still need to get the native
application (.ipa, .apk, etc.)
onto your userâs phones.
â˘âŻ Dev Time/Small/Adhoc
Projects: Manual install
â˘âŻ Testing lifecycle:
AppCenter - comes with
MobileFirst server editions
â⯠Install via AppCenter Web or
AppCenter App
32. Tip #5: Think about deployment to phones
â˘âŻ B2C: public App Stores (Apple App Store, Google
Play Store)
â˘âŻ B2E: IBM Endpoint Manager (MaaS360) or similar
31
33. Tip #6: Consider your tests
â˘âŻ Typically youâll want to test:
â˘âŻ Manual UI on physical phones
ââŻCoverage across devices
â˘âŻ Automated UI
â⯠e.g. MobileFirst Test Workbench
â˘âŻ (MFP) Adapters â unit / integration
performance tests
35. Automated Adapter Testing
â˘âŻ Uses HTTP RPC API to drive adapters:
â˘âŻ (good tools are and )
â˘âŻ Unit Testing can be achieved by driving individual adapters with
stubbed backends
â˘âŻ Store properties in worklight.properties, use them in
the .js to find URL
â˘âŻ Integration Testing can be achieved by connecting adapters to
a real backend
â˘âŻ Performance Testing can be achieved by driving adapters hard
over an extended period and plotting the results
34
36. Tip #7: Consider Adapter Versioning
â˘âŻ Two mechanisms for versioning MFP Adapters:
â˘âŻ Renaming them
â˘âŻ Provide a version as additional metadata on each adapter call:
myAdapterProcedure(options, a, bâŚ)
var options = { version: { major: 1, minor: 0, patch: 0 } }
WL.Client.invokeProcedure({
adapter : "RSSFeed",
procedure : "getData",
parameters : [options, "myTopic"]
});
37. Tips - Review
â˘âŻ #1: Choose your client-side architecture wisely
â˘âŻ #2: If youâre going hybrid, think about your tools
â˘âŻ #3: Do Continuous Integration
â˘âŻ #4: External properties for environment promotion
â˘âŻ #5: Think about deployment to phones
â˘âŻ #6: Consider your tests
â˘âŻ #7: Consider adapter versioning
36
39. Further Learning â Other Resources
â˘âŻ http://ibmmobiletipsntricks.com/
â˘âŻ MobileFirst Test Workbench: http://tinyurl.com/m8n32ry
â˘âŻ Using AngularJS and Ionic: http://youtu.be/a89W_atlhjg
â˘âŻ IBM Worklight AngularJS + Ionic template: http://git.io/AffP
â˘âŻ CI & Automated Testing with Worklight: http://tinyurl.com/nzng5lc
38
40. Notices and Disclaimers
Copyright Š 2015 by International Business Machines Corporation (IBM). No part of this document may be reproduced or
transmitted in any form without written permission from IBM.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM.
Information in these presentations (including information relating to products that have not yet been announced by IBM) has been
reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM
shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY,
EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF
THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT
OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the
agreements under which they are provided.
Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without
notice.
Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are
presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual
performance, cost, savings or other results in other operating environments may vary.
References in this document to IBM products, programs, or services does not imply that IBM intends to make such products,
programs or services available in all countries in which IBM operates or does business.
Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not
necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither
intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.
It is the customerâs responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal
counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customerâs
business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or
represent or warrant that its services or products will ensure that the customer is in compliance with any law.
41. Notices and Disclaimers (conât)
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products in connection with this
publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.
IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to
interoperate with IBMâs products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED,
INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.
The provision of the information contained herein is not intended to, and does not, grant any right or license under any
IBM patents, copyrights, trademarks or other intellectual property right.
â˘âŻ IBM, the IBM logo, ibm.com, Bluemix, Blueworks Live, CICS, Clearcase, DOORSÂŽ, Enterprise Document
Management Systemâ˘, Global Business Services ÂŽ, Global Technology Services ÂŽ, Information on Demand,
ILOG, MaximoÂŽ, MQIntegratorÂŽ, MQSeriesÂŽ, NetcoolÂŽ, OMEGAMON, OpenPower, PureAnalyticsâ˘,
PureApplicationÂŽ, pureClusterâ˘, PureCoverageÂŽ, PureDataÂŽ, PureExperienceÂŽ, PureFlexÂŽ, pureQueryÂŽ,
pureScaleÂŽ, PureSystemsÂŽ, QRadarÂŽ, RationalÂŽ, RhapsodyÂŽ, SoDA, SPSS, StoredIQ, TivoliÂŽ, TrusteerÂŽ,
urban{code}ÂŽ, Watson, WebSphereÂŽ, WorklightÂŽ, X-ForceÂŽ and System zÂŽ Z/OS, are trademarks of
International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and
service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on
the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
42. Thank You
Your Feedback is
Important!
Access the InterConnect 2015
Conference CONNECT Attendee
Portal to complete your session
surveys from your smartphone,
laptop or conference kiosk.