On Wed, 2009-03-25 at 09:46 -0700, Justin Deoliveira wrote:
> > GeoServerExtensions.bean(name, Decoration.class)
> I am not sure I see the big win here... Spring bean names are unique
> no? 
> So either way you are going to have to do a check after the fact. In 
> this case for null... in the other case if it is of the desired
> type... 
> 6 in one, half dozen in the other.
> 
> In general imo looking up beans directly by name should be
> discouraged. 
> IN some cases I realize it is necessary, but those cases we are 100% 
> what the type of the class is, things like Catalog, etc...
> 
> The pattern for extension points should really to iterate over all
> that 
> around. If you are looking up one by name there is an assumption
> about 
> it at which point it is no longer an extension point.
> 
> Sorry if I am missing something there... perhaps if you could
> re-iterate 
> the use case for this method?
> 

Here is what I am doing right now:

in applicationContext.xml someplace:
<bean name="watermark" class="org....WatermarkDecoration"
singleton="false"/>

in a layout configuration file:
<decoration type="watermark".../>

in the layout configuration parser:
Decoration d = (Decoration)
GeoServerExtensions.bean(decorationElement.getAttributeValue("type"));

--
David Winslow
OpenGeo - http://opengeo.org/


------------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to