Re: [PHP] Re: Enforce a constant in a class.

2010-01-26 Thread Richard Quadling
2010/1/25 Colin Guthrie : > 'Twas brillig, and Richard Quadling at 22/01/10 11:33 did gyre and gimble: >> Hello, >> >> One of the aspects of an interface is to enforce a public view of a >> class (as I see it). >> >> Within PHP, interfaces are allowed to have constants, but you cannot >> override t

[PHP] Re: Enforce a constant in a class.

2010-01-25 Thread Colin Guthrie
'Twas brillig, and Richard Quadling at 22/01/10 11:33 did gyre and gimble: > Hello, > > One of the aspects of an interface is to enforce a public view of a > class (as I see it). > > Within PHP, interfaces are allowed to have constants, but you cannot > override them in a class implementing that

Re: [PHP] Re: Enforce a constant in a class.

2010-01-25 Thread Richard Quadling
2010/1/25 Pete Ford : > Richard Quadling wrote: >> >> 2010/1/22 Pete Ford : >>> >>> IMHO, a constant is not the correct beastie in this case - if you want it >>> to >>> be different depending on the implementation then it ain't a constant! >>> >>> You should probably have protected static variables

Re: [PHP] Re: Enforce a constant in a class.

2010-01-25 Thread Pete Ford
Richard Quadling wrote: 2010/1/22 Pete Ford : IMHO, a constant is not the correct beastie in this case - if you want it to be different depending on the implementation then it ain't a constant! You should probably have protected static variables in the interface, and use the implementation's co

Re: [PHP] Re: Enforce a constant in a class.

2010-01-22 Thread Richard Quadling
2010/1/22 Pete Ford : > IMHO, a constant is not the correct beastie in this case - if you want it to > be different depending on the implementation then it ain't a constant! > > You should probably have protected static variables in the interface, and > use the implementation's constructor to set t

Re: [PHP] Re: Enforce a constant in a class.

2010-01-22 Thread Richard Quadling
2010/1/22 Pete Ford : > > IMHO, a constant is not the correct beastie in this case - if you want it to > be different depending on the implementation then it ain't a constant! > > You should probably have protected static variables in the interface, and > use the implementation's constructor to set

[PHP] Re: Enforce a constant in a class.

2010-01-22 Thread Pete Ford
Richard Quadling wrote: Hello, One of the aspects of an interface is to enforce a public view of a class (as I see it). Within PHP, interfaces are allowed to have constants, but you cannot override them in a class implementing that interface. This seems wrong. The interface shouldn't define t