Re: [PHP-DEV] Multiple class inheritance

2007-11-19 Thread Sam Barrow
Whether it's implemented or not, I'm going to write a patch for multiple class inheritance. Does anyone here whos knows about the Zend Engine willing to help me out just a little bit, to get me started? I'm stuck at the syntax interpretation right now. On Mon, 2007-11-19 at 02:07 -0500, Edward Z.

Re: [PHP-DEV] Multiple class inheritance

2007-11-19 Thread Sebastian Bergmann
Sam Barrow schrieb: What is the general opinion on multiple class inheritance. It is a concept that only works correctly in CLOS? -- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69 -- PHP

Re: [PHP-DEV] Multiple class inheritance

2007-11-19 Thread Sam Barrow
I doubt it will be implemented, but for my application it would be incredibly helpful and worth it to me to write a patch even if I am the only one to use it. On Mon, 2007-11-19 at 17:53 -0300, Cristian Rodriguez wrote: 2007/11/19, Sam Barrow [EMAIL PROTECTED]: Whether it's implemented or not,

Re: [PHP-DEV] Multiple class inheritance

2007-11-19 Thread Arnold Daniels
It would probably better to implement something like prototyping, where there is only 1 parent, but there can be muliple prototype classes from which methods are inherited. On Nov 19, 2007, at 10:49 PM, Sam Barrow [EMAIL PROTECTED] wrote: I doubt it will be implemented, but for my

Re: [PHP-DEV] Multiple class inheritance

2007-11-19 Thread Sam Barrow
That would serve my purpose, as long as i can inherit methods and properties from multiple parents. On Mon, 2007-11-19 at 23:09 +0100, Arnold Daniels wrote: It would probably better to implement something like prototyping, where there is only 1 parent, but there can be muliple prototype

Re: [PHP-DEV] Multiple class inheritance

2007-11-19 Thread Gergely Hodicska
That would serve my purpose, as long as i can inherit methods and properties from multiple parents. Sorry if it is off to this list. Sam maybe you should check some PHP mixins implementation: http://www.symfony-project.org/book/1_0/17-Extending-Symfony#Mixins

[PHP-DEV] Multiple class inheritance

2007-11-18 Thread Sam Barrow
What is the general opinion on multiple class inheritance. I have a need for it. I have objects for all user input fields. $username = new field ; $username - name = 'username' ; $username - maxLen = 32 ; I have three types of fields. Fields that are automatically put in the database, such as

Re: [PHP-DEV] Multiple class inheritance

2007-11-18 Thread Larry Garfield
It sounds like you want to be using decorators instead. http://en.wikipedia.org/wiki/Decorator_pattern On Sunday 18 November 2007, Sam Barrow wrote: What is the general opinion on multiple class inheritance. I have a need for it. I have objects for all user input fields. $username = new

Re: [PHP-DEV] Multiple class inheritance

2007-11-18 Thread Edward Z. Yang
Larry Garfield wrote: It sounds like you want to be using decorators instead. The decorator pattern is inappropriate for this case, because Sam wants to extend the interface, not change the behavior of an existing one. -- Edward Z. YangGnuPG: 0x869C48DA HTML Purifier

Re: [PHP-DEV] Multiple class inheritance

2007-11-18 Thread Larry Garfield
(Sorry, hit reply too soon.) Or, alternatively, you can mostly implement friend functions of a sort: http://www.garfieldtech.com/blog/php-magic-call but they have a performance penalty: http://www.garfieldtech.com/blog/magic-benchmarks On Sunday 18 November 2007, Sam Barrow wrote: What is

Re: [PHP-DEV] Multiple class inheritance

2007-11-18 Thread Larry Garfield
On Monday 19 November 2007, Edward Z. Yang wrote: Larry Garfield wrote: It sounds like you want to be using decorators instead. The decorator pattern is inappropriate for this case, because Sam wants to extend the interface, not change the behavior of an existing one. class AbstractField {

Re: [PHP-DEV] Multiple class inheritance

2007-11-18 Thread Edward Z. Yang
Larry Garfield wrote: $myfield = new InputField(new DBField(new AbstractField(...))); [snip] Nah, what you're talking about now is a chain of responsibility, where events are in the form of method calls. :-) -- Edward Z. YangGnuPG: 0x869C48DA HTML Purifier