Re: [nyphp-talk] Constants interfaces

2008-09-03 Thread Kenneth Dombrowski
On 08-09-03 15:12 -0400, Michael B Allen wrote: > On Wed, Sep 3, 2008 at 2:20 PM, Kenneth Dombrowski <[EMAIL PROTECTED]> wrote: > > I don't have a problem with multiple inheritence, it just seems very > > kludgey to me to implement it with interfaces; I guesss PHP gives you > > little choice though

Re: [nyphp-talk] Constants interfaces

2008-09-03 Thread Michael B Allen
On Wed, Sep 3, 2008 at 2:20 PM, Kenneth Dombrowski <[EMAIL PROTECTED]> wrote: > I don't have a problem with multiple inheritence, it just seems very > kludgey to me to implement it with interfaces; I guesss PHP gives you > little choice though.. Quite the opposite. The only non-kludgey way to impl

Re: [nyphp-talk] Constants interfaces

2008-09-03 Thread Kenneth Dombrowski
Hi Michael, Well, if it works for you, go for it. I think it's a bit weird and extremely unintuitive to inherit from an interface, and I wouldn't have expected it was even permitted, but it turns out it's even documented (apparantly it only works for constants): http://www.php.net/manual/en/la

Re: [nyphp-talk] Constants interfaces

2008-09-03 Thread Michael B Allen
On Wed, Sep 3, 2008 at 9:41 AM, Kenneth Dombrowski <[EMAIL PROTECTED]> wrote: > Hi Michael, > > I have to disagree. > > On 08-09-03 02:07 -0400, Michael B Allen wrote: >> >> Consider the following: >> >> interface Math_Constants { >> >> const PI = 3.14159265; > > No, that's not at all what

Re: [nyphp-talk] Constants interfaces

2008-09-03 Thread Kenneth Dombrowski
Hi Michael, I have to disagree. On 08-09-03 02:07 -0400, Michael B Allen wrote: > > Consider the following: > > interface Math_Constants { > > const PI = 3.14159265; No, that's not at all what an interface is for. An interface is nothing more than a contract which specifies what m

Re: [nyphp-talk] Constants interfaces

2008-09-02 Thread Michael B Allen
On Wed, Sep 3, 2008 at 12:34 AM, Anirudh Zala <[EMAIL PROTECTED]> wrote: > On Wednesday 03 September 2008 06:04:16 Michael B Allen wrote: >> How do people feel about the use of Java-ist "Constants" interfaces like: >> >> interface Sql_Constants >> { >> >> const SELECT = 1; >> const

Re: [nyphp-talk] Constants interfaces

2008-09-02 Thread Anirudh Zala
On Wednesday 03 September 2008 06:04:16 Michael B Allen wrote: > How do people feel about the use of Java-ist "Constants" interfaces like: > > interface Sql_Constants > { > > const SELECT = 1; > const FROM = 2; > const WHERE = 3; > const NOT = 4; > > > } > >

[nyphp-talk] Constants interfaces

2008-09-02 Thread Michael B Allen
How do people feel about the use of Java-ist "Constants" interfaces like: interface Sql_Constants { const SELECT = 1; const FROM = 2; const WHERE = 3; const NOT = 4; } where the objective is to permit any class that needs these constants to access them u