pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: why ListButton.getListData returns List<?> ?
Date Wed, 26 Jan 2011 00:26:58 GMT
> If the generic is something essential in the modeling, this type of cast issue may be
> But the use of anonymous type is just to accept some List<*> class as the setter
> We may set different List<A.>, List<B> to the same instance of A, also we
may add any type of object.
> A is designed to hold just List<Object>.
> If we consider this way, enforced cast is very technical thing, should be avoided.

The view classes (ListView, TableView, TreeView, etc.) do not impose a type requirement on
their data - it is intentionally left to the caller. The platform provides default types like
ListItem and TreeNode, but these are not required - the caller can use any type of object
as a list item, or table row, or tree node. As a result, casting is required.


View raw message