Henry Story wrote:

You can accept the refactoring without accepting that a Feed is a Entry. You would prefer the model perhaps in which a feed is a set of entries, with a special entry being the head entry of the feed. That is the model I adopted in my latest attempts at modeling Atom in OWL.

Not quite. I still don't see that either is a special case of the other. I think the data structure for this is a 2-tuple feed(head, list), not a 1-tuple feed(list) of uniform type. In my mind, the second member of that tuple is a delayed list (i.e., a stream [1]), not a set. But of course you could represent all the entries as a set, but that's a math thing rather than a programming thing.


I recall Bob Wyman's analogy to a sliding window or some such capturing my sense of a feed's entries perfectly.


My experience is that eliding aspects of domain models in favour of generic structures is often a flawed approach.

"often", but not always. Perhaps you can reference exactly where Martin Fowler specifies one should be careful.

[I'd like to but it I'm pretty sure it was in a yahoo group (I think it was extremeprogramming) which are basically unsearchable in reasonable time. All I'll say is I'm not making it up - there were two code blocks that were doing essentially the same programmatic operation; the deciding argument was to leave them as they were since the blocks differed in intent at the application level. I remember because it surprised me. Inheritance as reuse is (now) a well-understood phenomenon in OO.]



There is another nice advantage of this on the API side of things. If the head of a feed is an Entry then the API might also be simplified quite dramatically, since adding all the head information to a feed would be just creating a new Entry element and associating it with a feed.

See the data structures comment above. We need to be careful because "head" is being used in two distinct senses - one as the name of metadata structure that describes the feed; two as the first child of the Atom feed element and thus item(0) in any XML/Info set based process).


For 1) the head of a feed is not an entry, it is the first member of that 2-tuple. For 2) the head of the entries is not the head but the next entry on the stream; the stream is the second member of the 2-tuple. That the head looks like the the head of a list of entries is a feature both of the XML snapshot you've been given and the vagaries of English ;)

Put it this way. my objections to treating the atom:head data structure as a kind of atom:entry stands. Otherwise where you and Robert and going is interesting.

On further reflection - atom:head might be a confusing name, atom:header or atom:about might be better. No big deal, just an ob.

cheers
Bill

[1] http://mitpress.mit.edu/sicp/full-text/sicp/book/node70.html



Reply via email to