Re: Re[2]: Barracuda: Patch for IterativeListModel

Stefan Armbruster <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi Jake,

if you're about to move IterativeListModel to the core.comp package, I
would also suggest to do so with
contrib.dbroggisch.display.HashMapModel, of course if Diez expresses +1
on this. These two classes are very powerful to use.

IMHO it would also nice to have a IterativeResultSetModel. The idea is
to have a simple model, that iterates over arbitrary database query. The
constructor takes a java.sql.ResultSet and iterates over this. getItem
is pretty simple to implement, because ResultSet as a getString(String)
method. If desired, I could contribute such a class.

Regards,
Stefan

Am Fre, 2002-12-06 um 21.08 schrieb Jacob Kjome:
> After looking at the IterativeListModel, I've got a couple
> comments....
> 
> I hadn't realized that this was in the contrib package (oversight).  That
> being true, we should be able to modify it to our liking before moving
> it to the core.comp package as suggested by Chistian.  Here are a
> couple things we should think about:
> 
> 1.  Given the javadoc:
>       "Use this class to build IterativeModels bassed on arbitrary Lists.
>        The class will iterate over the List and store the current item
>        in the _current variable."
>     And given that we are modifying "List" to "Collection", maybe
>     this class should be called "IterativeCollectionModel"?
> 
> 2. postIterate() is implemented, but does nothing in
> InterativeListModel.  Seems like it should do some default cleanup
> like nulling the iterator or something.
> 
> 
> Also, why aren't the models in the core.comp.model package?
> Everything gets lumped in the core.comp package.  On that same note,
> it might be nice to put the interface classes in their own package
> separated from the implementations.  Just a thought.  I don't suppose
> that will happen since it would affect all existing Barracuda apps,
> but it might be worth the thought.  We've already done some good
> organization.  Why not some more?
> 
> Jake
> 
> 
> Friday, December 06, 2002, 1:18:07 PM, you wrote:
> 
> CC> I'm +1 on this, and can go ahead an apply the patch, but first I'd like to
> CC> give Diez a change to comment on it before I do (since he actually owns the
> CC> code).
> 
> CC> Diez? Is there any reason not to do this?
> 
> CC> On a slightly different note, is there any reason why we shouldn't move this
> CC> into the core.comp package? I don't see any real dependencies...
> 
> CC> Christian
> CC> ----------------------------------------------
> CC> Christian Cryder [[email protected]]
> CC> Internet Architect, ATMReports.com
> CC> Barracuda - http://barracuda.enhydra.org
> CC> ----------------------------------------------
> CC> "Coffee? I could quit anytime, just not today"
> 
> 
> >> -----Original Message-----
> >> From: [email protected] [mailto:[email protected]]On
> >> Behalf Of Stefan Armbruster
> >> Sent: Friday, December 06, 2002 5:59 AM
> >> To: [email protected]
> >> Subject: Barracuda: Patch for IterativeListModel
> >>
> >>
> >> Hi,
> >>
> >> IterativeListModel uses internally a List. The only operation called
> >> upon this is iterator(). Since List extends Collection, it is sufficient
> >> to use Collection instead of List inside IterativeListModel.
> >> The attached patch solves this.
> >>
> >> There's no need to modify any code that uses IterativeListModel, only a
> >> recompile is necessary.
> >>
> >> The benefit from this is, you can pass e.g. Set to IterativeListModel.
> >>
> >> Regards,
> >> Stefan
> >>
> 
> CC> _______________________________________________
> CC> Barracuda mailing list
> CC> [email protected]
> CC> http://www.enhydra.org/mailman/listinfo.cgi/barracuda
> CC> FAQ - http://www.jguru.com/faq/Barracuda


_______________________________________________
Barracuda mailing list
[email protected]
http://www.enhydra.org/mailman/listinfo.cgi/barracuda
FAQ - http://www.jguru.com/faq/Barracuda
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.