On 12.09.2014, at 10:55, Jason E Bailey <jason.bai...@24601.org> wrote:

> I have a hard time understanding how there would be added complexity by
> incorporating the nodeType hierarchy into a determination as to whether
> a specific resource "is" of a specific type. Multiple hierarchies are
> fairly common in programming languages, like the instanceof I mentioned
> that does both the class hierarchy and the interface hierarchy.

Yes, but it gets complicated when you look at the servlet resolution: which 
super type hierarchy has a higher precedence? The current weighting is already 
pretty complex.

And I think enforcing more use of resource types and less node types here is a 
good thing :)

>  I also
> don't see much confusion occurring from implementing this. If I am
> attempting to validate a whether something is inherited from nt:base I
> clearly have a need in mind that would be separate from desire to know
> if it's a sling component that inherits from "foundation/list"

BTW, you can handle the case yourself:

Node node = resource.adaptTo(Node.class);
if (node != null) {
    if (node.isNodeType(nt)) {
        // ...
    }
}

Cheers,
Alex

Reply via email to