Hi Alex,

On Fri, Feb 6, 2015 at 1:45 AM, Alexander Klimetschek
<aklim...@adobe.com> wrote:
> ...0. adaptTo was invented for jsp scripts...

Not only.

Adapting a Resource to a Node in java code makes perfect sense if you
need to access the JCR level.

Adapting a Resource to a Tenant also makes sense as a way to find out
which Tenant it belongs to.

> 1. we are now using adaptTo() everywhere because of convenience and we don't 
> want to depend on a service...

There's definitely some abuse of adaptTo around...a good rule might be
to use adaptTo only when processing an HTTP request. A Sling app is
not supposed to process HTTP requests before it's fully ready, so the
"adapter not found yet" issue shouldn't happen.

-Bertrand

Reply via email to