cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hani Suleiman <h...@formicary.net>
Subject Re: Configuration APIs
Date Mon, 28 Aug 2006 17:32:40 GMT
On Aug 28, 2006, at 1:20 PM, Andrea Smyth wrote:

> But as long as frameworks such as Spring do not look up injectable  
> resources in wsdl we do need to have code that does that kind of  
> stuff instead. To minimize such additional code (check operation  
> properties first, then endpoint properties, then service  
> properties) and to encapsulate it I suggest enhancing the generated  
> POJO with providers like so:
> // generated getter
> HTTPServerPolicy getHTTPServerPolicy() {
>    if (null != httpServerPolicy ) {
>       return httpServerPolicy;
>   }
>   return tryProviders(HTTPServerPolicy.class, "httpServerPolicy");
> }
> To me the getter seems a better place than repeatedly do that kind  
> of lookup in application code, with the risk of omitting it in some  
> locations, or using the wrong property name  ...
> I would not call such a use of providers a 'configuration  
> mechanism' at all - it's more an enhancement of an IOC based approach.

Yeah, this would work, though it still feels a bit ugly to be honest,  
in that it's a getter that has a hidden dependency and logic in it,  
rather than a POPO (plain old property object).

Though it's not the end of the world I guess if it's in generated code.

Mime
View raw message