ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trenton D. Adams" <tre...@athabascau.ca>
Subject Re: Request for input on porting iBatis XML from 2.x to 3.0
Date Wed, 19 Aug 2009 05:02:35 GMT
Hi Clinton,

----- "Clinton Begin" <clinton.begin@gmail.com> wrote:

> From: "Clinton Begin" <clinton.begin@gmail.com>
> To: user-java@ibatis.apache.org, "Trenton D. Adams" <trenta@athabascau.ca>
> Sent: Tuesday, August 18, 2009 6:13:01 PM GMT -07:00 US/Canada Mountain
> Subject: Re: Request for input on porting iBatis XML from 2.x to 3.0
>
> Thanks Trenton... That's exactly how iBATIS 1 > 2 worked.  But then I
> swore I'd never write XSLT again.  :-)  That said, if you have it,
> that is awesome.
> 
> The approach we're looking at would be a ConfigurationWriter that
> took
> an instance of Configuration and wrote out the XML files.  That way
> you could more easily handle the edge cases that require logic that's
> difficult to implement in XSLT... like some of the dynamic SQL
> changes, and the type aliases that need to be rolled up into the
> configuration file, etc.

XSLT has functionality that allows you to call methods from the language you are using (Java
in our case *grin*).  In the case where there is data inside of an XML element, that is not
XML itself, you can just pass that to the Java code.  That's one of the benefits of XSL. 
It allows a mix of Java (or other languages you run it from) and XSL.  The XSL would then
control the flow of conversion, but some Java code could run that does other stuff.  Presumably
(not knowing the internals of iBatis), you could pass the element contents to existing methods
that iBatis has for dealing with that data, to strip it out into iBatis data structures, POJOs,
or whatever iBatis does internally.  From there, you could then have the new iBatis 3.0 code
spit out whatever it wants, into a string, and give it back to the XSL.

So, I would think the easiest way (again, without knowing iBatis internals) would be to write
this "ConfigurationWriter" as you say, partly with XSLT.  I'm assuming this is some sort of
iBatis abstraction/interface, or something like that, that, well, writes configuration files,
hehe?  Or is this a new concept that you came up with on the fly?

I haven't had time to follow here, as I'm trying to wrap up some work before I go on 6 months
research and study leave, of which iBatis is designated as part of my research.  So, when
is this 3.0 expected to be ready do you think?

Also, XSL isn't that bad (though I understand your initial pain, lol), unless you don't have
a good reference. ;)  It's a bit annoying at the beginning, because the syntax learning curve
is a bit of a pain.  But, once you're into it, you're into it for good.  I recently did a
huge amount of work with XSL at my workplace.  I fell in love, to say the least.  And, as
you know, a lot of times it's easier to learn something when you have a starting point, with
a working project for example.  So, if this XSL ConfigurationWriter was written, you would
probably not have a problem understanding it.  As I said, it's really the syntax that gets
you.

One last thing about XSLT, is it makes your DOMs pain go away, muhahahahaha (http://en.wikipedia.org/wiki/Delayed_onset_muscle_soreness).
 Seriously though, all that DOM code you have to work with, just disappears, and believe me,
you are probably having a lot more pain with that, but just don't realize it. ;)  I started
to write straight DOM code with my last project, and switched to XSLT within minutes of messing
around, though I did have some XSLT experience previously.

Okay, the rant is complete.  Gotta hit the sack, I have a lot of work to do before September,
when my leave starts.

> 
> Any and all ideas and implementations are welcome here though.  I'm
> not sure I'll have time to write the ConfigurationWriter any time
> soon.
> 
> Clinton
> 
> On Tue, Aug 18, 2009 at 4:10 PM, Trenton D.
> Adams<trenta@athabascau.ca> wrote:
> > Why not just use an XSL to convert it?
> >
> > I've attached one that I use now and then, to spit out full SQL from
> a bunch
> > of fragments, as well as output bean code.
> >
> > Trenton D. Adams
> > Systems Analyst/Web Software Engineer
> > Navy Penguins at your service!
> > Athabasca University
> > (780) 675-6195
> > :wq!
> >
> > ----- "Nathan Maves" <nathan.maves@gmail.com> wrote:
> >> From: "Nathan Maves" <nathan.maves@gmail.com>
> >> To: user-java@ibatis.apache.org, "larry meadors"
> <larry.meadors@gmail.com>
> >> Sent: Tuesday, August 18, 2009 4:04:46 PM GMT -07:00 US/Canada
> Mountain
> >> Subject: Re: Request for input on porting iBatis XML from 2.x to
> 3.0
> >>
> >> We actually already started the talks on how to automate this.  We
> did
> >> this for the last major upgrade and it was a huge help.
> >>
> > Thanks again for your notes.
> >>
> >>
> >> On Tue, Aug 18, 2009 at 3:49 PM, Larry Meadors
> <larry.meadors@gmail.com>
> >> wrote:
> >>
> >>
> >> Thanks for sharing!
> >> >
> >> > You rock.
> >> >
> >> > Larry
> >> >
> >> >
> >> >
> >> > On Tue, Aug 18, 2009 at 3:20 PM, Joel
> >> > Barciauskas<JBarciauskas@nexaweb.com> wrote:
> >> > > Hey everyone,
> >> > >
> >> > >
> >> > >
> >> > > I just posted the notes that I took as I worked on porting my
> 2.x XML
> >> > > mapping and configuration files to the wiki:
> >> > >
> >> > >
> http://opensource.atlassian.com/confluence/oss/display/IBATIS/Porting+sqlMapConfig+and+sqlMap+XML+from+2.x+to+3.0
> >> > >
> >> > >
> >> > >
> >> > > I canceled the port part-way through since I didn’t think I’d
> be able
> >> > > to
> >> > > finish and test it in a reasonable amount of time for my
> current
> >> > > project,
> >> > > but I thought the notes that I took might be useful for
> bootstrapping
> >> > > some
> >> > > documentation, so I went ahead and created this page.  If you
> are
> >> > > familiar
> >> > > with the 3.0 schema, please review it, as I am sure there are
> items
> >> > > that are
> >> > > incorrect.
> >> > >
> >> > >
> >> > >
> >> > > Hope someone finds this of value!
> >> > >
> >> > >
> >> > >
> >> > > __________________________________________________________
> >> > > Joel Barciauskas | Technical Consultant
> >> > > Nexaweb Technologies | www.nexaweb.com
> >> > > 781.345.5428 o | 617.899.8273 m
> >> > > Skype™: jbarciauskas
> >> > >
> >> > >
> >> > >
> >> > >
> >> >
> >> >
> >>
> ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> >> > For additional commands, e-mail:
> user-java-help@ibatis.apache.org
> >> >
> >> >
> >
> >>
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> > For additional commands, e-mail: user-java-help@ibatis.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org

__ 
    This communication is intended for the use of the recipient to whom it
    is addressed, and may contain confidential, personal, and or privileged
    information. Please contact us immediately if you are not the intended
    recipient of this communication, and do not copy, distribute, or take
    action relying on it. Any communications received in error, or
    subsequent reply, should be deleted or destroyed.
---

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