Background
Greenhouse Monitoring System will be taken as an example to illustrate creating User Interface applications using TQL Queries.
TQL Queries Vs REST Services
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 |
UI Technologies
- Pure HTML and JS
- Frameworks
- HTML5
Design Patterns
- MVC Pattern and TQL
- Never Hardcode the TQL End Point
- Look out for: Subscriptions & Notifications Overload
- Doing Async Operations : Not all queries are Request / Response;
- Not all queries are Request / Response;
- Take Request and wait for Respose
Implementation Steps
All the implementation steps must be against Simulated Greenhouse project.
Take on of the scree with Request / Response and Notification/Subscription and build the UI.
Discover TQL EndPoint URL (Code; JS)
Discovering TQL EndPoint URLs -
Test Queries via Query Editor
- Take Query from Pramod to be run against your own Deployed TQLEngine and get the endpoints.
- Take sample queries from Greenhouse.
Deploy & Test
- Attach applications to the project (Locally) (Even if it is part of different Project)