ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: Help needed for representing complex business relationship
Date Fri, 05 Oct 2007 12:03:39 GMT
I'd defer fetching the child objects until needed.

This approach offers two advantages:
 - it is simple on the UI side using swing or AJAX
 - it is simple on the iBATIS side, because you don't have to
configure anything complex

Larry


On 10/5/07, Amol Chaudhari <avchaudhari@gmail.com> wrote:
>
> Hello All,
> We recently started using iBatis. On one of our complex screens we have
> requirement like this:
> the screen is divided into 5 sections. A single section at the top and 2
> sections placed side by side at center and 2 more sections placed side by
> side at the bottom.
>
> The relationship is pretty complex here. The topmost section is kind of a
> summary section and others are detail sections. So if i select some row at
> the top, the LHS middle and LHS bottommost sections will show the details of
> the topmost section's summary values. and the RHS middle and RHS bottommost
> will show the details of the record selected at the respective LHS sections.
> i. e. the topmost section shows the total of some values from the LHS middle
> section and LHS bottommost section.
>
> I am thinking of creating a single Business Object representing the whole
> screen. It will have 2 List member variables, which will be lists of the
> Business objects representing the middle and bottommost sections. i will
> then iterate over both these lists and calculate the total (summary) values
> to be shown in the topmost section.
>
> Now, the issue is this Object will become huge and if i have even thousands
> of rows to be shown in the summary(topmost) section then it will consume
> huge amount of memory. I read something about lazy loading of the objects,
> but i am not very sure about its use in my case, as i need to get the lists
> to calculate the summary values.
>
> Can anyone suggest me a better way to do this?
>
> One of the possible solutions is to separate these objects instead of making
> a composite object. But here i am having another issue. some of the values
> for my business object come from one query. using those values i can get few
> other values from another query and few more from the third query. Now i
> don't know how to set multiple values of my Business object from the other
> queries. I can map a single value to another query but mapping more than one
> is the thing i am stuck at.
>
> Any help will be greatly appreciated.
>
> Regards,
> Amol
> --
> View this message in context: http://www.nabble.com/Help-needed-for-representing-complex-business-relationship-tf4574170.html#a13056406
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message