Felix Meschberger wrote:
> Hi,
> 
> Another option could be (as proposed elsewhere) a new method
> 
>     <T> T ResourceResolver.adaptTo(Class<T> type);
> 
> so we could:
> 
>     Session s = request.getResourceResolver().adaptTo(Session.class);
> 
> or
> 
>     ObjectMapper om =
> request.getResourceResolver().adaptTo(ObjectMapper.class);
> 
> WDYT ?
> 
This would be symmetrical to the resource interface - but I'm not sure
if we might run into implementation problems with this approach over
time. Let's assume we have more than one extension for the
ResourceResolver, the ObjectMapper and the YetUnknownExtension - to
support both extensions you need to create an implementation hierarchy
between the implementations (either ObjectMapper extends
YetUnknownExtension or vice versa). Or you can only have one or the other.

When over time another extension is added you get into the typical multi
inheritance problem.

On the other hand all these extensions might not be possible to be
implemented independently from the resource resolver...difficult.

Carsten

-- 
Carsten Ziegeler
[EMAIL PROTECTED]

Reply via email to