I am trying to model a part of my VUE app with UML. I used a class diagram to show the structure and a sequence diagram to show one specific behavior.
There are some things I am not sure about:
- in regards to the class diagram: the Formcopmonent imports the datacriteria, whos criterium is passed to the child and the option to the grand-child. So each instance of the childFormItemholds one criterium of criteria and each instance of the grandchildBaseRadioholds one option of the options array. So the data flow is through the parent. Can I still relatecriterium - FormItemandoption - BaseRadioas indicated by the blue composition arrows?
- in regards to the sequence diagram, my aim is to visualize the cross-component data flow and custom event communication with emitting events and passing props. I sketched these as synchronous messages, since they don't return anything but this feels weird?
- are the functions called within one component supposed to be reflexive messages? (as shown in the sequence diagram for setoption(option):voidfor example). And I guess the presentation of computed propertiesintegrationChanceandintegrationProspectPercentageas reflexive message is wrong, since they dont represent functions?
Here, the draft of the UML class-diagram sketching the VUE app:
And the sequence diagram:
And here the description of what this app does:
- The data for the function is imported as a JSON Object criteria.
- For each criterium (e.g. gender, age, etc.) criteriaholds an object namedcriterium, which has a label and an array options. The options array holds anoptionfor each attribute (male, female, etc.).
- Each optionhas a name (e.g. male) and a correspondent value (e.g. 0).
- The Formcomponent imports thecriteriaobject and two other components:FormItemandFormResultBar. The Form holds only oneFormResultBar. For eachcriteriumincriteriathe form holds oneFormItemand for eachoptiontheFormItemholds oneBaseRadiobutton.
- When the user clicks on a BaseRadiobutton, its computed propertyselectedValueemits an event to theFormItem, passing the value of the option that was clicked and the correspondentcriteriumKey.
- The FormItemcomponent then sets the selected option (setOption()) and saves it (saveOption(option, criteriumKey)by emitting an event to the parent componentFormand passing the parametersoptionandcriteriumKey. In the Form component thesaveOption(option, criteriumKey)saves the selectedOptionby storing it in the selections Object.
- The selections Object holds all the selected options for each criterium. The computed property integrationChanceinFormitem then calculcates the integrationChance by adding all the values of the options stored in selections. The methodintegrationChancePercentagetransform the logisitic regression value into percentages. TheintegrationChancePercentageis then passed as the prop “result” to theFormResultBar, where the result gets displayed.
You can find the implemented part of the application here.


