Comment

Comment by hota_mazi

These concepts are orthogonal.

I can use composition and inheritance to define an IS_A relationship and I can use them to define a HAS_A relationship.

For example, in Kotlin:

    class A : B // IS_A via inheritance    
    class A(b: B) {  // HAS_A via composition
    class A(b: B) : B by b // IS_A via composition
parent hota_mazi 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton