Next: High level structure
Up: High Level Design
Previous: Queries
  Contents
  Index
The API (application programmer's interface) definition should be finished and signed-off by the designers of the main application and of the problem solver before any code is written2.2. The syntax of each query (predicate) should be defined completely, stating the argument structure and types for both input and outputs. A mode declaration should be used to indicate input and output arguments.
An important part of the API definition is the identification of constraints attached to the data. Constraints in this context are conditions that the data must satisfy in order to obtain meaningful results. These constraints ensure that the data set is complete, minimal and consistent.
- complete
- All data required for the application should be present, with proper links between different records. An example from RiskWise: if an interface of a router is mentioned, then the router to which the interface belongs should be mentioned as well.
- minimal
- The data set should not contain any unneeded information, like duplicated records or references to objects that are not used in the system.
- consistent
- The data should be consistent overall, so that different records can be used without verifying their correctness every time. This can increase processing speed dramatically, and simplifies the code inside the application.
Any constraints identified should be added to the specification of a data record in a numbered list, so that they can be identified easily. The example below shows the constraints attached to the
backbone_line(Node1, Interface1, Node2, Interface2)
structure in RiskWise.
- 1.
- Each pair (Node, Interface) occurs at most once in the entries.
- 2.
- There can be no entry starting and ending in the same node.
- 3.
- Each node Node1 must have a node/2 fact.
- 4.
- Each node Node2 must have a node/2 fact.
- 5.
- The interface Interface1 cannot be 'local'.
- 6.
- The interface Interface2 cannot be 'local'.
- 7.
- Each pair (Node1, Interface1) must have a bandwidth/5 fact.
- 8.
- Each pair (Node2, Interface2) must have a bandwidth/5 fact.
- 9.
- There can be no backbone line between two net nodes.
- 10.
- There is at most one direct connection between two nodes, each line is uniquely described by the pair (Node1, Node2).
- 11.
- If there is a connection (Node1, Node2) between two nodes, then we cannot have the inverse connection (Node2, Node1) as well.
For major application interfaces, in particular those linking the Java and the ECLiPSe side, it is recommended to write specific code checking the data for compliance with the constraints. This simplifies the integration task by either pointing out which data do not satisfy the constraints and are therefore invalid, or by guaranteeing that the data passed are correct, and any problem is on the receiving side of the interface.
At this point it is also a good idea to write some dummy batch tests which create the proper interface structures to test the queries. These dummy tests must satisfy the constraints on the data, but do not need to contain useful data. They will be used to exercise the interface and the data constraint checks for coverage with consistent data while integration testing is not yet possible.
Next: High level structure
Up: High Level Design
Previous: Queries
  Contents
  Index
Warwick Harvey
2004-08-07