I do want to emphasize that I don't think PaceEntriesAllTheWayDown2 forces one to accept the FeedIsAEntry model. It does allow it, so it may be a reason for some people to support it. As such I will respond to your questions here.


On 16 Nov 2004, at 16:48, Walter Underwood wrote:


--On Tuesday, November 16, 2004 12:58 PM +0100 Henry Story <[EMAIL PROTECTED]> wrote:

Ok, so perhaps you would really like the model in which a Feed is a subclass of Entry.

That is the normal approach for compound documents.

Yes. It is probably not much more than the very well known composite pattern used in OO programming [1]


But I still
don't see a convincing reason.

Here are some:
- it could very well simplify the API. If there is only one thing or two that we are dealing with then we don't need a lot of special cases.
- It would further simplify the spec. The spec for Feed would just say: has all the properties of an Entry and in addition can contain Entries.
- It would allow you to present a Feed of Entries and responses to those. (Though one could also disallow this explicitly.)


        <feed>
                <title>my feed</title>
                <author><name>Henry Story</name></author>
                <copyright>Creative commons licence</copyright>
                <entry>
                        <title>my first entry</title>
                        <content>This is great</content>
                <entry>
                <feed>
                        <title>SuperMan is Clark Kent</title>
                        <content>The other day I saw Clark Kent fly out of the 
window.
                        He changed his suit in mid air, and saved the child 
that was
                        about to get crushed by an out of control Atom 
robot</content>
                <author><name>Henry Story</name></author>
                        <entry>
                                <title>That can't be</title>
                                <author><name>Graham</name></author>
                                <content>Superman can fly. Clark Kent can not. 
A thing can't
                                have two inconsistent properties. Duh!</content>
                        </entry>
                        <entry>
                                <title>I know how we could test this!</title>
                                <author><name>Antone Roundy</name></author>
                                <content>What you say is increadible Henry. But 
I know how
                                we could find out. Superman has a deadly fear 
of kryptonite, that
                                humans don't have. I happen to have some. We 
just need
                                to give some to Clark Kent.
                                </content>
                        </entry>
                </feed>
        </feed>

And I do favor short specs.

1. People have been working on compound documents without much success
for at least fifteen years. To me, that indicates that they are either
very hard or not very useful.

Interesting. Perhaps they were trying things that were a lot more difficult.
In any case the Composite pattern is applied all over the place, with a lot of success.


2. I have not seen a use case where a feed would be treated as an entry.
If it is common, not just possible, for a feed to be an entry, then we
need this. Otherwise, we don't. Show me the real world use cases.

I think the above use cases are amply sufficient to explain the advantage.



3. Identity is not sufficient for something to be the same class. It is common for the same chemical to have multiple uses, each with different trademarks, packaging, production, and sales figures. From a business perspective, those identical chemicals must be treated as separate things, e.g. a dessert topping and a floor wax.

Yes. I am many things. I am Henry Story and I am a mass of cells.

We can start splitting hairs all over the place and also end up with a spec 500 pages long. Or we could end up being simple, and up getting a really tiny, consistent and powerful spec out there. Small is beautiful.


wunder -- Walter Underwood Principal Architect, Verity


[1] http://patterndigest.com/patterns/Composite.html



Reply via email to