Re: But is it Object-Oriented?
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
Quoting Isaac Gouy <[email protected]>: > Let's see if we can be a little more concrete: in the wiki example > > http://nice.sourceforge.net/cgi-bin/twiki/view/Doc/HelloSwtUserInterfaceExample > > It wouldn't be unlikely that we'd decide to subclass HelloGoodbye and > override helloButtonSelected. This (helloButtonSelected) is a method > that seems like it should be private, it's only useful in this context > or maybe when we subclass - we'd probably make it protected in Java, > > What to do in Nice? "protected" doesn't make any sense when methods are not nested inside of classes, except for constructors. If you want another package to be able to specialize helloButtonSelected you need to make it public. If you want to be able to specialize it in the same package then you would make it "package" scoped. If you want to disallow specializing the method outside of the current source file then you would make it "private." I don't see any need to make something more private than "private" gives here. Actually, you could seperate the idea of "can be specialized outside of this package" and "can be invoked outside of this package." For example, you could say that a method marked "public final" cannot be specialized outside of the package it is defined in, but it can invoked from outside the package. This is analogous to a "public final" class, which can be used outside of the package but not subclassed. - Brian ------------------------------------------------------- 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