Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37329 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 475 invoked from network); 30 Apr 2008 05:22:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2008 05:22:14 -0000 Authentication-Results: pb1.pair.com header.from=quickshiftin@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=quickshiftin@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.152 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: quickshiftin@gmail.com X-Host-Fingerprint: 72.14.220.152 fg-out-1718.google.com Received: from [72.14.220.152] ([72.14.220.152:40943] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/4A-28930-30208184 for ; Wed, 30 Apr 2008 01:22:13 -0400 Received: by fg-out-1718.google.com with SMTP id 16so17917fgg.23 for ; Tue, 29 Apr 2008 22:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=MOdz1UPLeUDs+6vcXIv8JMEFRvUr6/lcvuIXZU5i4sA=; b=UmEDIwu9J+zhZAph8umfpv4Vu2sZ356oFRg8Fr8fkWBCQSfGdyZtAsqlrW0jzbAXKnh6VdzK1zG4NsGaoTV/CNXfWDzCHd8UP1T9YwaonJqfVpnz+CLmHOTYKxZvTdMHw6ro0wcjRpxc8oHTL5MMpBtti7EBRs0U6/GyCjhGpqU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=GR+3e2SV4zfxPnHLv9ZzF7w2XQDGvMxo1QDw4NmGFfCPryrUYPlS0USjY7m2MPQXcqekXnbnLOC6F8Ds/1BqWIiEuJu8Kmxp1c0A/I8VctndE2xxn8P25TTa+hbT9ZggaQihCZeuscqrzCcX2FdhIeTGvC3G3vEQWg9tbR1uA2s= Received: by 10.86.100.19 with SMTP id x19mr298092fgb.12.1209532925250; Tue, 29 Apr 2008 22:22:05 -0700 (PDT) Received: by 10.86.59.15 with HTTP; Tue, 29 Apr 2008 22:22:05 -0700 (PDT) Message-ID: <7dd2dc0b0804292222h29c8845k456f6546cbdbece6@mail.gmail.com> Date: Wed, 30 Apr 2008 01:22:05 -0400 To: "Robert Cummings" Cc: RQuadling@googlemail.com, "John Carter -X (johncart - PolicyApp Ltd at Cisco)" , internals@lists.php.net In-Reply-To: <1209532046.7057.368.camel@blobule> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_16222_6204270.1209532925267" References: <48169695.9040803@omegavortex.net> <1209512914.7057.296.camel@blobule> <10845a340804291714g7eb10362m17af4abecbadf0e4@mail.gmail.com> <7dd2dc0b0804291801m627a7c31h8dd796d7fa1d1257@mail.gmail.com> <1209518549.7057.313.camel@blobule> <7dd2dc0b0804292051o4fd5e77eu6f8faecad93c378a@mail.gmail.com> <1209528338.7057.349.camel@blobule> <7dd2dc0b0804292127p484d8c7g9cf852f0a79a8dc6@mail.gmail.com> <1209532046.7057.368.camel@blobule> Subject: Re: [PHP-DEV] Class Properties in Interfaces? From: quickshiftin@gmail.com ("Nathan Nobbe") ------=_Part_16222_6204270.1209532925267 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Apr 30, 2008 at 1:07 AM, Robert Cummings wrote: > > On Wed, 2008-04-30 at 00:27 -0400, Nathan Nobbe wrote: > > On Wed, Apr 30, 2008 at 12:05 AM, Robert Cummings > > > > Abstract classes and interfaces are not the same. They are > > used for > > fundamentally different reasons. An interface is to enforce a > > contract > > for all implementations of the interface. Therefore if I were > > to create > > an interface with an interface property of x, then all > > implementations > > using that interface would know that property x exists and > > could use it > > thusly without having to check for it's existence. > > > > i am fully aware of the differences between interfaces and abstract > > classes. however, if a public method is defined on any class, > > abstract or concrete, it may be used without checking by client code; > > i believe thats the entire point.. > > > > Using an abstractclass is a hack, it's not sufficient for > > enforcement, and you can't > > combine multiple abstract classes as you can with interfaces. > > > > abstract classes have their place. primarily they are well suited for > > template method because some methods can be forced to be implemented > > by children and others can be optionally overridden. > > > > and lastly, coming to multiple inheritance (for lack of better > > terminology); that is the only argument with any value for adding > > public attributes to the interface construct; however i am still not > > receptive to it. from my perspective data is an implementation > > detail, period. > > We are not talking about data here. We are talking about properties. > Data is assigned to a property which is akin to functionality being > assigned to a method. A property has all the features of the most simple > getter/setter method combination in one fell statement and without the > envelope overhead. As such, there is no reason why it could not be part > of the interface design. so a 'property' could be any data type? that sounds contradictory to the concept of an interface to me. the only special connotation i have ever encountered for the term 'property' is my *very* brief work w/ vb.net as a teacher. there is a mechanism whereby getters and setters can be declared and a member variable can be named.. then when using instances of the class, client code uses the name of the 'property' which has the same syntax as accessing a public data member, however, the client is transparently being driven through the methods of the 'property'. between SPL ArrayAccess, and magic methods, php already has multiple ways to realize 'properties'. -nathan ------=_Part_16222_6204270.1209532925267--