Chapter 6
Protocol-Oriented Programming
Section 2
Object-Oriented Programming versus Protocol-Oriented Programming
In the object-oriented programming example, we created a Vehicle superclass from which all the vehicle classes were derived from. In the protocol-oriented programming example, we used a combination of protocols and protocol extensions to achieve the same result; however, there are several advantages to the protocol-oriented design. - Take a look at vehicle superclass - Use protocols and protocol extensions - Implement vehicle types