Justin Deoliveira ha scritto: ... >> and then leave ReadOnlyDataStore as is, but I don't see how this can >> be implemented using the java dynamic proxies. > Yeah, the case for datastore is a little hard to sell proxies. However > for regular java beans its like the classes in the new configuration > model its a little bit easier to sell. You can put in some generic logic > based on get/set method naming conventions. For instance the code in > LayerGroupInfo that thats the collections of layers and wraps them in > read only layers. There is code in ModificationProxy that does this > exact same thing. > > So the short of it is I think we could save some code by using proxies, > and break out full blown decorators when need be... like with DataStore. > However as you say programming with proxies is a level of indirection as > all calls you make are reflective calls.
I just find it quite a bit more error prone and it's not refactoring safe, but one can work around that limitation with more unit testing. > The only thing I fear with the pure decorator approach as that we are > following down the same road as with DTO's and the config... where > modifying one class does not mean modifying one class. Yeah, seen your commit :) Sorry, I consistently used the same approach for all the wrappers, making decorators like this was a lot easier given the dev env support for building delegate classes. I guess the trade off depends a lot on how stable the catalog API is going to be, if we need to change it often then it's probably worth it to rewrite the decorators to use proxies, change their unit tests and the client code accordingly. Oh, btw, on Windows I cannot rename the following class: http://svn.codehaus.org/geoserver/trunk/geoserver/main/src/main/java/org/geoserver/security/decorators/DecoratingLayerGroupINfo.java because DecoratingLayerGroupINfo and DecoratingLayerGroupInfo are the same file name on windows. Can you do that for me? ;) Cheers Andrea ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Geoserver-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-devel
