D modeling

CheeseWiz CheesyFritos at gmail.com
Sun Jul 7 20:42:00 UTC 2019


On Sunday, 7 July 2019 at 16:37:32 UTC, Jesse Phillips wrote:
> On Friday, 5 July 2019 at 11:22:10 UTC, CheeseWiz wrote:
>
>> You seem to think the example is a real world model and that 
>> all other models would work the same.
>
> No I asked a question about your model and you said it couldn't 
> be done without interfaces, I showed that wasn't the case.
>
>>
>> You've removed all the interfaces so you would not have MI. 
>> You believe that was as smart thing. But you have completely 
>> disconnected  ModelB from itself.
>>
>> Now ModelB.Dog does not inheret from ModelB.Animal.
>
> Your model doesn't do that either, why? Because D doesn't have 
> multiple inheritance. You would need `ModelB.Dog : 
> ModelB.Animal, ModelA.Dog` but you can't because D does not 
> allow for it.
>
>> 2.
>>
>> My original code:
>>
>> 	ModelA.iAnimal animal1 = new ModelB.Cat("Super Mittens");
>> 	ModelA.iAnimal animal2 = new ModelB.Dog("Super Sparky");
>>
>> you changed the returns to auto.
>
> You are correct, and that only has the effect of forcing the 
> cast I removed, my model matched the behavior of your model.
>
>
>> 3. You have to realize you are wrong, that is the first step 
>> to understanding. I've tried to point it out but you are 
>> probably still thinking "But I'm right and he's wrong".
>
> No, I don't think I am right, I think I was wrong because the 
> model you provided was inaccurate for requirements you are 
> placing on me.
>
> A wise man once said to me, "You have to realize you are wrong, 
> that is the first step to understanding"
>
> See, what happened is you missed the point of removing all the 
> interfaces, it was to show that the interfaces you chose to add 
> were not necessary to meet the code you had put into place, it 
> was also intended to show that your inheritance of all the 
> different interfaces in all classes was excessive and causing 
> issues.
>
> Here is a more accurate representation of your model when 
> correctly written in D.
>
> https://gist.github.com/JesseKPhillips/b891604444f4aee72c705b498a206d50
>
> What you will notice is that the ModelB.Animal class is 
> commented out, the reason for this is because it is not 
> utilized your original model as you never inherited that class, 
> all you did was `alias Attack = Animal.Attack;` but that isn't 
> doing what you think it is doing.
>

The compiler forced me to do that to override the base class. 
Irregardless, it is irrelevant.

> I instructed ModelB.iAnimal to `override iFood 
> LikesWhichFood()` because I wanted covariance and have ModelB 
> Animials to return ModelB.iFood.
>
> So please continue to insult my understanding of how D 
> inheritance works, I'd like to hear more about your unbounded 
> knowledge.

I'm not insulting you. I was pointing out that your incessant 
"You don't needed interfaces" is wrong. I'm sorry you seem to 
think that when someone gives an example that example is all that 
matter. I have to give examples to express concepts.

I was trying to get you to realize that you are missing the point 
but you seem to want to keep on harping it. I will make it clear: 
THE EXAMPLE I GAVE IS AN ****EXAMPLE****. Is that clear?

Here is the definition of an example:

ex·am·ple
/iɡˈzampəl/
  Learn to pronounce
noun
1.
a thing characteristic of its kind or illustrating a general rule.
"it's a good example of how European action can produce results"
synonyms:	specimen, sample, exemplar, exemplification, instance, 
case, representative case, typical case, case in point, 
illustration
"a fine example of a 16th-century longhouse"
2.
a person or thing regarded in terms of their fitness to be 
imitated or the likelihood of their being imitated.
"it is vitally important that parents should set an example"
synonyms:	precedent, lead, guide, model, pattern, blueprint, 
template, paradigm, exemplar, ideal, standard; More
verb
1.
be illustrated or exemplified.


What you did was make my example as if it were an actual problem. 
It should have been clear that the example was ridiculous as a 
problem by it's nature.

The whole problem was about modeling, not about somehow 
optimizing the example.  You failed at that, I'm sorry, I tried 
to get you to understand that so we could move past it but you 
still want to seem to harp on it. I told you several times you 
were wrong in removing the interfaces. You took it as being wrong 
in making that example work, I was telling you that it is wrong 
to remove it because it destroys the examples as being an example 
of the larger problem I am talking about. I stated many times 
what I was trying to do and you insisted at every step I didn't 
need interfaces and I told you they were required for the general 
problem. You ignored that and now you want to blame me for you 
ignoring it. I told you many times you can't ignore it and you 
are wrong for doing so but now, again, it is my fault for you 
ignoring it. You still seem to think you are right because you 
reduced the example to an equivalent example that is functionally 
the same. Well, duh... but now what the fuck am I suppose to do 
with real problems that actually matter rather than some 
contrived and pathetic example that was meant to be precisely an 
example to illustrate the more general problem(the problem I did 
state in more general terms)?

I mean, seriously, what the hell is one suppose to do? Give an 
example and create in in such a way that no one could ever reduce 
it to a example that then is irrelevant? Come on! That is now how 
things work no matter how much you want them to!

See, what you were suppose to do in your brain is say "Ok, this 
is an example, I'll assume in requirements for inheritance are 
necessary in the larger scope and because he has told me several 
times they are... I'll just take his word for it". But no, it's 
all my fault for not just accepting your answer as being correct.







More information about the Digitalmars-d mailing list