Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Beyond SAP Fiori’s 1:1:3

Beyond SAP Fiori’s 1:1:3

Talk i gave at SAP DCODE Las Vegas 2014 on Building Enterprise Apps with SAPUI5

Avatar for John Patterson

John Patterson

January 04, 2015

Other Decks in Technology

Transcript

  1. Beyond SAP Fiori’s 1:1:3 Building Large Enterprise Apps with SAPUI5

    UXP301 @ SAP DCODE 2014 John Patterson | @jasper_07
  2. Atwood's Law: “Any application that can be written in JavaScript,

    will eventually be written in JavaScript”
  3. 1. Follow JS best practices 2. Don’t build big apps

    3. Use fit-for-purpose API’s TL;DR
  4. I'm an egotistical bastard, and I name all my projects

    after myself. First 'Linux', now 'git'. " Linus Torvalds”
  5. "The secret to building large apps is never build large

    apps. Break your applications into small pieces. Then, assemble those testable, bite-sized pieces into your big application" Justin Meyer, author JavaScriptMVC http://pixabay.com/static/uploads/photo/2012/03/01/01/42/connect-20333_640.jpg
  6. App Root TopBar SideList DetailContainer Detail1 Detail2 Detail(n) = =

    = = Send Notifications to TopBar Communicate Across App
  7. Decouple Controllers with EventBus EventBus Controller Controller Event is Published

    and delivered Controller Publishes Delivers Delivers = = =
  8. onInit: function() { var oEventBus = sap.ui.getCore().getEventBus(); … // oEventBus.subscribe(channel,

    event, handler, this); oEventBus.subscribe("POService", "POChanged", this.onPOhanged, this); }, Decouple Controllers with EventBus Subscribe to Event
  9. onInit: function() { var oEventBus = sap.ui.getCore().getEventBus(); … // oEventBus.subscribe(channel,

    event, handler, this); oEventBus.subscribe("POService", "POChanged", this.onPOhanged, this); }, Decouple Controllers with EventBus oEventBus.publish("POService", "POChanged", { PONumber : item.getBindingContext().getObject().PONumber }); Subscribe to Event Publish Event
  10. onInit: function() { var oEventBus = sap.ui.getCore().getEventBus(); … // oEventBus.subscribe(channel,

    event, handler, this); oEventBus.subscribe("POService", "POChanged", this.onPOhanged, this); }, onPOChanged: function(sChannel, sEvent, oData) { var oPONumber = oData.PONumber; //some logic goes here .. } Decouple Controllers with EventBus oEventBus.publish("POService", "POChanged", { PONumber : item.getBindingContext().getObject().PONumber }); Subscribe to Event Handle Event Publish Event
  11. // The "reponder" URL parameter defines if the app shall

    run with mock data var bIsMocked = jQuery.sap.getUriParameters().get("responderOn"); Mock Server Read mock param
  12. var sUrl = "/sap/opu/odata/IWBEP/MYDEMO_SRV/"; // The "reponder" URL parameter defines

    if the app shall run with mock data var bIsMocked = jQuery.sap.getUriParameters().get("responderOn"); // start mock server if (bIsMocked) { jQuery.sap.require("sap.ui.core.util.MockServer"); var oMockServer = new sap.ui.core.util.MockServer({ rootUri: sUrl }); Mock Server Read mock param declare MockServer
  13. var sUrl = "/sap/opu/odata/IWBEP/MYDEMO_SRV/"; // The "reponder" URL parameter defines

    if the app shall run with mock data var bIsMocked = jQuery.sap.getUriParameters().get("responderOn"); // start mock server if (bIsMocked) { jQuery.sap.require("sap.ui.core.util.MockServer"); var oMockServer = new sap.ui.core.util.MockServer({ rootUri: sUrl }); oMockServer.simulate("model/metadata.xml", "model/"); oMockServer.start(); } Mock Server Read mock param declare MockServer start Mock Server
  14. 1. Follow JS best practices 2. Don’t build big apps

    3. Use fit-for-purpose API’s Takeaways
  15. Feedback Please Complete a session evaluation for this session! UXP301

    @ SAP DCODE 2014 John Patterson | @jasper_07