3

I can't find any docs on this, so what is the difference between o and --> in Fabric Composer, and under what circumstances should they be used?

Consider this...

asset Document identified by docId {
    o String docId
    o Articles[] articles
}

vs this...

asset Document identified by docId {
    o String docId
    --> Articles[] articles
}
Matthew Layton
  • 39,871
  • 52
  • 185
  • 313

2 Answers2

4

There is a document about CTO language. This document mentions about has-a relationship (o) and reference (-->).

Fabric Composer Modeling Language https://fabric-composer.github.io/reference/cto_language.html

Tanaka Hiroyuki
  • 143
  • 1
  • 7
0

I'm just learning about Hyperledger, but I saw a reference in this video https://youtu.be/6nGIptzBZis?t=17m (minute 17 and beyond).

'o' indicates has-a relationship

'-->' indicates pass by reference

Hope that helps =)

Community
  • 1
  • 1
  • 1
    I would not refer to `-->` as "pass by reference" -- it is declaring something more like a foreign key relationship in DB terms, or just a relationship in entity-relationship terms. Essentially it is a typed pointer to an instance. – Dan Selman Apr 25 '17 at 08:23
  • @DanSelman just quoting the text on the slide in the link provided :) – eladio_tercios Apr 25 '17 at 14:18