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 use contract programming by taking advantage of protocols.
We will work with examples on how to define protocols, their different kinds of requirements, and then to declare classes that adopt the protocols. We will use the 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#.