i mean more that maybe there are 1% that i can think of.
And still it is still pretty useable..
you just cant use generics for that case:
IDataProvider<Object> my = new IDataProvider<Object>()
{
private static final long serialVersionUID = 1L;
public void detach()
{
}
public int size()
{
return 0;
}
public IModel<Object> model(Object object)
{
Integer integer = (Integer)object;
return new YourModel<Object>(integer.toString());
}
public Iterator< ? extends Object> iterator(int first, int
count)
{
ArrayList<Integer> al = new ArrayList<Integer>();
return al.iterator();
}
};
works fine.
We dont discuss upfront all the kind of components what and how they should
be generified.
Many where done in 1 go and then see where it ends up by havinga few
Milestone builds where people can play with.
johan
On Wed, Apr 23, 2008 at 11:45 AM, Vitaly Tsaplin <[EMAIL PROTECTED]>
wrote:
> Hi people,
>
> My code is also suffering. I would vote for adding the second
> generic parameter.
>
> "then everbody has to create an iterator with 2 and 90+% of the cases it"
>
> 10% is a lot...
> By the way... the generification of IDataProvider... was it the one
> person decision or it was discussed somehow?
>
> Vitaly
>
> On Wed, Apr 23, 2008 at 11:26 AM, Sebastiaan van Erk
> <[EMAIL PROTECTED]> wrote:
> >
> > Jan Kriesten wrote:
> >
> > >
> > > Hi Johan,
> > >
> > >
> > > > But how do you cache those objects?
> > > > Are those cached over all request so pretty much readonly ?
> > > >
> > >
> > > yes, they are.
> > >
> > > caching (and also marking as dirty) of objects is encapsulated within
> the
> > dao -
> > > so i do not have to worry much about this.
> > >
> > > also, IDataProvider isn't supposed to work only for Databases, right?
> > suppose
> > > the following (which i actually also have): i get a list of
> rssfeed-urls
> > from
> > > the database and within model i retrieve them - that's called
> 'separation
> > of
> > > concerns' which is also good programming style.
> > >
> >
> > I'd still say that's a data provider which provides rss feeds not rss
> feed
> > URLs. The fact that you want to retrieve them lazily seems an
> implementation
> > detail to me, not something which should go in the interface of
> > IDataProvider.
> >
> > Regards,
> > Sebastiaan
> >
> >
> > > best regards, --- jan.
> > >
> > >
> >
>