Re: But is it Object-Oriented?

Daniel Bonniot <[email protected]>
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
Isaac Gouy wrote:

>>>>BTW, Java is specified roughly in the same way, and uses the name 
>>>>"compilation units" for "modules".
>>>>        
>>>>
>>>And the significant difference is, of course, that Java doesn't use
>>>a "compilation unit" for encapsulation - Java uses types (classes
>>>and interfaces) for encapsulation. 
>>>
>>>      
>>>
>>Right, but since you are supposed to have only one top-level class
>>per compilation unit, the difference is somewhat blur.
>>    
>>
>
>Which means that the top-level class provides a syntactic boundary for
>the "compilation unit" - no such boundary in Nice.
>  
>
Yes.

We could add a construct for isolating a unit, and then either force 
each "file" to contain units (a la Java, seems redundant) or make each 
file an implicit module, but allow nested modules (a la ocaml).

>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?
>  
>
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 
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.

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.