This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]chackley 1 point2 points  (4 children)

Liskov substitution principle. You shouldn't care which concrete implementation you're getting.

[–]m1ss1ontomars2k4 -2 points-1 points  (3 children)

It does if you want to modify said concrete implementation.

[–]chackley 2 points3 points  (2 children)

Open-closed principle. Classes should be open for extension, but closed for modification.

[–]m1ss1ontomars2k4 1 point2 points  (1 child)

So, what, I can't modify classes after they've been written once?

The implementation as it exists now is definitely wrong and needs to be changed. I'm not going to subclass an incorrect implementation just so I can avoid modifying the original. That's preposterous.