jducoeur: (Default)
jducoeur ([personal profile] jducoeur) wrote2012-11-21 09:53 am
Entry tags:

Singleton tags?

Okay, here's a question for thought and discussion. I'm currently designing the Tag feature. Every Thing in Querki can have fields that are "tags", in the usual sense -- they contain whatever short text you would like. Tags will be hierarchical (because that is sometimes useful). And here's the interesting question: should tags *always* be multi-value?

One of the great failings of older databases is that they tend to be single-valued -- you can have only one Author for a Book, and such silliness. The real world is typically much messier, and that's reflected in the fact that most modern systems use Tags as sets of values: you can generally have any number of tags for a given item. Tags are remarkably powerful, and I expect them to be much-used in Querki.

So I'm clearly going to implement TagSet. Is there any reason to have a data type that is only a *single* Tag? The engineer in me says that of course such a thing should exist, since conceptually it's obvious, but the UX designer in me says not to, since you shouldn't expose a concept that is always a bad idea to use.

Opinions? Are there non-strawman cases where you would specifically want to only allow a single Tag on something? Or is it more bother than it's worth to expose this through the UI -- should I just have TagSet as the type that you always use?

[identity profile] talvinm.livejournal.com 2012-11-21 03:01 pm (UTC)(link)
Could this be tunable? Could the owner/moderator of a particular area set a limit on "number of tags per Thing" (sometimes tagging gets WAY out of control, too!) with possible values of Zero to Foo?

[identity profile] talvinm.livejournal.com 2012-11-21 03:17 pm (UTC)(link)
I'll admit, I am not wed to the concept myself. It just popped into my head as a possibly useful compromise.

[identity profile] talvinm.livejournal.com 2012-11-21 03:43 pm (UTC)(link)
No, not overly negative. :) While not on your scale, I have written code before. I have also had to document products, trying to write the user's manual even as the product was being built, and being redesigned as it was being built. I understand and applaud the desire to avoid Feeping Creatures.

[identity profile] goldsquare.livejournal.com 2012-11-21 03:15 pm (UTC)(link)
I'm not sure I am fully understanding the issues, but it seems to me that you have answered your own question.

I'm reminded of a comment made by one of my co-workers at SUN, defining when one implementation is more powerful than another. "If you can implement B using A, but cannot implement A using B, A is more powerful". I'd opt for the more powerful, TagSet, in all areas.

Talvin's question is a good one, though. Do you want to be able to create TagSets whose sizes are pre-limited for any reason? I see no reason not to do so - except that it introduces a set of error conditions around both the limit value and what happens when you hit a limit.

That is an increase in complexity of code and time of implementation. I lack the knowledge to advise you on that, as I am not as versed in the usage model as you are.

(I'm inclined to say "no" - as long as your TagSet contains an ordinal count of tags, you can always implement a subclass of TagSet called LimitedTagSet. Or, from what you have been saying about Scala, you can create something that has an ordinal-cap sort of property, and associate that with all your collections or sets, should you choose to do so. I did buy, but still haven't cracked, Scala for the Impatient. The irony is not lost on me. I've been reading on law instead.)

[identity profile] be-well-lowell.livejournal.com 2012-11-21 03:57 pm (UTC)(link)
A limit on number of tags makes sense. A special category for exactly one tag doesn't clearly fit into that sense.

If it's the by-far-most-common case, it deserves some optimizations in the user interface (but not in the underlying implementation unless there's a technical win involved).

[identity profile] goldsquare.livejournal.com 2012-11-21 03:58 pm (UTC)(link)
Ah.

So the question is whether a user would want to limit the number of tags on something, and have Querki enforce that limit.

I'd say no, because retrofitting that is easy: objects from before the retrofit continue to have unlimited TagSets, objects afterward have a range.

Dan's point about proliferation of "near tags" is important as well, and the Merge feature he suggests would be useful, if likely secondary to your initial implementation.

What may be useful, to address his concerns, is to find a useful UI that urges the user to use existing tags over having them create a near-duplicate without care.

We are now far afield from your question. :-)