|
From: Alef A. <al...@jt...> - 2004-06-07 22:43:09
|
Juergen, I'm refactoring one of our proprietary utilities at the moment to let it use Spring more. We don't want to use the open-session-in-view stuff and have defined standard views for read-only data from a complex domain model. The views state what they want to render (especially handy when showing just parts of objects in for example a list) and get proxies backed by maps instead of the actual objects. We originally realized this by building our own data wrapper (way before we starting using Spring), but I'm refactoring it to use the BeanWrapper instead. Instead of an actual object backing the BeanWrapper, this is one uses PropertyValues (like I said, it used to be maps). While creating a new BeanWrapper, I'm encountering a lot of duplication of functionality, specifically the caching of introspection results (I basically had to copy the CachedIntroSpectionResults class) and the registering of propertyeditors. Would it be an idea to do a small refactoring of the BeanWrapper (for 1.1 or 1.2) and to create the following: AbstractBeanWrapper: - customer editors - introspection stuff - convenience methods (getPropertyNameTokens and some of the other ones) BeanWrapperImpl: - backed by an object and doing the actual setting and getting of properties Yes yes, I know, extending the BeanWrapper is a rare use case, but by doing it I don't have to change a thing to my web layer ;-) Alef |