Considering two alternative ways to set a model:
...
final CompoundPropertyModel myModel = new
CompoundPropertyModel(myObject);
control1.setModel(myModel.bind("field1"));
control2.setModel(myModel.bind("field2"));
control3.setModel(myModel.bind("field3"));
...
and
...
control1.setModel(new PropertyModel(myObject, "field1));
control2.setModel(new PropertyModel(myObject, "field2));
control3.setModel(new PropertyModel(myObject, "field3));
...
are there any performance benefits of one over the other? I profiled each
and they appear equivalent from the number of objects created point of view.
I just want to make sure that option two isn't doing something like
serializing "myObject" for each control. It doesn't appear that this is
happening but wanted to make sure.
We are binding controls to fairly large nested Java Objects. Other than
making sure to use LoadableDetachable models where possible are there any
other strategies for making sure performance is optimal? For example, would
setting the model on the form rather than on each control have any
performance benefit?
Thanks
...
final CompoundPropertyModel myModel = new
CompoundPropertyModel(myObject);
control1.setModel(myModel.bind("field1"));
control2.setModel(myModel.bind("field2"));
control3.setModel(myModel.bind("field3"));
...
and
...
control1.setModel(new PropertyModel(myObject, "field1));
control2.setModel(new PropertyModel(myObject, "field2));
control3.setModel(new PropertyModel(myObject, "field3));
...
are there any performance benefits of one over the other? I profiled each
and they appear equivalent from the number of objects created point of view.
I just want to make sure that option two isn't doing something like
serializing "myObject" for each control. It doesn't appear that this is
happening but wanted to make sure.
We are binding controls to fairly large nested Java Objects. Other than
making sure to use LoadableDetachable models where possible are there any
other strategies for making sure performance is optimal? For example, would
setting the model on the form rather than on each control have any
performance benefit?
Thanks