You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2011/08/16 08:08:31 UTC

[jira] [Closed] (SLING-1967) Document possibility of caching in Adaptable

     [ https://issues.apache.org/jira/browse/SLING-1967?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-1967.
-----------------------------------


> Document possibility of caching in Adaptable
> --------------------------------------------
>
>                 Key: SLING-1967
>                 URL: https://issues.apache.org/jira/browse/SLING-1967
>             Project: Sling
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: API 2.2.0
>            Reporter: Alexander Klimetschek
>            Assignee: Felix Meschberger
>             Fix For: API 2.2.2
>
>
> SLING-1673 added caching in SlingAdaptable. This means that Adaptable.adapTo() users must be aware that there won't be a new instance of the requested object upon repeated calls. This should be documented in adaptTo(), i.e. that one cannot expect new instances - or rely on any behavior, be it always the same instance or always a new one.
> This affects mostly adapters provided by AdapterFactories, as these will be behind the default caching implementation in SlingAdaptable. If adaptTo() is directly implemented in an object, it can chose itself whether it does caching or not. So I think the docs for AdapterFactory should also be changed to note that - something like "make sure you return re-usable objects here, as these might get cached and the adapter factory won't be called for each adaptTo call of the same object".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira