Learn how protocol inheritance is a powerful feature that lets us create more granular designs.
- [Instructor] A protocol can inherit from one…or more protocols and add new requirements…on top of the inherited ones.…A protocol inheritance is a powerful feature…which lets create more granular designs.…Let's open the project by going through the desktop.…Exercise files, chapter two…0 two 0 five…start and opening the protocol…inheritance playground.…So, here is the binary representable protocol.…
Now, lets assume that we want to add new requirements.…Say, we need the ability to save instances…to the local storage and restore them later on.…Also, we need support for Base64 encoding.…We could squeeze in all the functionality in this protocol.…Yet, this means that we assign unrelated responsibilities…like persistence and Base64 encoding to this protocol.…This is a bad sign and it leads to the same issue…we had with monolithics superclasses.…
Instead, we create dedicated protocols…for each requirement set.…First, we create the protocol…that defines the persistence related requirements.…I'm going to call it, Binary Persistable.…
- Comparing object-oriented programming with protocol-oriented programming
- Methods and class-bound protocols
- Adopting a protocol
- Declaring asynchronous behavior
- Preparing and implementing fallback logic
- Implementing an app using protocol-oriented programming
Skill Level Intermediate
1. Protocol-Oriented Programming
4. Implement the Weather App Using POP
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.