Chapter 5. Contract Programming with Protocols
In this chapter, we will work with more complex scenarios in which we will have to use instances that belong to more than one blueprint. We will use contract programming by taking advantage of protocols.
We will work with examples on how to define protocols and their different kinds of requirements, and then on how to declare classes that adopt the protocols. We will use multiple inheritance of protocols and many useful ways of taking advantage of this object-oriented concept, also known as interfaces in other programming languages such as Java and C#.