Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 8590 invoked from network); 20 Oct 2005 03:50:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Oct 2005 03:50:21 -0000 Received: (qmail 77552 invoked by uid 500); 20 Oct 2005 03:50:20 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 77351 invoked by uid 500); 20 Oct 2005 03:50:19 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 77339 invoked by uid 99); 20 Oct 2005 03:50:19 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2005 20:50:19 -0700 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=HTML_10_20,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jeffgbutler@gmail.com designates 64.233.162.193 as permitted sender) Received: from [64.233.162.193] (HELO zproxy.gmail.com) (64.233.162.193) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2005 20:50:18 -0700 Received: by zproxy.gmail.com with SMTP id z6so153562nzd for ; Wed, 19 Oct 2005 20:49:57 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=dJ6/bNRlvk0Ww2P/tyosrp1W1CqwAVjzWwWjZwQJVlr0MetJB7sao93dJsJn8fQIysvgazJbHzpIcSC7QmQwDsKrd8L5lyk95R3/UmVxav32nvnZ7D+07bqO/oyZk4UxOn6y+bPbks6lywA4Wx+BsvMlsNMQgc8WSDiLsBlV7fM= Received: by 10.37.18.78 with SMTP id v78mr1433381nzi; Wed, 19 Oct 2005 20:49:57 -0700 (PDT) Received: by 10.36.252.52 with HTTP; Wed, 19 Oct 2005 20:49:57 -0700 (PDT) Message-ID: Date: Wed, 19 Oct 2005 22:49:57 -0500 From: Jeff Butler To: user-java@ibatis.apache.org Subject: Re: Request to change access modifiers In-Reply-To: <20051019222019.78128.qmail@web35706.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6907_2559027.1129780197087" References: <20051019222019.78128.qmail@web35706.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_6907_2559027.1129780197087 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Jeff! The Cards forgot how to bat AGAIN in the post series :-( Your request sounds reasonable to me. Please make a JIRA enhancement request with the details of what should change from private to protected, then we'll remember to get to it (maybe someone should take a look at this in general?) As for the extension, I'm not sure what the proper procedure is - maybe on= e of the other committers can comment. The list does not allow attachments. I= f there is interest from the community, you could attach the sample code to another JIRA issue - or distribute it informally. Jeff Butler On 10/19/05, Jeff Roberts wrote: > > I have recently added and extension to the iBatis > framework. In order for my extension to work > effectively, I had to subclass several of the iBatis > classes. In doing so, I found that some of the > methods and variables in the iBatis classes were > declared as private, preventing me access to them from > my subclasses. > > I changed the following access modifiers in the > following iBatis classes: > > - com.ibatis.sqlmap.client.SqlMapClient > I changed the default constructor from private to > protected. This still prevents public instantiation > of the class, but allows me to instantiate my > subclass. > > - > com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser > I changed the static variable "parser" from private to > protected. This allows me to access the parser from > my subclass. > > I also changed the addSqlMapNodelets() method from > private to protected, allowing me to override it in my > subclass and extend its behavior. > > - com.ibatis.sqlmap.engine.builder.xml.SqlMapParser > I changed the static variable "parser" from private to > protected. This allows me to access the parser from > my subclass. > > I also changed the addStatementNodelets() method from > private to protected, allowing me to override it in my > subclass and extend its behavior. > > - com.ibatis.sqlmap.engine.impl.SqlMapClientImpl > I changed the variable "localSqlMapSession" from > private to protected, allowing my subclass to access > it. > > I also changed the getLocalSqlMapSession() from > private to protected, allowing me to override it in my > subclass and extend its behavior. > > - com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate > I changed the variable "sqlExecutor" from private to > protected, allowing my subclass to access it. > > I also changed the autoEndTransaction(), > autoCommitTransaction() and autoStartTransaction() > methods from private to protected, allowing my > subclass to invoke them. > > I would like to request that the iBatis development > team make these same changes to the iBatis source > code. In my view, it doesn't change any behavior or > introduce any changes to the source code other than to > make key pieces of the code accessible to subclasses. > By making these changes, I can implement an extension > to iBatis by subclassing the classes I've mentioned > above and providing an additional feature. > > To help bolster my case, I would like to describe my > extension. I would be happy to submit my extension to > the iBatis development team for inclusion into the > framework or as a third party extension. If neither > is desired, I'm happy to use the extension for my own > use. > > The extension that I have created is to provide an > alternate mechanism for returning XML as a result of a > query. While I realize iBatis already provides > support for XML, this extension is different. My > understanding is that iBatis can return an XML > document (DOM) from a result set. This is adequate if > you wish to use the DOM within the application. My > extension returns a java.io.InputStream subclass, > which is a stream of XML derived from a result set. > The stream is dynamically produced as the InputStream > is read. This allows you to simply stream it out to a > caller or run it through an XSLT transformation on the > server or on the client. It uses SAX callbacks and > therefore minimizes the memory requirements and can > handle a virtually unlimited size result set since the > results are streamed. I've also included support for > skipping and max results as is the case when querying > for lists in iBatis. The extension does not require > anything special in the SELECT statement declaration. > You can use any select statement for queryForObject, > queryForList or queryForXml (my extension method). It > works within the context of the iBatis transaction > model. > > I can attach the source code I've changed in iBatis if > that helps. I can also provide additional examples or > explanation of the extension if that would help. > > As I just joined the mailing list, I'm not sure what > my next step should be. I assume someone will respond > to this request. > > Thank you, > Jeff Roberts > > P.S. If Jeff Butler reads this, I'm the Jeff Roberts > you know from St. Louis. > > > > > __________________________________ > Yahoo! Mail - PC Magazine Editors' Choice 2005 > http://mail.yahoo.com > ------=_Part_6907_2559027.1129780197087 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi Jeff!
 
