|
|
TQL queries and subscriptions consists of dynamic (user defined payloads) payload sent over HTTP or WEBSOCKET transports. Consuming TQL Queries in UIs (HTML/JS, Android, IOS and others) in this regards are similar to consuming any RESTful services.
In the tutorial we answer some of the following questions:
Let's address some of these questions when building UI Apps using TQL Queries using a template HTML/JS App. You can download this app here
REST is an architecture style for designing networked applications and in virtually all cases, the HTTP protocol is used. In many ways, the World Wide Web itself, based on HTTP, can be viewed as a REST-based architecture. By this definition of REST coupled with the fact that TQL Queries are executed over an HTTP endpoint that is automatically generated when models are deployed to TQLEngine, make TQL Queries Restful in nature.
In the table below we note fixed REST pattern that is applicable to TQL Queries.
TQL Queries | Restful Services |
---|---|
XML Oriented (Request & Response) (Note that TQLEngine supports both JSON & XML; the recommended guideline is XML for TQL Queries readability) | Restful Services are JSON oriented |
TQL Queries are sent as payload, therefore the HTTP Method to be used always POST. | Method can be: GET/PUT/POST/DELETE |
Here is the typical Modeling flow of control:
As with building any UI app that interacts with backend serivces, you would always need:
Never hardcode the TQL Query endpoint urls as they are subject to change.
Instead the endpoints must be auto discovered given the project name.
The model developer (owner) will provide you appropriate project name to discover your query endpoints.
One of the key difference between Atomiton's TQL platform vs any other middleware platform is that you have the power to write your own queries against the model that is delivered to you by the Model developers.