ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: help with ibatis 3 & objectwrapper, metaobject, etc.
Date Thu, 25 Feb 2010 04:44:19 GMT
LOL... sorry I thought that was funny.  :-)

But really, you're really polarizing this discussion with broad criticisms
of how our software is designed.  It's hard to comment on your needs or to
help you.

I'm not exactly sure what you're trying to do, but you're digging pretty
deep into the guts of the system, parts that weren't really intended for
other people to extend or change (or at the very least at your own risk).

So it seems to me that if you have to dig that deep into the core of the
library, it's probably the wrong fit and you'll have an uphill battle and a
poor experience overall.

So rather than criticize our framework because it doesn't do what you need
it to, it might be best if you look for a better fit.  There are others.
Hibernate is one, and yes it's well designed.

As for a friendly community, I can assure you that if you broadly criticize
them because their square peg doesn't fit into the round hole, you'll
probably meet with a similar reaction.


On Wed, Feb 24, 2010 at 9:03 PM, Alexei Sokolov <alexei.sokolov@gmail.com>wrote:

> Not sure what are you trying to say.
> That hibernate has friendly community? Or that they have a better designed
> library?
> -- Alex
> Sent from my mobile
> On Feb 24, 2010, at 7:28 PM, Clinton Begin <clinton.begin@gmail.com>
> wrote:
> Yes, iBATIS has a mechanism that allows you to do what you want to do.
> It's called Hibernate.
> <https://www.hibernate.org/>https://www.hibernate.org/
> Enjoy.
> On Wed, Feb 24, 2010 at 8:11 PM, Alexei Sokolov <<alexei.sokolov@gmail.com>
> alexei.sokolov@gmail.com> wrote:
>> Well, Microsoft Office has Excel, which is a good spreadsheet. Does ibatis
>> has a mechanism that allows me to do what I want to do?
>> If intented use for objectwrapper was scala, why didn't you call it
>> scalaobjectwrapper? Obviously you had other potential uses in mind.
>> BTW, can you point me to some scala examples? Can ibatis map java lists
>> and maps to scala lists and maps?
>> Thanks,
>> -- Alex
>> Sent from my mobile
>> On Feb 24, 2010, at 6:35 PM, Clinton Begin < <clinton.begin@gmail.com>
>> clinton.begin@gmail.com> wrote:
>> What you're trying to do with ObjectWrapper is beyond its intended use. It
>> was never a consideration nor an intention for the ObjectWrapper to
>> instantiate objects.  ObjectWrapper was originally implemented to support
>> Scala types, and perhaps to support a custom property naming convention or
>> some other type (e.g. XML).
>> It was not intended to change or intercept the result object lifecycle or
>> override the result object entirely.
>> You can call it a design problem if you like.  But it's kind of like
>> saying Microsoft Word has a design problem because it isn't a very good
>> spreadsheet.
>> Clinton
>> On Wed, Feb 24, 2010 at 11:11 AM, Alexei Sokolov <<alexei.sokolov@gmail.com><alexei.sokolov@gmail.com>
>> alexei.sokolov@gmail.com> wrote:
>>> Hello everyone,
>>> I'm new here, but either I don't understand ibatis internals or you have
>>> a design problem. First, let me share my understanding of how ibatis handles
>>> mapping of result sets to beans:
>>> In *ResultSetHandler.getRowValue() method you create object instance
>>> using objectfactory. then you create metaobject for it, which in turn
>>> creates objectwrapper for that object instance. Then you use meta object
>>> methods to populate property values on that object instance. During this
>>> process both metaobject and objectwrapper essentially write values directly
>>> to the object instance returned from object factory.
>>> Now, consider this scenario: let's say my object wrapper constructs
>>> intermediate object first and populates its values. Than when I'm done
>>> processing a row, I want to create actual object instance that will be
>>> returned to the client. How do I do this with the current implementation?
>>> Ideally, it will be nice if ObjectWrapper had a method, say
>>> 'getPopulatedInstance()' and then line 179 in
>>> FastResultSetHandler.getRowValue() (and other such places) could be
>>> rewritten like
>>> resultObject = foundValues ?
>>> metaObject.getObjectWrapper().getPopulatedInstance() : null;
>>> instead of
>>> resultObject = foundValues ? resultObject : null;
>>> In other words, it would be nice if objectwrapper is able to create new
>>> instances in addition to being able to work as decorator.
>>> Does it make sense at all?
>>> Thanks,
>>> Alex

View raw message