Hi,

I've been thinking lately about identity of our objects, especially
resource objects and adaptables.

Without thinking about how this is implemented at the moment and without
thinking if/how this could be implemented, what would you expect for the
following: We simply get the same resource twice from the same resource
resolver:

ResourceResolver resolver;

Resource a = resolver.getResource("/a/b");
Resource b = resolver.getResource("/a/b");

What should be true? a == b, a.equals(b) ?

Next question: We get the same adaptable from a resource:

Node n1 = a.adaptTo(Node.class);
Node n2 = a.adaptTo(Node.class);

Again: n1 == n2? n1.equals(n2)?

While these questions seem to be trivial (more or less), it can get more
subtle. Think about a resource resolver being used for a single request
and getting the same resource during the request several times. Should
it be possible to return different resources because the repository has
changed during the request?
Or the other way round. Think about an admin resource resolver running
forever in the background.

Before I post my answers I would like to get some other input? :)

Regards
Carsten
-- 
Carsten Ziegeler
[email protected]

Reply via email to