Should a company's custom jcr property names contain a namespace? | Community
Skip to main content
nesfel_aem
Level 3
Dec 19, 2018 2:52 PM UTC
Solved

Should a company's custom jcr property names contain a namespace?

If your company is named MyCo and you sell books, you might want to store properties like total pages for book nodes in the JCR.  Are you supposed to name your company's custom JCR properties so that they start with a namespace?  If so, should your custom properties always start with the namespace jcr: or something else like myco: (inspired by your company name)?  We've seen consultants use both, e.g., totalPages or jcr:totalPages.

We're just trying to be consistent with what the rest of community is doing.  If there's a document with naming conventions, that would be great too, but this was the closest we could find so far (http://jackrabbit.apache.org/jcr/ocm/mapping-bean-fields.html).  Thanks so much for taking the time to read this question, and really appreciate how helpful Adobe and its community members are.

-Nestor

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Dec 19, 2018 3:38 PM UTC

Hey - naming is typically done as a convenience - not a hard rule. You can name your custom properties to match your organization if you feel this will improve you business processes. However - there is no hard rules. Here is a good guide line when working with the JCR - David rules:

Data Modeling - David Nuescheler's Model

Hope this helps...

4 replies

nesfel_aem
Level 3
Dec 20, 2018 8:27 PM UTC

Jorg, thanks for your additional perspective.  Very nice to know that the added complexity could even cause us unexpected issues.  Going to follow the KISS principle!

Translate
joerghoh
Employee
Dec 20, 2018 8:57 AM UTC

Including custom namespaces is possible, but in most cases there's no value in doing so (sometimes it can even create issues you were not aware of in the first place).

Translate
nesfel_aem
Level 3
Dec 19, 2018 4:17 PM UTC

smacdonald2008​, thanks a lot for the quick reply.  It definitely helps!  Based on your answer (and well known expertise), I think we'll avoid including namespaces in our custom property names.  Good to know it's an option, but not a hard rule.

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Dec 19, 2018 3:38 PM UTC

Hey - naming is typically done as a convenience - not a hard rule. You can name your custom properties to match your organization if you feel this will improve you business processes. However - there is no hard rules. Here is a good guide line when working with the JCR - David rules:

Data Modeling - David Nuescheler's Model

Hope this helps...

Translate