causal wrote: A class can implement an interface (or several interfaces) An interface can extend another interface (or several interfaces) causal
tempest wrote: Interfaces are used for lots of things they shouldn't be really.
For example why is Serializable an interface.
t does not represent an "is a" relationship.
You cannot say a Person is a Serializable.
I guess in general if the interface says "able" at the end it's not really defining type, but it's so common nowadays it's almost used without thinking.
Just because it makes the implementation generic doesn't make it right..
aspnet wrote: An interface is a definition of behaviour.... Extending the interface is changing the definition of that behaviour. Implementing an interface is filling in the details of that behaviour.
bonkey wrote: Agreed, but I don't like your example
bonkey wrote: Regardless, English grammar does not define what is and is not an interface.
bonkey wrote: Ever tried explaining to someone the difference between applications and data on a computer? Ultimately, what does it boil down to if not that there are two types of file - those than can be executed, and those that cannot. So, this gives us an executable type.
bonkey wrote: I would look at it the other way around. Just because inheritance can be used to define hierarchical abstraction, doesn't mean its not right to use it for other purposes as well.
bonkey wrote: I can see no more elegant solution to the notion of abstract, common ability then the use of an interface. And if something is the most elegant solution to a problem, there should need to be a damn good reason not to use it, other than the notion that "but this isn't really what we wanted this to be used for in the purest sense".
aspnet wrote: ( interfaces are used in other programming languages besides java ).