From: Stewart T. <wsr...@ho...> - 2005-04-18 08:18:06
|
Brett, In my opinion, this change is a backwards step. The main purpose for using interfaces for all argument and return types is to allow objects of new classes that implement the interface to passed in to existing methods. To take your example of java.util.List. If you examine all of its methods, *every* parameter and return type (with the exception of Object) is an interface. Many of the arguments are Collection which is the parent interface for List. Object of course can be anything anyway! :-) To give you another example, take a look at the Collections utility class (java.util.Collections), many of the methods take or return List, and again with the exeception of Object, all of the myriad of arguments and return types are interfaces. regards Stewart >From: Brett <wak...@ea...> >Reply-To: rai...@li... >To: rails-devel <rai...@li...> >Subject: [Rails-devel] Interfaces in method signatures >Date: Sun, 17 Apr 2005 20:48:24 -0700 > >The other change I've committed tonight that seemed good to dedicate a >separate e-mail toward is this: > >I've removed the usage of interfaces as arguments or return types as >much as possible. > >My reasoning is this: Interfaces are not real objects and therefore >should only be mentioned when real objects are implementing an >interface. The real objects implementing the interface ought to be the >arguments and return types of methods. > >Take a look at the interfaces in the Java API, List is a good one, and >you'll notice that an interface is never an argument or a return type. > > > >---Brett. > >One good turn deserves another. -- Gaius Petronius > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Rails-devel mailing list >Rai...@li... >https://lists.sourceforge.net/lists/listinfo/rails-devel |