Custom attribute collisions

20 views
Skip to first unread message

Angel

unread,
Jan 3, 2018, 12:15:11 PM1/3/18
to Camlistore
Hello,

I have a few ideas for apps I'd like to see on Perkeep but I'm wondering what the best practice is for apps adding attributes to permanodes. Is there any risk of one app relying on certain attributes for some business logic that may be added by another app? i.e. I noticed the scanningcabinet app, as part of its business logic, adds a "document" attribute to "scan" permanodes when several scans are combined. Another app could be developed that would re-use or add values to the "document" attribute without realizing the scanningcabinet app makes use of it. 

I know all attributes are technically "multi-valued" per their implementation so perhaps this isn't an issue. But I wanted to check if there were recommended best practices around custom apps namespacing attributes they add to permanodes or something like that.

Thanks!
Angel

Brad Fitzpatrick

unread,
Jan 3, 2018, 12:23:25 PM1/3/18
to camli...@googlegroups.com
Best practice is to prefix custom attributes with a domain name, like:


(search for "foursquare.com:")


--
You received this message because you are subscribed to the Google Groups "Camlistore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camlistore+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Angel

unread,
Jan 3, 2018, 12:35:40 PM1/3/18
to Camlistore
I see. So technically, the scanningcabinet app should actually be adding {"scanningcabinet:document": "sha1-parent"} to the "scan" permanode to keep attribute keys namespaced as well as values.
To unsubscribe from this group and stop receiving emails from it, send an email to camlistore+...@googlegroups.com.

Brad Fitzpatrick

unread,
Jan 3, 2018, 12:36:30 PM1/3/18
to camli...@googlegroups.com
Yeah, the scanningcabinet app predated the best practices. We should fix it.


To unsubscribe from this group and stop receiving emails from it, send an email to camlistore+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages