jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: hasProperty vs getProperty
Date Mon, 30 Jul 2012 14:02:29 GMT
On 20.07.2012, at 14:58, Julian Reschke <julian.reschke@gmx.de> wrote:

> On 2012-07-20 14:41, Alexander Klimetschek wrote:
>> On 20.07.2012, at 09:01, Julian Reschke wrote:
>> 
>>> I agree with that, but that's how JCR works.
>> 
>> Well, you have both options: if you use the has*() or (item|property|node)Exists()
methods, and since PNFEx inherits from RepositoryEx, you can skip the try/catch for the application
logic.
> 
> That "works", but causes lots of unneeded work in the implementation; 
> which is exactly why I started this discussion.

Yes, but this is one of the things that the infrastructure (i.e. JCR) should provide (without
a penalty) instead of having to handle this again and again in your application or use ugly
exception handling.

But I agree that a get<Something>() returning null if it's not existing is also a very
good idea, currently lacking from JCR.

Cheers,
Alex


Mime
View raw message