Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37303 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26724 invoked from network); 29 Apr 2008 15:52:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2008 15:52:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=johncart@cisco.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=johncart@cisco.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain cisco.com designates 171.71.176.70 as permitted sender) X-PHP-List-Original-Sender: johncart@cisco.com X-Host-Fingerprint: 171.71.176.70 sj-iport-1.cisco.com Received: from [171.71.176.70] ([171.71.176.70:6035] helo=sj-iport-1.cisco.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/B6-26601-52447184 for ; Tue, 29 Apr 2008 11:52:06 -0400 Received: from ams-dkim-2.cisco.com ([144.254.224.139]) by sj-iport-1.cisco.com with ESMTP; 29 Apr 2008 08:52:02 -0700 Received: from ams-core-1.cisco.com (ams-core-1.cisco.com [144.254.224.150]) by ams-dkim-2.cisco.com (8.12.11/8.12.11) with ESMTP id m3TFq18k027837 for ; Tue, 29 Apr 2008 17:52:01 +0200 Received: from xbh-ams-332.emea.cisco.com (xbh-ams-332.cisco.com [144.254.231.87]) by ams-core-1.cisco.com (8.13.8/8.13.8) with ESMTP id m3TFq1CA013061 for ; Tue, 29 Apr 2008 15:52:01 GMT Received: from xmb-ams-33e.emea.cisco.com ([144.254.231.75]) by xbh-ams-332.emea.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 29 Apr 2008 17:52:01 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8AA10.F678ABC7" Date: Tue, 29 Apr 2008 17:51:30 +0200 Message-ID: In-Reply-To: <7dd2dc0b0804290817v3d8de030y1208a88f78c44411@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Re: [PHP-DEV] Class Properties in Interfaces? Thread-Index: AciqDCC3geZjLR4qTM2+o8360CfzfwAApBFA References: <48169695.9040803@omegavortex.net> <339714303.20080429114607@marcus-boerger.de> <7dd2dc0b0804290817v3d8de030y1208a88f78c44411@mail.gmail.com> To: X-OriginalArrivalTime: 29 Apr 2008 15:52:01.0245 (UTC) FILETIME=[F68948D0:01C8AA10] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=6053; t=1209484321; x=1210348321; c=relaxed/simple; s=amsdkim2001; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=johncart@cisco.com; z=From:=20=22John=20Carter=20-X=20(johncart=20-=20PolicyApp= 20Ltd=20at=20Cisco)=22=20 |Subject:=20RE=3A=20Re=3A=20[PHP-DEV]=20Class=20Properties= 20in=20Interfaces? |Sender:=20; bh=P8R4lzLfxOGD+fW2NRki0xufE2OrsUTHDn7zfdidatk=; b=lzoiII7FPF90afqctXXVkPWsU9/2iUE9FSvUlCwiPtKJjb5MHxUpPImork HjB9AvyywfWOptQNL/JuPYDbRr5LGCeUB4ADlZUk3cHoeubL3R+BdiMcPN2v 7D82hrne04; Authentication-Results: ams-dkim-2; header.From=johncart@cisco.com; dkim=pass ( sig from cisco.com/amsdkim2001 verified; ); Subject: RE: Re: [PHP-DEV] Class Properties in Interfaces? From: johncart@cisco.com ("John Carter -X (johncart - PolicyApp Ltd at Cisco)") ------_=_NextPart_001_01C8AA10.F678ABC7 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The article explicitly mentions OOP interfaces in a few languages. But the article, or for that matter any formal definition of an interface isn't really what I asked about: =20 My question was simply: why can't interfaces have properties? =20 John. ________________________________ From: Nathan Nobbe [mailto:quickshiftin@gmail.com]=20 Sent: 29 April 2008 16:17 To: John Carter -X (johncart - PolicyApp Ltd at Cisco) Cc: internals@lists.php.net Subject: Re: Re: [PHP-DEV] Class Properties in Interfaces? On Tue, Apr 29, 2008 at 6:28 AM, John Carter -X (johncart - PolicyApp Ltd at Cisco) wrote: =09 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" =09 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 ------_=_NextPart_001_01C8AA10.F678ABC7--