concept tprotocol in category apache thrift

This is an excerpt from Manning's book Programmer's Guide to Apache Thrift.
The abstract protocol interface is typically defined in a class called TProtocol. TProtocol implementations keep a reference to a TTransport used as the target for all protocol read and write operations (see figure 5.3). This transport reference is typically set at protocol construction time for the life of the protocol, binding the protocol and transport together into an I/O stack. Any protocol can use any transport because protocols depend only upon the abstract TTransport interface, not the underlying implementation. Thus, a given protocol can serialize to memory, disk, or over a network.
Pointers to the abstract bases TTransport 1 and TProtocol 3 are used throughout the code, allowing us to select the type of transport and protocol at runtime. The user sets the transport and protocol via the command line.