On 22.10.2014, at 14:36, Justin Edelson <jus...@justinedelson.com> wrote:
> 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.

On 22.10.2014, at 14:34, Stefan Seifert <sseif...@pro-vision.de> wrote:
> sling models is based on a very simple API: adaptTo().
> 
> adaptTo passes in only the adaptable, and if this is not the request object 
> there is no chance for the sling models implementation to get hold of it 
> besides some "not-so-clean" way using a threadlocal.

Maybe that's the problem and sling models should have a better way to be 
created instead of piggy-backing on the magic adaptTo().

For JSPs: a taglib. For Java services: a service with methods like 
getModel(type, request) and getModel(type, resolver) etc. Imagine there is no 
ThreadLocal and adaptTo() available, how would you solve it in the most 
convenient fashion?

Cheers,
Alex

Reply via email to