ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Overloading Mappers
Date Mon, 24 Aug 2009 13:43:29 GMT
No!  :-)

Outside of iBATIS, I've always recommended avoiding method overloading (ad
hoc polymorphism).  It's just a bad practice.  The method is likely doing
something different, so give it a good name.

On rare occasions it makes some sense, like say before Object wrappers,
having .valueOf() overloaded for each of the primitives was okay (but still
a design flaw due to Java's primitive types).

But most DAO methods aren't like that.  They do something specific, so the
name should reflect that.

Clinton

On Mon, Aug 24, 2009 at 7:05 AM, Richard Bibb <richard.bibb@aimhedge.com>wrote:

>
> Does iBatis 3.0 allow for overloaded mapper definitions? e.g
>
> public interface egMapper {
>        ArrayList<DataSet> exampleMapper(SomeClass args);
>        ArrayList<DataSet> exampleMapper(AnotherClass args);
> }
>
> Obviously the XML file is going to need to understand the difference...
> --
> View this message in context:
> http://www.nabble.com/Overloading-Mappers-tp25115777p25115777.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

Mime
View raw message