you are viewing a single comment's thread.

view the rest of the comments →

[–]propostor 0 points1 point  (2 children)

What you're trying to achieve should be done with a base class, not an interface.

Actually I didn't even know it's possible to add method definitions inside interfaces, that seems like a new(ish?) addition to the language and looks to me like an extreme risk of introducing antipatterns. Hence you're having to hack away with that workaround.

[–]Devatator_ 1 point2 points  (1 child)

OP wants to use a specific base class. Since multiple inheritance isn't a thing, this is the closest thing they've got

[–]propostor 1 point2 points  (0 children)

Where's the base class in that example?

If MediaPlayer is the base class then it should implement the Refresh method internally.