Warning:
This wiki has been archived and is now read-only.
SampleIdl
From Device Description Working Group Wiki
Sample IDL
This page contains some sample IDL that is intended to act as a stimulus for discussion on the eventual form of the DDR API.
An initial, very simple, IDL for a DDR API
// A simple seed IDL for the DDR.
// This one just has a Get method; no structured types or any
// other well-formed features we expect of the final API.
module ddrcore
{
// Declarations
typedef string OntologyIdentifier; // Responsibility of the UWA group
typedef string RepositoryId;
typedef string InformalDescription; // i.e. Needs a human to interpret
interface Repository;
// Definitions
struct ContextKey {
string agentSignature;
};
exception DDRException {
unsigned short code;
};
const unsigned short UNSPECIFIED_ERROR = 1;
const unsigned short NOT_SUPPORTED_ERROR = 2;
const unsigned short ACCESS_VIOLATION = 3;
const unsigned short SYNTAX_ERROR = 4;
interface MinimalRepository {
readonly attribute string name;
readonly attribute RepositoryId id;
InformalDescription getInformalValue (
in ContextKey contextKey;
in OntologyIdentifier propertyName;
) raises(DDRException);
}
};
Questions raised by this example
- Should we be using well known types from other domains, such as DOMString?
- What should be the true nature of the ContextKey type?
- Can a Get method return a null/empty response?
- Should a failure to get something (because it's not there) be an Exception, or should a special return value be used?
- Should an explicit set of values be used for Exception codes, or should an enum type be used?