alps-io / spec

ALPS Specification documents.
59 stars 13 forks source link

When a single ID has multiple meanings by given context #114

Open koriym opened 2 years ago

koriym commented 2 years ago

For example, I need two account IDs and the amount of money to transfer money. How do I represent this?

href+name https://github.com/alps-io/profiles/blob/master/xml/alps-with-varying-rt-values.xml#L32

    <!-- Ontology -->
    <descriptor id="accountId" />
    <descriptor id="moneyAmount"  />

    <!-- Choreography -->
    <descriptor id="doTransfer" type="idempotent" rt="#User" >
        <descriptor href="#moneyAmount" />
        <descriptor href="#accountId" name="senderId" />
        <descriptor href="#accountId" name="receiverId" />
    </descriptor>

(Is it valid to include more than one of the same ID?)

id+href https://github.com/koriym/app-state-diagram/pull/67

    <!-- Ontology -->
    <descriptor id="accountId" />
    <descriptor id="moneyAmount"  />

    <!-- Choreography -->
    <descriptor id="doTransfer" type="idempotent" rt="#User" >
        <descriptor href="#moneyAmount" />
        <descriptor id="senderId" href="#accountId"  />
        <descriptor id="receiverId" href="#accountId"  />
    </descriptor>
koriym commented 2 years ago

I've come to this conclusion.

id+href is preferable because it has a different id, so there are two different descriptors that inherit from accountId, and it can express more detailed semantics.

This was the same thought that @tkawa had.