On 14 Nov 2004, at 15:41, Bill de h�ra wrote:
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.
Ok. My way of putting it was a little too short hand. I was thinking of the model I had
represented by the following UML illustration
<<inline: Atom-Nov-9-UML-FeedPointsToEntry2.jpg>>
which in your notation is a 2-tuple feed(head, set), but I suppose could also represent feed(head,stream), which I in fact prefer.
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.]
[Yes. It is unbelievable that they should have allowed their search of the groups to get so bad. That is why I started the atom-owl group on groups-beta.google.com]
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 ;)
completely agree on this.
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.
Well I think that is just what Robert is proposing, and I am agreeing with. That the atom:head data structure is a kind of atom:entry data structure, or even is exactly that: an atom:entry.
The refactoring here came from taking the atom:entry structure and the atom:head structure and finding that they had most of their elements in common, and furthermore that there is no harm done when one further merges the differences into one.
Your objection was that such refactorings can sometimes be a bad idea. But exactly why they would not be good in this case is not clear. Neither is it clear what our refactoring has in common with bad examples of the application of this refactoring.
Such cons furthermore then have to be balanced agains the pros: such as the advantages in simplicity at the syntax, and maybe even the API level that may ensue from this. "It's all about the Entries stupid", sounds even truer now.
So the objection stands, but I think its legs are very very weak. It may want to sit down for a rest :-)
Henry
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
