My two cents

Walter Bright newshound2 at digitalmars.com
Wed Oct 25 09:40:44 UTC 2017


On 10/25/2017 12:39 AM, Satoshi wrote:
> Thanks, but I see there 3 problems:
> 1. this example enforce users to use composition instead of inheritance when 
> they wants to create custom descendant.

I don't see an issue with that.

> 2. multiple dispatch levels. Extending the ExtendView in another lib we get 
> triple dispatch for each method.

That's only if you want to hide the interface base class implementation, and 
only if you want to *also* call the base function. There's single dispatch if 
overriding, or not overriding, the base function. You can also inherit directly 
from LibraryView, and there'd be only one dispatch.


More information about the Digitalmars-d mailing list