Generic Protocols
You’ve successfully completed Chapter 6, Generic Protocols. When I introduced Protocol Oriented Programming, you probably thought it was the real deal. Don’t get me wrong. It is. You’ve learned how to create scalable design using Associated Types and extension
along with where
clauses. A protocol oriented paradigm certainly carries a number of benefits over traditional object oriented programming. However, using protocols for every execution could potentially be an overkill for certain implementations. The folder and cell example in Lesson 3 does not need a wrapper class to type erase. At the end of the day, it is your decision to choose which methods that you prefer. I recommend you to think over before you use any letter that has to do with p
in the Swift Programming Language. So, what does that mean. You must study every alternative to choose the best case for every scenario. You should be aware of benefits and tradeoffs. In the following chapter, you will continue to expand your knowledge with enums.