[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RES: Bare-bones Ruby

Leiradella, Andre V Matos Da Cunha

12/28/2004 1:30:00 PM

> Ruby does not support multiple inheritance but provides a very neat
> way to reuse code: modules. Declaring a module and including it
> automatically makes all the methods available in your classes.

I actually need something similar to Java interfaces, so for example if
someone wants to make his/her object "previewable" inside Moray's preview
windows he/she will have to implement the interface Previewable, and by
doing that he/she will have to implement the method preview that will be
called to construct the object's wire frame.

Multiple inheritance will work for me too, I can raise an exception in
method preview of class Previewable telling the user that this method must
be overridden, but I'd prefer to use interfaces.

I'm also looking at Pike and Ferite, the later have something called
protocol which is, as far as I can tell, exactly the same as Java
interfaces. I'll let you guys know when I make my choice .

Thank you for the info.

Andre de Leiradella