Re: Nice Interfaces == Traits ?
Daniel Bonniot <[email protected]>
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
>>I'm not sure the term "trait" is well known outside of the circle of >>language researchers (like you ;-), nor that it conveys an evident >>meaning. So most people would have to learn what a trait is and to >>keep remembering using it instead of interface. >> >> > >I agree - they'd know straight away that this is a new thing they need >to learn about, rather than the ubiquitous specification-only thing. > > Only you do not need to learn anything to start using interfaces in Nice. It just happens that you can do more things with them than you can with Java interfaces. BTW, this shows that traits are not the same as Nice interfaces, since if I recall right they cannot be part of a hierarchy. >>On the other hand, it is not hard to explain that among the >>advantages of multi-methods (declaring new methods on existing >>classes, specializing on all arguments) there is also the ability to >>implement a method for an interface. Simple, no? >> >> > >I'm not sure multimethods are well known outside of the circle of >language researchers ;-) > > Sure. So we need to document them, including how they can be specialized on interfaces. >>I would find it awkward to change the name of interfaces just because >>of this fact, because it has nothing to do with interfaces >>themselves, it has to do with the flexibility of multi-methods. >> >> > >The idee fixe is that interfaces are only declaration. > > I don't think you define something by what it is not. That's actually quite contrary the idea of OO, since you always keep the option to add features (in subclasses). For instance, you cannot say that a Point is something that does not have a color, since it might actually be a ColoredPoint. So I think the defining aspect of interfaces is that one can implement multiply from them. It happens that in Java one cannot implement methods inside interfaces, but that's a limitation (which is there to simplify the implementation of multiple implementation), not a feature. >That's a helpful analogy. Many of the comments I make about Nice >probably have some grounding in a guess about how much we'll have to do >when making code changes - because so much more effort goes into making >code changes then into designing a hierarchy anew. > > That's a valid concern. Daniel ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn