|
References |
Top Previous Next |
|
References are used to indicate the location of data. Depending on the context, the reference may be used to read data (i.e, data will be fetched from wherever the reference points to) or to write data (data will be saved to wherever the reference points to). References may refer to any value that represents AggreGate internal data. The generic syntax of a reference is: schema/server^context:entity(parameter_list)$field[row]#property All parts of a reference except for field are optional. A reference schema defines how the system resolves the rest of the reference. It helps the system "figure out" the meaning of the rest of the reference. Schemas are widely used in computing. For example, in the address http://www.google.com, the http:// part is the schema. It tells your browser that this is an HTTP link, and that it should treat the rest of the line like this. An FTP link can have a different structure, such as ftp://joeuser:xxx@gmail.com. Here again, the ftp:// part defines the schema, and now your program knows how to handle the rest of the link. In AggreGate, Schemas are used to refer to various parts of the system: env/ schema is used to refer to environment variables (which are properties immediately concerning the current operation being executed), form/ schema is used in GUI Builder to refer to the properties of graphical components of that widget is composed. A schema is optional: you don't necessarily have to include it in your reference. It just tells the system that your reference points to an environment variable (env/) or a graphical component (form/). If your reference points to the data coming from a context variable, a function or a cell of a Data Table, etc., you just omit the schema, and write your reference in the default format, which is described in the very next section (Resolving References). For example, a reference like form/TextField1#text uses the form/ schema, and refers to the "text" property of a widget component called "TextField1". A reference like users.admin:childInfo$firstname includes no schema, and refers to the first name of user "admin" (which is a field of the childInfo variable. Reference Schemas Used In AggreGate
Resolving a reference is the process of getting the current value stored at the location the reference points to. Resolving algorithm depends to the reference schema. If the reference does not specify a schema, it is resolved as a standard reference. |