D
deko
From what I've read about Interfaces, they simply define a contract - that
is, they say: "this class will implement all the methods I say it will".
That's a nice "note to developer" but the question I have is this: what can
I do with an Interface that I can't do with regular method calls?
Perhaps it could be said "interfaces enable plug-and-play architectures
since all classes that implement the same interface can be used in the same
way". But if all the developers on my team agreed that any class name
ending in "03abc" implemented all 3 methods in class "abc", then we'd have
the same thing (except the compiler would not enforce our agreement).
Aside from the compiler enforcing an agreement among developers, what do
Interfaces do that I could not do with method calls?
is, they say: "this class will implement all the methods I say it will".
That's a nice "note to developer" but the question I have is this: what can
I do with an Interface that I can't do with regular method calls?
Perhaps it could be said "interfaces enable plug-and-play architectures
since all classes that implement the same interface can be used in the same
way". But if all the developers on my team agreed that any class name
ending in "03abc" implemented all 3 methods in class "abc", then we'd have
the same thing (except the compiler would not enforce our agreement).
Aside from the compiler enforcing an agreement among developers, what do
Interfaces do that I could not do with method calls?