PDA

View Full Version : BeanModelFactory and BeanModel should be generified



rzschech
24 Sep 2008, 3:34 PM
It would be nice if I could go:

BeanModelFactory<Foo> factory = BeanModelLookup.get().getFactory(Foo.class);
BeanModel<Foo> fooModel = factory.createModel(foo);
Foo foo = fooModel.getBean();

This is useful for example when a BeanModel is selected in a widget and you want to access the wrapped bean with out casting it for example:

BeanModel fooModel = ...
Foo foo = (Foo)fooModel.getBean();

Any thoughts?

zaccret
25 Sep 2008, 1:05 AM
I think it would be nicer but from an end user point of view, it doesn't change. You don't need to cast with the 1.1 release :



public class BeanModel extends BaseModelData{
...
public <X> X getBean()
...