問題非常普遍,讓我們從代碼可讀性,靈活性和偏離表現的角度來看OpenEdge中的每個優缺點。
OpenEdge中的靜態查詢和動態查詢
靜態查詢:
+ readability: convenient `buffer.field` notation
+ performance: higher (supposedly, need comments)
-/+ "global scope" allows to handle all previously used buffers, but could lead
to ambiguousness, so you'll have to clarify it with a table
name (table.field instead of field)
- flexibility: you cannot alternate predicate-expression much,
even IF function is not recommended (can affect performance)
動態查詢:
+ flexibility: you can build predicate-expression completely runtime
+ flexibility: you can work with each field not specifying its name,
f.e. you can process all fields of certain record in cycle
+ flexibility: are reusable (need comments on this point)
+/- "local scope" allows to use only buffers specified in `SET-BUFFERS` method
- readability: a little more code to write
- performance: slightly slower (not sure)
補充和更正的歡迎。以及任何相關閱讀的鏈接。
這其實不是問題嗎? – Jensd
@Jensd我改變了公式 – Progressive