Script API design guidelines (Talk)

cancel
Showing results for 
Search instead for 
Did you mean: 

Script API design guidelines (Talk)

mrogers
Active Member II
0 0 866

Scripting API considerations


We have already dealt with date.   But how best to return a map, list, string, etc.   Over the script API?

Here is a 'straw man'.


  • MAP

Use ScriptableHashMap


  • LIST

Use arrays instead.     Currently the java script 'json' object is underpowered and does not convert json arrays to java script arrays.   Does this affect our choice to use arrays?


  • STRING

Are there any considerations here?  For example how do we ensure that its a java script string (so the java script string syntax works) rather than a wrapped java object?


  • OVERLOADING

Can't be used because most weakly typed scripting languages can't cope with it.


  • RESERVED NAMES

The 'delete' method name is reserved by JavaScript are there any other problematic names that we should avoid?