> If the generic is something essential in the modeling, this type of cast > issue may be ignored. > But the use of anonymous type is just to accept some List<*> class as the > setter argument. > 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. G
