关于SAP UI5 CRM Reuse Fiori应用的代码审查
目錄
1. Question about maven build output
If we open the target folder:
What is exactly the usage of these four parts?
下圖這四種資源有什么用處?
Reason why I asked: the content between 1 and 2 are the same, 3 and 4 are the same.
2. Useless CSS style
Are these CSS styles still used?
上面的CSS似乎沒有用到。
I don’t think so since a pure text search shows no *.js are using them.
3. Why we choose sap.m.panel as aggregation container?
I know the children element contained in the aggregation would also be rendered in the runtime:
包含在這些aggregation的子控件在運行時被渲染。
However, why we choose panel as placeholder but not other one like XXXlayout?
4. Unnecessary require statement about “…NonLogTypeNoteListItem”
5. Duplicate code in two IF branch
6. Unused comment
It could be deleted now
7. Confusing variable name
Should be noteEditDialog instead.
8. Magic number still exists
9. Better constant definition approach
Follow this design:
Use this instead:
10. Hard code text cannot be translated
11. Performance of this.getProperty
Take this code for example:
In the runtime lifecycle, the value of these properties can never change:
Do a performance test on this.getProperty:
在this.getProperty方法加上性能數據的采集:
After clicking add button, there are more than 1200 times getProperty call, actually most can be avoided.
發現隨便點擊一個Add按鈕,會觸發一千多次的getProperty調用。而大多數其實都可以避免的。
If we call getProperty on these properties once in init, we can save 1200 * 0.5 = 0.6s
如果我們在onInit里只調用一次getProperty,然后把結果緩存起來,就可以節省1200 * 0.5 = 0.6s的時間。
12. Unused argument
13. Lengthy code
Didn’t try in js yet, can we use “return ( oValue1 – oValue2 )”?
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的关于SAP UI5 CRM Reuse Fiori应用的代码审查的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: xs有锁和无锁的区别(好看的小说都在这)
- 下一篇: dnf光兵是什么职业(最强自定义装备是什