Inline answer:

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Geir Magnusson Jr.
> 
> Paulo Gaspar wrote:
> > 
> > I still like it. It solves big problems like mine -> loads of 
> data. It can
> > save a lot of resources.
> 
> There still may be a solution that you as a talented Java programmer
> could employ w/o doing something that I  am *sure* will bewilder and
> confuse people.
>  
> Or not.  Understand that I understand your issue.
> 
> > Look:
> >  1 - The programmer implementing the Iterator and placing it in 
> the Context,
> >      MUST know what an Iterator is.
> 
> I am not 100% sure of that. :)

Man! Do we have to baby-sit those? 
At least we would give them an opportunity to learn!
=;o)

> 
> >      And he can implement a reset method
> >      usable in the template anyway - it will still be an Iterator
> >      implementation. What you point out is an Application issue, not a
> >      library one;
> >      =:o)
> 
> 
> The point is not that there is some taboo about the iterator itself -
> the question is how can we avoid the problem noted, that if it's an
> Iterator placed into the context, someone is going to run aground.
> 
> <self-loathing>
> Would it be worth it to consider defining an interface like
> 
> public interface VelIterator extends Iterator
> {
>       public boolean reset();
> }
> 
> so you can wrap your Iterator, but then there are no surprises re
> reset()?  Foreach or any other looping contruct that may come down the
> pike will call it after use, and if you are doing something 'special',
> like working with a foward only RS, then so be it.  You are at least
> consciously making reset() do nothing...
> 
> </self-loathing>

Playing Devil Advocate again!

But then you break one of (your) golden rules by placing in the framework 
something that should belong to the application level.

(Even if a VelIteratorSimpleWraper class makes it simple to use standard 
Iterators.)


> >  2 - It is _major_ pain to implement a Map or a Collection, but 
> so easy to
> >      implement an Iterator;
> >  3 - Some Iterators (like over some performant forward only ResultSets)
> >      naturally can not be reset. They are still damn useful.
> 
> Right - I understand that the clueful of the world won't have a
> problem.  I am worried about those that don't realize the problems they
> will run into.  I am generally not a hand-holder, but we are trying to
> make a simple, clean tool targeted towards simplicity for the designer,
> a different skill set than the programmer.  Yes, a programmer has to be
> involved, but I am wondering how long it will be before someone puts
> together a scriptable servlet where a designer can toss premade beans
> into the context via external script/xml, etc, etc, etc...

Well, from where I come they say:
 - Don't dress like a wolf if you aren't one.

 
> We can certainly support it.  I would almost be rude not to.  Maybe the
> way to go is to holler and scream into the log when we run across a
> naked Iterator....

Yeah! On warning level!

> > Maybe I really need plugable introspection.
> 
> You certainly need something...

...and I hope to get it here, since I don't get scared looking at Velocity
source code. (But I sure do when looking at WM's.)

 
And keep having fun,
=:o)

Paulo

Reply via email to