Java's modules rock? (was Re: election details)

stephane ducasse stephane.ducasse at free.fr
Fri Mar 2 07:55:12 UTC 2007


>
>> The other thing that
>> would make extension safe is a copy on write semantic with class
>> wherein extensions to classes that are not local to your namespace
>> result in a new class with the same name in your namespace being
>> created that derives from the class in the parent namespace.  Thus,
>> your mods are kept local to your context.  It does make class binding
>> harder as class names have to be resolved dynamically in the methods
>> that reference them.
>
> That's harder.
>
> How do you plan to make sure that instances of the original class have
> their method lookup redefined automatically? Say for example that you
> redefine a method in Object - how would you make sure that a String
> literal in your code would have your redefined method in it's
> superclass hierarchy?
>
> Personally, I don't think it's ever necessary to redefine methods in
> "System" objects such as Object, Collection or String. Other
> programming languages manage fine without being able to do this.

Really? I thought you mean redefine and you could be right bt below  
you mean addition.

Have you seen how Swing is build and the Math library of number in Java
just because they cannot do class extension. I think that class  
extensions are really good
to make smooth integration (cf. the acacongua excellent unit  
frameworks).

> Methods like String>>isURL don't belong in the String class! That
> should be URL class>>isURL:. Object>>asMorph should be Morph
> class>>fromObject:, and so forth.

Thanks but these are not about **redefinition**
Apparently you confuse class extension addition and class extension  
redefinition.
We could have one without the other.

May be you should read, because it presents selector namespace which  
can be a sensible solution
to the problem that andreas points. But Smalltalker have been facing  
that since already two decades.

http://www.iam.unibe.ch/~scg/Archive/Papers/Berg05cModuleDiversity.pdf





More information about the Squeak-dev mailing list