Re: But is it Object-Oriented?
Daniel Bonniot <[email protected]>
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: >Quoting Daniel Bonniot <[email protected]>: > > > >>This seems to me a different issue, which is how to define 'protected' >>in Nice. One possibility could be that a protected method can be >>overriden from anywhere there are new specializations for the parameters >>available (a generalization of "in subclasses", which actually coincides >> >> > >You mean, specializations of the method that are in packages that contain a >subclass of some type that was used as parameter in the method? > Yes. >>for mono-methods), but cannot be called publicly (alternatively, can be >>called when it can be overriden). The alternative more closely matches >>Java, but the I often felt the need for "overridable but not callable" >>methods, so that could be interesting. In this case, it seems that it >>would make sense: you can specialize the behaviour when the button is >>clicked, but the method can only be called when a click event is generated. >> >> > >No, you could still also call the specialized version directly from inside the >package that the specialized version was declared in, right? > > I proposed two variants. In the alternative, which is also Java's behaviour, yes, but not in the other variant. I was arguing that at least in some cases, the other variant better matches the usage pattern. Daniel ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click