O'Reilly logo

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Issues and alternatives

Implementation inheritance is controversial among OOP programmers and theoreticians. For instance, the authors Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm, of the book Design Patterns: Elements of Reusable Object-Oriented Software, advocate interface inheritance instead of implementation inheritance and recommend preferring composition over inheritance.

For example, the decorator pattern (as stated previously) has been proposed to overcome the static nature of inheritance between classes.

Furthermore, the OOP community agrees that inheritance introduces unnecessary coupling and breaks encapsulation, so modifications to the super classes can cause undesirable behavioral changes in subclasses.

In Swift, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required