[Attempto] Statement id in article

Changyuan Yu reivzy at gmail.com
Thu Dec 15 13:07:21 CET 2011


> As I said, I don't think that sentence IDs are a bad thing, but we shouldn't
> introduce them without more thinking about what a sentence really is.
> Otherwise we will run into problems later, if IDs do not identify sentences
> but something different. We need to have a clear abstract notion of a
> sentence, and this does not need to be a one-to-one mapping to Java objects.
> E.g. if a sentence is changed then the same Java object might become a new
> sentence with a new ID. We should clearly distinguish between the abstract
> model and its implementation.

IDs may be not one-to-one mapping to java objects, but I think
one-to-one map is the most simple kind of map. Every operation on a
java object can directly map from a operation on ID, for remote call.
And the ID here, is only in implementation, not abstract model, maybe
I should call it "remoteId", not just "ID", and I will call it
remoteId in following discuss.

> This example does not look very convincing to me. The second version is only
> slightly simpler. Does this really justify the use of IDs? Maybe so, but
> only if we find a consistent and elegant solution.
>
> Your example only works if each *occurrence* of a sentence gets its own ID:
> Two occurrences of a sentence with the text "An apple is a fruit" would need
> two different IDs, because otherwise you would have to say 'change the 2nd
> sentence with ID 234 to "Every apple is a fruit"'. I don't think that it
> makes sense to define that there can be distinct sentences with the same
> text.

If two sentences show in the GUI are actually same java object in the
servlet, then they have same remoteId. Change the first occurrence of
the sentence(using its remoteId) will also make the change apply to
the second one, maybe it make user feel confused but this is what we
expect. If we want two sentence that has same text show in GUI not
change at same time, then make sure they are different java object, so
with different remoteId.

I think the remoteId of a sentence what I suggest is like the path of
a file. When we write shell command, we can not really do any
operation directly on a file(or a inode), so we use its path. The
different is AceWiki will show the content of a sentence but "ls"
command show the path (or name) of a file. For internal usage,
remoteId for a sentence maybe not necessary as the java objects are
directly accessible.

If it is not for remote access a sentence java object, then the ID of
a sentence maybe hard to define and maybe not necessary. I think an ID
is used to distinguish different sentences(and we should define what
sentences are consider different), and if we can distinguish a
sentence already(without ID), then we do not need ID (at least in
implementation).

-- 
Best regards,
Changyuan


More information about the attempto mailing list