D modeling

Bert Bert at gmail.com
Wed Jul 3 19:31:49 UTC 2019


On Wednesday, 3 July 2019 at 14:06:16 UTC, Jesse Phillips wrote:
> On Wednesday, 3 July 2019 at 14:01:17 UTC, Jesse Phillips wrote:
>> On Wednesday, 3 July 2019 at 13:34:38 UTC, Bert wrote:
>>> Interfaces are required because D does not support MI of 
>>> classes. You will not be able to substitute one model for the 
>>> other without inheritance. It's required.
>>
>> All I did was remove the interfaces:
>>
>> https://run.dlang.io/gist/3b14d69aa323d83e2736a0e2e0dece3f
>
> Now I remove your unneeded overrides:
>
> https://run.dlang.io/gist/28168b9e1265ab05da310c527079f6ac

404: Not Found


The problem with removing the interfaces is that when you try to 
extend the model by adding new classes you will then have 
multiple inheritance of classes and be screwed. You may be able 
to remove them in the simple example I gave but in general it 
will be impossible to make it work. One of the main reasons for 
interfaces is precisely to allow MI in a single inheritance 
language. The interfaces are the only way to avoid such future 
problems. In essence you are creating an anti-pattern.


More information about the Digitalmars-d mailing list