My mistake, I was talking about ListView instead of TableView.
Another thought, ListView should not implement List interface? basically
a ListView/TableView are lists with an extra graphics support.
In that case, operations like add/remove/update over the list could be,
additionally, executed directly through ListView or the listit self
(data driven)
-A
El lun, 24-01-2011 a las 16:25 -0400, Alejandro Vilar escribió:
> Hi,
> I don't catch where or why the anonymous type is required. Why not just
> use:
>
> private List listData;
>
> public List getListData();
> public void setListData(List listData);
>
>
> Or:
>
> public class TableView<T>{
>
> private List<T> listData;
>
> public List<T> getListData();
> public void setListData(List<T> listData);
>
> public T getSelectedItem();
> public T setSelectedItem(T item);
> }
>
>
> Cheers,
> -Alejandro
>
> El lun, 24-01-2011 a las 07:54 -0500, Greg Brown escribió:
> > > Definitely, if there is no specific reason to use anonymous type, it
> > > would be better(easy for use) if getListData() (and other similar
> > > methods) returns List<Object>.
> > > (also anonymous type should be avoided unless it is required. Java's
> > > anonymous type is confusing)
> >
> > It is required for the setter. If setListData() took a List<Object>, you
> > would not be able to pass a List<Foo> to it. But for the getter, I think
> > returning List<Object> should be fine.
> >
> > Anyone else want to comment?
> >
> > G
> >
> >
>
>