Context Bindings - Gnorion/BizVR GitHub Wiki
Context Bindings
The expression {p in Persons where age>21}
assumes the collection of Persons is already in memory.
But where might it come from:
- It might have been passed in as an input
- We might have constructed it earlier in the program
- We might read it from a database
Note that the expression already looks a bit like a SQL query, so how might we connect this expression to a database
Maybe we simply treat {p in Persons where age>21} as if it were an instance method applied to a database table For example something along these lines:
CONN=createConnection(DATABASE='MYSQL',TABLE='PERSONS',USER='admin',PASSWORD='')
C1=CONN.{p in Persons where age>21}