Home  |  Linux  | Mysql  | PHP  | XML
From:alpha_centurion at hotmail dot com Date:Sun Apr  5 04:30:24 2009
Subject:#36066 [Com]: Allowing member variables in interfaces
ID: 36066
Comment by: alpha_centurion at hotmail dot com
Reported By: pablobm at gmail dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 5.1.2
New Comment:

I'd agree with this. Both from the perspective of people coming into
PHP from other languages and an OO purist, the capacity to define public
properties in interfaces is integral to their function.

Although there is an argument which could support using interfaces
purely for method signatures, it is more academic than practical and
typically ends with some idea of separating property-focused interfaces
from method-focused interfaces (facets of functionality).

The usage strategy is something that should be decided in the
implementation of software built on the language; the provision of the
base functionality seems a logical (and necessary) progression of the
language.


Previous Comments:
------------------------------------------------------------------------

[2006-01-18 12:20:29] pablobm at gmail dot com

Description:
------------
Maybe it's just me, but I think member variables should be allowed in
object interfaces.

My opinion is that this makes sense in PHP because it has proper
getters/setters.

Java allows mamber variables in interfaces for example, but, in its
case, that doesn't make much sense, since (last time I checked, in 1.4)
there are no proper getter/setter methods in Java as those found in
PHP5.

If I want an interface to define behaviour for a data structure that
holds information, I will have to include getMember() and setMember()
methods, not being able to use PHP5 getters/setters.



------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=36066&edit=1

Navigate in group php.bugs at sever news.php.net
Previous Next


Your recent visits
[rt.cpan.org #38217] script looking for libperl.so.5.8, but libperl.so.5.8.8 exists
cvs: phpdoc-tr / language-snippets.ent /features commandline.xml /language/control-structures include.xml /language/types array.xml /reference/apc book.xml ini.xml /reference/bbcode/functions bbcode-add-smiley.xml /reference/datetime/functions date.
cvs: phpdoc-tr /reference/unicode book.xml configure.xml constants.xml ini.xml reference.xml setup.xml /reference/unicode/functions unicode-decode.xml unicode-encode.xml unicode-get-error-mode.xml unicode-get-subst.char.xml unicode-set-error-mode.xml uni



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants