A protocol is a specified object interface, a named set of message specifications defining what messages an object must understand, what their parameters are, and what their return values will be. A protocol defines a type rather than a class; it does not say anything at all about implementation, only external behavior. Input parameters and return values are specified in terms of other types, which must also be defined by protocols.
A class is said to conform to a protocol if it implements all of the messages defined by that protocol and adheres to the specified types for input and output values. A class can conform to more than one protocol, so multiple inheritance of types is possible.
In addition, protocols can refine other protocols. (This is similar to, but distinct from inheritance among classes, which is implementation-based.) A refining protocol can add additional message specifications, but it cannot remove any. It can also refine the input and output types of the message specifications defined by the supertype, but only in specific ways:
A protocol can be generated from a thing, or it can be retrieved from an existing class. See Transforms and code generation for more information.
A message specification is an element contained within a protocol. It defines a single message signature, including parameters and return values. It can also specify exceptions.
A message specification can be generated from a responsibility, or it can be retrieved from an implemented method. See Transforms and code generation for more information.
A parameter element is part of a message specification. It defines the name and type of a single message parameter. Type is specified in terms of a defined protocol. The parameter can also specify aliasing (whether the parameter is the same as the return value).
A return value element is part of a message specification. It specifies the name and type of a message return value. Type is specified in terms of a defined protocol. The return value can also specify aliasing (whether the return value is the same as one of the message parameters).
An exception element is part of a message specification. It specifies a named error condition that a message can raise. Identifying possible error conditions helps to ensure that they are handled.