On Tue, Apr 29, 2008 at 10:28 AM, John Carter -X (johncart - PolicyApp Ltd at Cisco) <[EMAIL PROTECTED]> wrote:
> Nathan, > > By example: > > interface EggLayer > > { > public $eggsLaid; > } > > class Chicken implements EggLayer; > > Some would say (and maybe I would too) that you should have a > getEggsLaid() method, that's fair enough. But why not the above? because, from above, $eggsLaid constitutes the implementation of any class that implements EggLayer. You say interfaces can't have properties because they require instance > variables. thats fine, in fact thats what i take the two terms to mean; however, there was an alternate definition given in an earlier post and i just wanted to clarify whether you were referring to that definition of property. hence forth i understand that you are not referring to that definition. > Why do they require instance variables? this was only based on the aforementioned definition of properties whereby a property is an instance variable that has respective getters and setters. in the absence of that definition, my statement is irrelevant. > I also think for the > purposes of this discussion, property and instance variable mean the > same thing. cool, then i would say that interfaces cannot have public properties in them because it imposes implementation requirements on any implementors. to specify implementation details, there is the abstract class. -nathan