On Tue, Apr 29, 2008 at 6:28 AM, John Carter -X (johncart - PolicyApp Ltd at Cisco) <[EMAIL PROTECTED]> wrote:
> > I think I must be missing something here, but this sounds a little > tautological - "we can't do it because it doesn't make sense. This is > because it doesn't make sense" > > Certainly most people (myself included) consider interfaces to be > methods only, but I can't find a reason why not, and a > search-on-wikipedia-instead-of-doing-proper-research appears to allow > it: http://en.wikipedia.org/wiki/Interface_%28computer_science%29 the problem with that article, as it pertains to this conversation is that it is referring to interfaces as a general concept. 'interfaces' can be formed in many ways, via extension of an abstract class or even an expected set of a parameters in an HTTP request... getting to the more concrete term 'interface' as it pertains to a language keyword, interfaces define a contract; they do not specify implementation details. member variables only facilitate the actions member functions expose and therefore, they are part of the implementation. additionally, one can look to java (and likely others) to see that public attributes are not supported on interfaces. here is a definition from a java5 cert book; "When you create an interface, you're defining a contract for *what* a class can do, without saying anything about how the class will do it. An interface is a contract." -nathan