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">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
I believe that ResultObjectFactory is much better (as described), and
it is something we were looking for time ago.<br>
Davide Marche<br>
Jeff Butler ha scritto:
  <div>Jeff Butler<br>
  <div><span class="gmail_quote">On 11/5/06, <b
 class="gmail_sendername">Clinton Begin</b> &lt;<a
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left:
One more deprecation request before 2.3.<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>
      <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><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>
So if you agree with the above, I'll deprecate this method signature
for the 2.3 release.&nbsp; <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>
Please offer your +1/-1 vote!<br>
Thanks much,<br>
    <span class="sg"><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

View raw message