From: Jamis Buck Date: 2004-11-12T03:07:14+09:00 Subject: Re: Thinking About Java Interfaces In Ruby Austin Ziegler wrote: > On Fri, 12 Nov 2004 00:19:28 +0900, James Edward Gray II > wrote: > >>You don't really just say, "Pass in an object that responds to X, >>Y, and Z." in the RDoc, do you? > > > Yes, indeed, I do. If I want something that responds to #<<, I'll > say that. > > The only reason I really see for having interface hinting is > automatic cross-language interface discovery (e.g., SOAP, CORBA, > etc.). This way, you can simply say "this class is available for > SOAP manipulation" and SOAP can discover what it expects. > > I haven't missed interfaces in the way that they are required for > less dynamic languages. > > -austin I'm completely with Austin on this. I do the same thing: "this method requires a method that responds to #foo". It has served me well enough. The *only* time I've thought interfaces would be nice is when I considered finding a way to implement type 1 inversion of control. This is where a service just says "I need another service that implements this interface" and the container goes and finds one that matches. Even then, I was only thinking it would be neat to implement for the "gee-whiz" value, not because I actually needed that feature. -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis