Composition vs. Inheritance: Alternative to Protocols | Swift & iOS Basics

preview_player
Показать описание
In software development, the choice of design principles significantly impacts the maintainability, scalability, and flexibility of a codebase. Protocols (or interfaces) are a powerful tool which gives developers the freedom to introduce, update, refactor, or replace individual components without risking to destabilize the system at large.

But protocols aren’t the only way to achieve that degree of flexibility. In addressing specific challenges, other mechanisms turn out to be a better choice. Inheritance is one of such alternatives. It is a key concept in object-oriented programming, and in this video, I’m delving into why alternatives might be necessary, and comparing the approaches.

Support the Swift Bird by…

Links:

Chapters:
• 0:00 Intro
• 1:22 What Is Composition?
• 3:06 Why Alternatives Might Be Needed
• 4:25 Inheritance: An Alternative Approach
• 7:23 Benefits of Inheritance
• 10:02 Drawbacks of Inheritance
• 12:58 How to Choose
• 15:54 Summary

The Swift Bird, a Yakov Manshin production 🎞️

#composition #inheritance #softwaredevelopment
Рекомендации по теме
Комментарии
Автор

Good talk. Thanks.
Gotta say, I really don't miss inheritance in SwiftUI.

wmblemania
Автор

Apple should not have called it SWIFT protocol. SWIFT is a well-known protocol used for financial transaction across banking entities.

govikris
visit shbcf.ru