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
>
>