Hi,

On Wed, Oct 22, 2014 at 5:21 PM, Alexander Klimetschek
<aklim...@adobe.com> wrote:
> On 22.10.2014, at 01:22, Stefan Seifert <sseif...@pro-vision.de> wrote:

>> my current usecases are:
>> - having the ability to inject context objects like request in any sling 
>> model, regardless of the adaptable. this is e.g. importing when adapting 
>> from a resource, but in context of a request (SLING-4083)
>
> That should be possible to solve differently, such injection sounds like too 
> much magic to me. Why can't sling models have a clear API that passes in such 
> objects when they are created instead of going through a threadlocal?

To be clear, Sling Models was designed *not* to have an explicit API
and to be a way to implement of AdapterFactories. For version 1.2.0,
it does have an API, but this is essentially just a mirror of the
AdapterManager API plus some utility methods.

"Such objects" are passed in currently, assuming they are navigable
from the adaptable and this is documented in
http://sling.staging.apache.org/documentation/bundles/models.html#available-injectors.
But Stefan is describing a use case where those objects are not
navigable.

Justin

Reply via email to