The Cards forgot how to bat AGAIN in the post series :-(
 
Your request sounds reasonable to me.  Please make a JI= RA enhancement request with the details of what should change from private = to protected, then we'll remember to get to it (maybe someone should take a= look at this in general?)
 
As for the extension, I'm not sure what the proper procedure is - mayb= e one of the other committers can comment.  The list does not all= ow attachments.  If there is interest from the community, you could at= tach the sample code to another JIRA issue - or distribute it informally.
 
Jeff Butler

 
On 10/19/05, Jeff Roberts <jeff= _roberts_ibatis@yahoo.com> wrote:
I have recently added and extens= ion to the iBatis
framework.  In order for my extension to wor= k
effectively, I had to subclass several of the iBatis
classes.  In doing so, I found that some of the
methods an= d variables in the iBatis classes were
declared as private, preventing m= e access to them from
my subclasses.

I changed the following acce= ss modifiers in the
following iBatis classes:

- com.ibatis.sqlmap.client.SqlMapClien= t
I changed the default constructor from private to
protected. &= nbsp;This still prevents public instantiation
of the class, but allows m= e to instantiate my
subclass.

-
com.ibatis.sqlmap.engine.builder.xml.SqlMapConfig= Parser
I changed the static variable "parser" from private to<= br>protected.  This allows me to access the parser from
my sub= class.

I also changed the addSqlMapNodelets() method from
private to pr= otected, allowing me to override it in my
subclass and extend its behavi= or.

- com.ibatis.sqlmap.engine.builder.xml.SqlMapParser
I changed= the static variable "parser" from private to
protected.  This allows me to access the parser from
my su= bclass.

I also changed the addStatementNodelets() method from
pri= vate to protected, allowing me to override it in my
subclass and extend = its behavior.

- com.ibatis.sqlmap.engine.impl.SqlMapClientImpl
I changed the v= ariable "localSqlMapSession" from
private to protected, allowi= ng my subclass to access
it.

I also changed the getLocalSqlMapSes= sion() from
private to protected, allowing me to override it in my
subclass and = extend its behavior.

- com.ibatis.sqlmap.engine.impl.SqlMapExecutorD= elegate
I changed the variable "sqlExecutor" from private to
protected, allowing my subclass to access it.

I also changed the= autoEndTransaction(),
autoCommitTransaction() and autoStartTransaction(= )
methods from private to protected, allowing my
subclass to invoke t= hem.

I would like to request that the iBatis development
team make th= ese same changes to the iBatis source
code.  In my view, it do= esn't change any behavior or
introduce any changes to the source code ot= her than to
make key pieces of the code accessible to subclasses.
By making thes= e changes, I can implement an extension
to iBatis by subclassing the cla= sses I've mentioned
above and providing an additional feature.

To help bolster my case, I would like to describe my
extension. &nb= sp;I would be happy to submit my extension to
the iBatis development tea= m for inclusion into the
framework or as a third party extension. &= nbsp;If neither
is desired, I'm happy to use the extension for my own
use.

The ex= tension that I have created is to provide an
alternate mechanism for ret= urning XML as a result of a
query.  While I realize iBatis alr= eady provides
support for XML, this extension is different.  My
understa= nding is that iBatis can return an XML
document (DOM) from a result set.=   This is adequate if
you wish to use the DOM within the appli= cation.  My
extension returns a=20 java.io.InputStream subclass,
which is a stream of XML derived from a re= sult set.
The stream is dynamically produced as the InputStream
is re= ad.  This allows you to simply stream it out to a
caller or ru= n it through an XSLT transformation on the
server or on the client.  It uses SAX callbacks and
theref= ore minimizes the memory requirements and can
handle a virtually unlimit= ed size result set since the
results are streamed.  I've also = included support for
skipping and max results as is the case when querying
for lists in i= Batis.  The extension does not require
anything special in the= SELECT statement declaration.
You can use any select statement for quer= yForObject,
queryForList or queryForXml (my extension method).  It
wor= ks within the context of the iBatis transaction
model.

I can atta= ch the source code I've changed in iBatis if
that helps.  I ca= n also provide additional examples or
explanation of the extension if that would help.

As I just joine= d the mailing list, I'm not sure what
my next step should be.  = ;I assume someone will respond
to this request.

Thank you,
Jef= f Roberts

P.S.  If Jeff Butler reads this, I'm the Jeff Roberts
= you know from St. Louis.




_______________________________= ___
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

------=_Part_6907_2559027.1129780197087--