Replies: 2 comments 3 replies
-
@ion-oset @stratofax Created an initial pass (it is just a starting point) at a UML at https://github.com/TrustTheVote-Project/VTP-web-api/blob/feature/12-add-uml-mermaid-diagram/docs/VTP-core-data-classes.md. It did not take long for me to hit some fundamental questions. I know this is a UML targeted to the VTP-web-api and hence is not a UML for the VoteTrackerPlus repo implementation, but I am confused regarding the line between data and 'action' (code). For example, in the current version of the above which is based on the current version of the VoteTrackerPlus repo, the tally operation returns/prints stream based IO. It is more like a syslog then a data structure. I don't think it is wise to try to replicate the logic in javascript or anywhere else and I don't think we have the time to change the format from syslog like to a proper data structure - this is a tally which is a function, not a data structure. If that is true (TBD), then the tally box will want something like verbosity which really speaks to 'code' as opposed to 'data'. In any case, I would like to hear comments and discuss what is there now before spending more time on it solo. |
Beta Was this translation helpful? Give feedback.
-
Here is a first pass at just the blank ballot first two endpoints. Note - the solid black diamonds are 'has-a' relationships (a.k.a. contains/references/composition) and the hollow arrows are 'is-a' relationships (inheritance) classDiagram
Choice *-- Selection
Ballot *-- Contest
Contest *-- Selection
Choice *-- Ticket
class Choice {
+String name
+String party
+Dict ticket
+String choice_type
}
class Selection {
+Int index
+String name
}
class Ticket {
+String name
+String party
}
class Contest {
+List choices # order is important
+String vote_variation # RCV, plurality
+String uid # unique to election only
+Float win_threshold # default = 0.5
+Int votes_allowed # defines overvote
+String write_in # unimplemented
+List selection # index + name
}
class Ballot {
+List active_ggos # order is important
+Dict contests # ordered by active_ggos
+String ballot_status # blank or cast
}
|
Beta Was this translation helpful? Give feedback.
-
Updated class diagram from TrustTheVote-Project/BallotLab#81 (reply in thread)
Notes
ContestData
for the real contest data types.BallotStyleData.contests
has to be a union of the contest types because contests are a mix of possible contest types, and splitting them would lose their ordering.PartyData
type is used because it's easier to manage than having it be a dictionary.ballot_scopes
is a list of theGpUnit
s theBallotStyle
refers toBallotStyleData.id
is theBallotStyle.ExternalIdentifier.Value
. (There is no@id
forBallotStyle
s.)Beta Was this translation helpful? Give feedback.
All reactions