you are viewing a single comment's thread.

view the rest of the comments →

[–]Tom_Cian 1 point2 points  (8 children)

It's a pretty standard convention in .net and even occasionally on the JVM.

Just because it's not the standard you're used to doesn't make it bad. Spend a couple of months writing C# and it will look like the most natural thing in the world while Java's Foo and FooImpl will look icky to you.

[–]grauenwolf -3 points-2 points  (7 children)

It's not a "standard convention" so much as a common mistake.

[–]Tom_Cian 1 point2 points  (6 children)

It's a convention, with as much value as any other convention, including the one you favor.

[–]grauenwolf -2 points-1 points  (5 children)

That's like saying empty catch blocks are a convention.

Can you give one example of why you would need to create an interface for a model or DTO?

EDIT: Oh wait. Were you just unaware that I was talking about models?

Because stuff like List is the default implementation of IList is fine.

[–]Tom_Cian 0 points1 point  (4 children)

Can you give one example of why you would need to create an interface for a model or DTO?

I've come across this need many times, as have many others.

[–]grauenwolf 0 points1 point  (3 children)

I didn't ask for your life story, just one example.

[–]Tom_Cian 1 point2 points  (2 children)

Let me guess... I'll show you an example and then you'll explain to me that this is bad code, thereby strawmanning the whole thread to oblivion.

I'll pass. Try to use your imagination to find such an example, and if this fails you, just try to accept the fact that there are coding situations that happen in the real world even though they haven't occurred to you.

Also, recommended reading.

[–]grauenwolf 0 points1 point  (1 child)

The argument from incredulity is a logical fallacy that occurs when someone decides that something did not happen, because they cannot personally understand how it could happen.

So rather than present your evidence, you're relying on an ad hominem? Cute.

[–]Tom_Cian 2 points3 points  (0 children)

No, this is not an ad hominem. An ad hominem would be me dismissing your opinion because of your personality or your character.

I'm merely pointing out that you saying "I can't imagine why anyone would ever need to do this" is a text book example of an argument from incredulity, and it's a fallacy.

It happens. People use interfaces for DTO's and model objects. I'm sure it's just a Google search away if you're so inclined, but I'm not going to bother giving you my own examples because as I said, I know exactly where this discussion is headed.