[uf-new] collection-design-pattern proposal
Rudy Desjardins
datawhore at gmail.com
Wed Apr 25 08:11:26 PDT 2007
On 4/25/07, Danny Ayers <danny.ayers at gmail.com> wrote:
> Starting from your example:
>
> <div class="haudio grouping.reconnection">
> <span class="collaborator hcard fn">Ammonite</span>
> <span class="work-title">Reconnection</span>
> </div>
> [...]
> <div class="haudio grouping.reconnection.sunset">
> <span class="work-title">Sunset</span>
> </div>
>
> it could be simplified to:
>
> <div class="haudio">
> <span class="collaborator hcard fn">Ammonite</span>
> <span class="work-title">Reconnection</span>
> </div>
> [...]
> <div class="haudio reconnection">
> <span class="work-title">Sunset</span>
> </div>
>
> "grouping" isn't needed, because class already expresses a kind of set
> membership. There is still the problem of how to connect the item to
> its container, easiest would be:
>
> <div class="haudio" id="reconnection">
> <span class="collaborator hcard fn">Ammonite</span>
> <span class="work-title">Reconnection</span>
> </div>
> [...]
> <div class="haudio reconnection">
> <span class="work-title">Sunset</span>
> </div>
>
> However personally I think I'd go a step further and make everything
> more explicit, to avoid the parser having to do infer the association:
>
> <div class="haudio" id="reconnection">
> <span class="collaborator hcard fn">Ammonite</span>
> <span class="work-title">Reconnection</span>
> </div>
> [...]
> <div class="haudio reconnection">
> <span class="work-title">Sunset</span>
> Part of <span class="part-of"><a
> name="#reconnection">Reconnection</a></span>
> </div>
'Mixing' class and id values seems wrong to me, ie: album's
id="reconnection" and song's class="[...] reconnection".
The other problem I can see with this is that in a lot of cases where this
non-localized grouping becomes necessary, adding language such as "Part of
..." would be redundant from a human reader point of view; you would
essentially be requiring authors to use such lexical conventions in order to
make use of grouping when in reality, based on the context of the
human-readable content it should be obvious that the song we're talking
about is part of the album we're also discussing. Requiring the addition of
"Part of [container name]" to the human readable content is redundant,
however without it, making use of an <a> tag to link the song to it's
album's markup (which seems to be a very simple and elegant solution to
linking a member with it's container) becomes counter-intuitive: you would
need to link the text for the song to the markup for the album, which would
be confusing for humans since 'songName' would logically be assumed to link
to further details/etc for that song, as opposed to the album it belongs to.
What about this:
<div class="haudio reconnection">
<span class="collaborator hcard fn">Ammonite</span>
<span class="work-title">Reconnection</span>
</div>
[...]
<div class="haudio reconnection.member">
<span class="work-title">Sunset</span>
</div>
Very similar to Manu's previous example of using class values like '
grouping.albumname', however the suffix approach seems more direct,
intuitive and all-purpose...
I'm not sure if using a 'class-suffix' like this is generally acceptable,
but it seems to solve most of the problems that have been discussed:
1) Uses class instead of id.
2) Supports the class attribute being used as an implicit indication of
set-membership.
3) Indicates the direction of the relationship, ie: which item is the
container, as opposed to just using 'albumname' as a class value for both
album and song, which would ambiguously indicate that both things are part
of a group called 'albumname'.
4) Is subject-agnostic - this approach can be used for any type of grouping
where one item is contained by another.
5) Works for N-N relationships, ie: class="album.member soundtrack1.member
soundtrack2.member".
As for the issue of hiding meta-data from the humans, I don't think that's
what's happening. If we're discussing an album, and in the course of that
discussion mention a track from that album, I think we can assume that the
human consumers of the rendered html will understand the relationship
between album and song. Adding meta-data to the markup with a design
pattern/uF to indicate the nature of that relationship is simply explaining
to the machines what the humans already understand.
Am I missing anything?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://microformats.org/discuss/mail/microformats-new/attachments/20070425/c61ea2e2/attachment.html
More information about the microformats-new
mailing list