On Fri, 22 Jun 2012 11:36:51 -0400 Andrew Geery <[email protected]> wrote: > My question is: should Wicket have realized that the proxy'ed Person > object was actually a Person class and called the appropriate > converter? Looking at this -- > http://stackoverflow.com/questions/1139611/loading-javassist-ed-hibernate-entity > -- > it looks like there is not a generic way of handling this, without > explicitly checking for something like a HibernateProxy. > > Perhaps the answer is simply: make sure that proxies don't end up in > the UI layer?
That would certainly be the cleanest solution. Otherwise the converter lookup mechanism would have to be adjusted. That might be a rather expensive operation - it's a simple map lookup right now so it's very fast but doesn't work with subclasses. Long ago I wrote my own string conversion classes for an application I was working on. It used a chain-of-responsibility pattern, where a number of converters would try converting the value one after another until one succeeded. It worked well and it could probably be adapted. Two things make me wary of this approach though: - it'd be a major API break - we'd have to look at performance very closely. Carl-Eric --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
