ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Pita <carlosjosep...@gmail.com>
Subject Unconstrained signature interface mappers for ibatis 3
Date Sun, 30 Aug 2009 08:37:29 GMT
Hi all,

now that ibatis 3 supports type-safe mapper interfaces that make a
nice interface to the repository/dao tier, it would be desirable to
allow for multiple parameters to be passed, so that application
designers would not be constrained while designing their layer
interfaces. For example, I would prefer:

List<User> findCommonFriends(User user1, User user2)

instead of

List<User> findCommonFriends(Map<String,User> users)

or

List<User> findCommonFriends(UserPair users)

It just requires a trivial modification in MapperMethod and a simple
mechanism to access positional parameters to get it working. For
example, MapperMethod could create a Map and put the first argument
under the key "first", the second one under "second", etc. That is,
positional access "by name". Of course, in case the number of
arguments were only one, the usual mechanism would follow.

What do you think? Personally I belive that this very simple change
will add some degrees of freedom to interface designers.

Best regards
--
Carlos

---------------------------------------------------------------------
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