jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Validation in QName class
Date Mon, 17 Sep 2007 11:38:10 GMT
Hi,

On 9/17/07, Martijn Hendriks <martijnh@gx.nl> wrote:
> > However, the officially supported node type registration
> > methods are the ones in o.a.j.api.JackrabbitNodeTypeManager,
> > and there we do validate all the QNames. If you are using
> > NodeTypeRegistry directly, then I think it should be your
> > responsibility to do the validation before constructing the
> > QName instances.
>
> Ok, that's fair. We use the NodeTypeRegistry directly because we need to
> re-register nodetypes sometimes. The NodeTypeRegistry already has a
> method checkNamespace to check that the URI of a QName has been
> registered. Wouldn't adding a check with the NameFormat.checkFormat on
> the local name of the QName only make the registry more robust?

I see the logic in adding more robustness, but so far the basic
assumption about QNames has been that they are all valid once
constructed. I wouldn't want to start eroding that assumption by
allowing some clients to feed invalid QNames to internal Jackrabbit
methods and expecting the repository to do the validation for them.

If you do need the extra functionality from NodeTypeRegistry, how
about if we exposed it on the JackrabbitNodeTypemanager level together
with proper name validation? This solution would be cleaner
design-wise and would allow you to drop one direct jackrabbit-core
dependency.

BR,

Jukka Zitting

Mime
View raw message