The SAPUI5 framework is constantly evolving – as are coding best practices.
This session will demonstrate how developers get their Apps ready for today's features (such as "Adaptation at Runtime") and future SAPUI5 evolvements by just applying a few small code changes.
UI5 development experts will discuss topics like stable IDs, asynchronous loading and preparing for UI5 Evolution.
They will share helpful tips and tricks for rookies and experienced SAPUI5 App developers alike.
1. Ayham Tanbari, SAP SE
Arnd vom Hofe, SAP SE
June 22, 2018
UI5 – Best Practices
& Tips
2. 2
▪Features from version 1.50 and beyond
▪Latest Best Practices might reverse former Best
Practices
▪Some Best Practices have no immediate impact,
but prepare for future compatibility
SAPUI5 Best Practices 2018
8. 8
▪index.html
Stable IDs of Components
new Shell({
app: new ComponentContainer({
height : "100%",
name : "sap.ui.demo.worklist",
settings: {
id: "worklist"
}
})
}).placeAt("content");
9. 9
▪If you are doing it this way, you are doing it wrong!
Stable IDs of Views
<mvc:View id="myView"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc">
<Page id="page">
<content>
…
</content>
</Page>
</mvc:View>
▪ View IDs are not defined in the View but in
manifest.json!
17. 17
▪Do not use jQuery.sap.declare or jQuery.sap.require anymore
▪Use sap.ui.define and sap.ui.require instead
▪sap.ui.define: Dependencies are loaded in advance before executing the defined
module (static Dependencies)
▪sap.ui.require: Dependencies are resolved on demand after the initial module
execution (when the user interact with app) (Dynamic Dependencies)
▪Read Modules and Dependencies
AMD-like module definition