ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davide Marche <ja...@email.it>
Subject Re: [VOTE] Deprecate queryForObject ("statement", paramObject, resultObject)
Date Mon, 06 Nov 2006 07:46:16 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
+1<br>
<br>
I believe that ResultObjectFactory is much better (as described), and
it is something we were looking for time ago.<br>
<br>
Davide Marche<br>
<br>
Jeff Butler ha scritto:
<blockquote
 cite="midc593b8750611050749l594b378nd77e821f02b91dbd@mail.gmail.com"
 type="cite">
  <div>+1</div>
  <div>&nbsp;</div>
  <div>Jeff Butler<br>
  <br>
&nbsp;</div>
  <div><span class="gmail_quote">On 11/5/06, <b
 class="gmail_sendername">Clinton Begin</b> &lt;<a
 href="mailto:clinton.begin@gmail.com">clinton.begin@gmail.com</a>&gt;
wrote:</span>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left:
1ex;">Hi
all,<br>
    <br>
One more deprecation request before 2.3.<br>
    <br>
The version of queryForObject that takes both a parameterObject and a
resultObject strikes me as both confusing and unecessary.&nbsp; Originally I
implemented it for two reasons: <br>
    <br>
    <ul>
      <li><span style="font-weight: bold;">Performance.&nbsp; </span>To
avoid instantiating an instance per row.&nbsp; This is not a concern
anymore, as class instantiation in modern JVMs is practically cost free
-- at least when compared to the SQL Statement being executed in the
same line of code! <br>
      </li>
      <li><span style="font-weight: bold;">Instance lifecycle
management.&nbsp; <span style="font-weight: bold;"></span></span>This
allowed you to instantiate your classes as you saw fit, then pass them
to the query to be further populated.&nbsp; Unfortunately, this approach is
inconsistent.&nbsp; It's inconsistent in that this only works for single row
cases (queryForObject).&nbsp; When querying a list, you don't have the
option of providing a list of pre-allocated objects (which would be
silly).&nbsp; The new ResultObjectFactory feature takes care of the need to
more closely manage the lifecycle of result objects.&nbsp; So this feature
is unecessary. </li>
      <li><span style="font-weight: bold;">Caching behaviour.&nbsp; </span>When
dealing with cached instances, the cached instance may be returned
instead of the resultObject you've passed in (as per Brandon's JIRA
entry). <br>
      </li>
    </ul>
So if you agree with the above, I'll deprecate this method signature
for the 2.3 release.&nbsp; <br>
    <br>
User Note:&nbsp; Deprecation will only generate a warning, it will not break
existing code or stop you from using it.&nbsp; We just strongly recommend
against it. <br>
    <br>
Please offer your +1/-1 vote!<br>
    <br>
Thanks much,<br>
    <span class="sg"><br>
Clinton<br>
    </span></blockquote>
  </div>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.13.28/518 - Release Date: 04/11/2006 17.30
  </pre>
</blockquote>
<br>
</body>
</html>

Mime
View raw message