pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alejandro Vilar <alejandro.vi...@synacom.com.bo>
Subject Re: why ListButton.getListData returns List<?> ?
Date Mon, 24 Jan 2011 20:25:10 GMT
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
> 
> 



Mime
View raw message