Hi,

I am preparing a patch to o.a.t.util.LargeSelect to make it actually work
for paging query result sets.

I pretty much have this working now (under turbine 2.1), but I am after some
advice about the best way to implement a particular aspect of the solution
(before I bring it forward to torque 3).  I guess this is really a Java as
opposed to a torque question, but as it relates to torque development I
think I can get away with calling it on topic ;-)

Here are the details:

The LargeSelect constructors accept a Criteria object to define the data
that is to be retrieved from the database.  In its existing (broken, never
used, never tested) form the nextResults() and previousResults() methods of
LargeSelect return a List of village Records that you would then need to
pass through something like the populateObjects() method provided in the
Peer classes to convert the Records to the desired class.

I want to extend this to allow:
1. Easy use of LargeSelect directly from templates.  This involves
performing the necessary translation from village Records to some other
class from within the LargeSelect.
2. Cater for use of OM Peer classes and non-OM Peer classes in this capacity
- i.e. Capitalise on the existing Peer code that does the translation and
make it easy for non-OM Peer classes to implement the same.
3. Functionality similar to that provided by the addSelectColumns() method
provided by the peer classes is also desirable as it is currently necessary
to do this manually before passing the Criteria to the LargeSelect
constructor and it would simplify things to require any non-OM Peer class to
implement these.

I was thinking of defining an interface that includes the necessary methods
to do these things from the Peer classes however this comes unstuck because
all of the methods involved are static.  I there a design pattern applicable
here that I am not seeing?  Can you suggest to me a good OO way to achieve
this?

Now that I have it working, LargeSelect is really excellent and I am looking
forward to contributing the expanded and functional version.  I would
however prefer to add the functionality mentioned above in the best possible
way before I do this.

Thanks,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
Web: http://www.backstagetech.com.au



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to