concept argument - list in category apache thrift

appears as: rgument-lists, n argument-list, rgument-list, Argument-lists
Programmer's Guide to Apache Thrift

This is an excerpt from Manning's book Programmer's Guide to Apache Thrift.

Argument-lists are sets of fields similar to struct fields. Arguments can have default values; however, they always have default requiredness and cannot be flagged as optional or required. At a minimum, each argument should have an ID, a type, and a name. Function arguments can be added and removed like struct fields to support interface evolution. Servers receiving requests with missing arguments will use default values (language-defined or user-defined), and servers receiving unknown parameters will ignore them.

6.10. Structures, unions, exceptions, and argument-lists

Structures, unions, exceptions, and argument-lists all allow a set of elements to be collected together into an affinity group. Services contain a set of functions. Each function has an argument-list composed of a set of fields. Structs, unions, and exceptions also contain a set of fields. Internally the Apache Thrift IDL compiler uses the same data structure to represent sets of fields in structs, unions, exceptions, and argument-lists.

The following listing shows example declarations of a struct, union, exception, and argument-list. Notice the similarities.

Listing 6.9. Compound types
struct stTimeStamp {
    1: i16  year
    2: i16  month
    3: i16  day
}
union unTimeStamp {
    1: i16  year
    2: i16  month
    3: i16  day
}
exception exTimeStamp {
    1: i16  year
    2: i16  month
    3: i16  day
}
service svTimeStamp {
    void fnTimeStamp (1: i16  year
                      2: i16  month
                      3: i16  day)
}

Fields may be of any valid type, including base types, structs, unions, exceptions, and containers. Each of the groups of fields in listing 6.9 are compiled into language-specific classes with read() and write() methods. The read() method reads an instance of the struct, union, exception, or argument-list. The write() method writes the struct, union, exception, or argument-list. The read and write operations take a protocol as the argument to read from or write to.