2.2.5 .NET Remoting Description Notation
This section specifies a description notation to describe the metadata of the Remoting Data Model. The notation is meant for higher-level services such as [MS-NRLS] that are layered on top of this protocol to define their protocol in a remote procedure call (RPC) style.
The notation provides a way to describe the following components of the Remoting Data Model that is defined in Abstract Data Model (section 3.1.1).
Primitive Types are mapped to the following keywords in the notation:
Data model type |
Notation keyword |
---|---|
BOOLEAN |
bool |
BYTE |
Byte |
INT8 |
SByte |
INT16 |
Int16 |
INT32 |
Int32 |
INT64 |
Int64 |
UINT16 |
UInt16 |
UINT32 |
UInt32 |
UINT64 |
UInt64 |
Decimal |
Decimal |
Char |
Char |
String |
String |
Double |
Double |
Single |
Single |
TimeSpan |
TimeSpan |
DateTime |
DateTime |
A Class is defined with the keyword class followed by the name of the Class. The Generic Arguments of a Class are defined inside a pair of angle brackets '<', '>' following the name of the Class and are separated by commas. The Base Class of a Class is defined following the Generic Arguments and is separated from the Generic Argument with a colon ':'. The body of the Class is defined inside a pair of braces '{', '}'. A Class definition consists of a list of Member definitions. Each Member definition consists of a Remoting Type name followed by the name of the Member terminated with a semicolon ';'.
An Array is constructed by appending opening and closing brackets '[]' to the item Remoting Type name. The Rank of an Array is indicated by putting a comma ',' inside the brackets '[]'. The number of commas inside a pair of brackets '[]' is one less than the value of the Rank. For example, an Array with a Rank of 2 is '[,]'. The notation does not have a way to represent the lower bounds or upper bounds of an Array.
An Enum is defined with the keyword enum followed by the name of the Enum. The underlying Remoting Type of the Enum is defined following the Enum name separated by a colon ':'. The Members of the Enum are defined inside a pair of braces '{', '}' following the name of the Enum. Each Member definition consists of a Member name followed by an '=' and the value of the Member. Member definitions are separated by a ','.
A Server Interface is defined with the keyword interface followed by the name of the Server Interface. The Generic Arguments of the Server Interface are defined inside a pair of angle brackets '<', '>' following the name of the Server Interface and are separated by commas. The Base Interfaces are defined following the Generic Arguments and are separated from the Generic Arguments with a colon ':' The Base Interfaces are separated by a comma ','. The body of the Server Interface is defined inside opening and closing braces '{', '}'. A Server Interface definition consists of a list of Method and Member definitions.
Each Remote Field is defined as a Member consisting of a Remoting Type name followed by the name of the Remote Field terminated with a semicolon ';'.
Each Remote Method definition consists of a Remoting Type name followed by the name of the Remote Method. The Generic Arguments of the Remote Method are defined inside a pair of angle brackets '<', '>' following the name of the Remote Method and are separated by commas. The Arguments of the Remote Method are defined inside a pair of parentheses '(', ')' following the Generic Arguments and are separated by commas. Each Arguments definition consists of the name of the Remoting Type of an Arguments followed by the Arguments name. An Argument can be prefixed with a 'out' or 'ref' keyword to indicate an out or ref Arguments. If neither 'out' nor 'ref' is specified, then it indicates the Argument to be an 'in' Argument.
A Delegate is defined with the keyword delegate followed by the declaration of the Remote Method.
The grammar for the subset used by this specification and by [MS-NRLS] is specified in the following table with the ABNF syntax specified in [RFC4234].
Grammar |
||
---|---|---|
CompilationUnit |
= |
0*(Namespace) |
Namespace |
= |
'namespace' NamespaceIdentifier '{' 0*(Class / Interface / Enum / Delegate) '}' |
Class |
= |
'class' IDENTIFIER TypeVariableList Base ClassBody |
ClassBase |
= |
0*1(':' TypeIdentifier) |
ClassBody |
= |
'{' 0*(Member) '}' |
Member |
= |
TypeName IDENTIFIER ';' |
Interface |
= |
'interface' IDENTIFIER TypeVariableList InterfaceBase InterfaceBody |
InterfaceBase |
= |
0*1(':' TypeIdentifier 0*(',' TypeIdentifier)) |
InterfaceBody |
= |
'{' 0*(Method / Member) '}' |
Method |
= |
TypeName IDENTIFIER TypeVariableList ArgumentList |
ArgumentList |
= |
'(' 0*1(Argument 0*(',' Argument ) ) ')' ';' |
Argument |
= |
(0*1('ref' / 'out')) TypeName IDENTIFIER |
Enum |
= |
'enum' IDENTIFIER ':' EnumBase EnumBody |
EnumBase |
= |
NumericType |
EnumBody |
= |
'{' 0*1(EnumMember 0*(',' EnumMember) ) '}' |
EnumMember |
= |
IDENTIFIER '=' 1*(DIGIT) |
Delegate |
= |
'delegate' Method |
TypeVariableList |
= |
0*1( '<' IDENTIFIER 0*(',' IDENTIFIER) '>') |
TypeName |
= |
(TypeIdentifier / PrimitiveType ) |
Dimension |
= |
0*('[' 0* ( ',') ']') |
TypeIdentifier |
= |
NamespaceIdentifier TypeArgumentList |
TypeArgumentList |
= |
0*1(',' TypeName 0*(',' TypeName) '.') <28> |
PrimitiveType |
= |
NumericType / 'String'/ 'Decimal' / 'TimeSpan' / 'DateTime' / 'Double' / 'Single' / 'Char'/ 'Bool' |
NumericType |
= |
'SByte' / 'Int16' / 'Int32' / 'Int64' / 'Byte' / 'UInt16' / 'UInt32' / 'UInt64' |
NamespaceIdentifier |
= |
0*(IDENTIFIER '.') IDENTIFIER |
IDENTIFIER |
= |
See section IdentifierName (Identifier Name) |