Open ikitommi opened 3 years ago
1) Do you have any proposition regarding how to restructure the code? Currently the md/-get-links
returns shape like this:
["OrderLine" #{"Burger"}]
... so perhaps it might be changed so that it becomes set of maps containing more details about each individual "to" side of that link? Something like:
["OrderLine" #{{:entity "Burger", :cardinality :one, :optional false}]
2) what are the "rules" for deriving cardinality of those links? My very wild quess:
:sequential
, :vector
or :set
-> 1..*
in UML diagram:maybe
followed by :sequential
, :vector
or :set
-> 0..*
:maybe
cases -> 0..1
1
Unfortunately I don't know much malli
yet, to the problem might be way more complex than I'm currently imagining.
3) I wonder if result like this one looks OK. (I added a few more relations to OrderLine
just to see what happens if there's more links between two entities)
something like that. Collection schemas have :min
and :max|
props that can be used. Sequence (regex) schemas already have m/-regex-min-max
method to figure out their limits.
Interested on doing a PR for this?
Btw it would be also nice if the association lines had cardinalities (0..1 / 1 / 0..*) on the "arrow side". But it seems that md/-get-links only provides the from-to entity names (such as ["OrderLine" #{"Burger"}] ), not the cardinality. Or is there any easy way of finding out the cardinality of the relation between entities?