I'm drawing an activity diagram to model a simple piece of code:
Subr(1, obj.Field1);
Subr(20, obj.Field2);
Subr(13, obj.Field3);
Subr(42, obj.Field4);
(Note that the real situation is more complicated, so a sequence diagram won't really work).
I have some questions on how to model this.
- For one, what's the difference between using activity parameters and embedded object nodes?
- I'd like to specify the details of "Subr" only once. Do I create one "Subr" activity and four instances of Subr?
- How do I model the setting of the first parameter to the constants? Should I use an invariant constraint on the activity parameter?
- How does one model passing a field of an object as an activity parameter (or object node)? Should I be using something like ReadStructuralFeature actions once for each field?
Thanks.