There are additional considerations (at least in this implementation), all of which should be familiar to users of Hibernate or any proxy-based framework.
1) classes may not be final 2) methods may not be final 3) classes must have a no-method constructor Some folk may not be happy with these restrictions. - Scott On Feb 6, 2008 5:43 PM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > i support it in a non-core module > > -igor > > > > On Feb 6, 2008 5:41 PM, Jonathan Locke <[EMAIL PROTECTED]> wrote: > > > > > > so you don't support this model then? > > > > > > > > igor.vaynberg wrote: > > > > > > i disagree. i dont think we should be doing more with cglib in core or > > > any other bytecode magic. have you ever tried to walk code that uses > > > bytecode generation? its a nightmare. one of my favorite things about > > > wicket is that it is just java and its easy as hell to debug. im not > > > really against putting something like this into extensions, or even > > > having a new wicket-bytecode/codegen/whatever package that contains > > > things like these... > > > > > > -igor > > > > > > > > > On Feb 6, 2008 5:23 PM, Jonathan Locke <[EMAIL PROTECTED]> wrote: > > >> > > >> like BoundCompoundPropertyModel, but safer. i think this almost might be > > >> too > > >> clever as it sacrifices some intuitiveness. also, it's filling in for a > > >> missing java feature. this should really be: > > >> > > >> boundModel.bind(component, firstName.property) > > >> > > >> (where .property, .field and .method are long-missing declarative > > >> reflections like .class) > > >> > > >> it does make me think we could be doing more with CGLIB in general. our > > >> model classes ought to be able to detect model changes better using > > >> proxies, > > >> for example. > > >> > > >> > > >> > > >> Scott Swank wrote: > > >> > > > >> > One of our more clever developers created a CompoundPropertyModel that > > >> > uses a cglib proxy to strongly bind the mutators to the model. It > > >> > looks like this: > > >> > > > >> > SharedPropertyModel<Customer> model = new > > >> > SharedPropertyModel<Customer>(customer); > > >> > this.setModel(model); > > >> > > > >> > FormComponent firstName = new > > >> > CustomerNameField("firstName").setRequired(true); > > >> > model.bind(firstName).to().getFirstName(); > > >> > add(firstName); > > >> > > > >> > FormComponent lastName = new > > >> > CustomerNameField("lastName").setRequired(true); > > >> > model.bind(lastName).to().getLastName(); > > >> > add(lastName); > > >> > > > >> > FormComponent addr1 = new > > >> AddressField("address1").setRequired(true); > > >> > model.bind(addr1).to().getAddress().getAddress1(); > > >> > add(addr1); > > >> > > > >> > FormComponent addr2 = new AddressField("address2"); > > >> > model.bind(addr2).to().getAddress().getAddress2(); > > >> > add(addr2); > > >> > > > >> > FormComponent city = new CityField("city"); > > >> > model.bind(city).to().getAddress().getCity(); > > >> > add(city); > > >> > > > >> > We're happy to share if folk like this approach. N.B. that the .to() > > >> > call is for readability rather than out of any necessity. > > >> > > > >> > Cheers, > > >> > Scott > > >> > > > >> > -- > > >> > Scott Swank > > >> > reformed mathematician > > >> > > > >> > --------------------------------------------------------------------- > > >> > To unsubscribe, e-mail: [EMAIL PROTECTED] > > >> > For additional commands, e-mail: [EMAIL PROTECTED] > > >> > > > >> > > > >> > > > >> > > >> -- > > >> View this message in context: > > >> http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p15325663.html > > >> Sent from the Wicket - User mailing list archive at Nabble.com. > > >> > > >> > > >> > > >> --------------------------------------------------------------------- > > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > > >> For additional commands, e-mail: [EMAIL PROTECTED] > > >> > > >> > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > -- > > View this message in context: > > http://www.nabble.com/CompoundModel-based-on-proxies-tp15317807p15325860.html > > > > Sent from the Wicket - User mailing list archive at Nabble.com. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Scott Swank reformed mathematician --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]