Skip to content

Comment on Access Control in Swiftparent

Comments

Then you don't understand composition. I can pass the actual implementation in the constructor or via dependency injection. With multiple inheritance, your class is restricted to one implementation. Moreover, it couples the class with the internals of observables, rather than using simple interfaces, which composition provides.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.