As we know in UML class diagram concept that composition is when the class really depends on other class. It means that strong ownership. How to represent a strong ownership between template in DAML code?
Sorry for the basic questions. But I really want to learn about this.
Your answer would be very useful for me.
key._1 selects the first element of the tuple key. In your case, the key is a tuple of (organizer, voter, doodleName) so it will select the organizer. The reason for the slightly weird syntax as opposed to just writing organizer is that the maintainers need to be inferrable from just the key without the template argument.
voter :: voters creates a list where the first element (head) is voter and the rest of the elements (tail) is voters. So it prepends a voter to the existing voters.
mapA : (a -> Update b) -> [a] -> Update [b] allows you to apply an effectful function to each element in the list and get back the results. In this case, that effectful function creates a contract for each voter. mapA is actually a bit more general than the type above and can be used for Script or even Optional and other effects.
I don’t think UML really translates to functional languages particularly well. Rather than asking how to represent UML terminology in DAML can you describe what underlying problem you are trying to solve?
Hi @cocreature !
Thank you for your reply. Very helpfull for me.
Yah sure, but I thought that I need to find an approach to communicate a DAML code into business user So they can understand easily.
But your suggestion also makes sense. I want to solve the optimization cash between branches (in bank’s operational) and I will back to this forum soon, if I face a problem