[wp-hackers] Term Meta - Trac'd already?

Mike Schinkel mikeschinkel at newclarity.net
Wed Jul 13 20:28:19 UTC 2011


On Jul 13, 2011, at 4:07 PM, Otto wrote:

> On Wed, Jul 13, 2011 at 2:58 PM, Mike Schinkel
> <mikeschinkel at newclarity.net> wrote:
>> What's the definition of an "object" in WordPress such that some things apply and others do not?
> 
> I'm making a distinction between objects, which can stand alone, and
> meta, which can't as it has to describe things that stand alone.
> 
> - Posts. Users. Links. These are "objects" as I see it. They exist
> independently, and really need no meta to describe them.
> - Meta. Taxonomy. Terms. These apply some information to those
> objects. They have to apply to something, otherwise they're without
> meaning. They must reference some object.
> 
> A taxonomy, for example, can't stand alone. For it to have semantic
> meaning, it has to apply to something else. They are not objects, they
> are ways of grouping objects. Their meaning comes from being applied
> to other things. A term doesn't even have that much, it's really just
> a string label for the taxonomy. It has no existence apart from the
> taxonomy that it is labeling.
> 

While I do see the distinction you are trying to make, we'll have to disagree. 

In my experience every time I've tried to cleanly define distinctions between things and things that classify them the things start looking like classifiers and the classifiers start looking like things. It's all based on the perspective that one is observing them from and to a certain extent many uses of WordPress are myopic so that probably influences the majority perspective. But just because something describes something doesn't mean that it doesn't also need to be described; that's there the concept of "meta meta" comes from.

Drawing from my experience and applying it to WordPress I believe that anything that (practically) can have a unique identifier is an object.  So yes posts, users and links are objects but so are options, comments, terms, term_taxonomy plus sites and blogs and even postmeta, usermeta and commentmeta; they are all objects.  

Of course I know that you and I often disagree on these types of things so I'm not saying to bikeshed nor do I expect you to be swayed by my arguments (you never are. ;-)  I am just putting out on record a different point of view and making a comment that the work I'm doing (with goals to release as free GPL) will be viewing all these things and more as first class objects.

> I think that things tend to just work better when you fit them into
> this framework. If you start trying to treat everything as an object,
> you end up with nonsensical relationship methods. Treating a term as
> an object, for example, implies that you can put terms into taxonomies
> themselves. Grouping the labels of other groups. This rapidly becomes
> crazy and doesn't relate well to other parts of the system such as the
> template hierarchy and the query system.

Again we'll have to disagree on this.  Forcing everything to have only one level of classification results in people building sites with structures optimized for WordPress' currently capabilities but decidedly not for their actual use-case. Further, it can add a significant data maintenance burden on the user.

But I know that WordPress will continue as is, so my comments are more projecting how a layer on top of WordPress could behave instead of advocating that WordPress itself change to suite this view because I know that is unlikely. FWIW.

> BTW, with that said, it doesn't mean that you can't *do it anyway*.
> The core code doesn't care what you put where. You can create
> taxonomies of taxonomies and it'll happily do it for you. The code
> itself has no relationship attached to the taxonomies.
> register_taxonomy_for_object_type() doesn't care what the object type
> is. wp_set_object_terms() doesn't care what type of terms you're
> setting where. As long as you have an ID number that references some
> "object", then it'll connect terms to that object just fine. Heck,
> I've used it for the backbone of an email subscription system. Works
> fine.
> 
> So you can certainly do it with the core functionality available to
> you right now. It just rapidly gets complex and weird if you go that
> route. IMO, of course.

Good follow up.

-Mike





More information about the wp-hackers mailing list