We have successfully implemented an interface using the Command Pattern. I had a sequence diagram in which I showed the commands on messages in order to express the interactions, but I created the message names and parameters manually (and they were notional for that reason).
I am now trying to update the sequence diagram so that the messages rigorously link to the proper model elements, but I am not sure how to do this (if it is possible, which regrettably it might not be).
So I have something like this:
Command class is abstract and any number of ConcreteCommand classes, each of which has its own unique attributes (if any).
I have a CommandSignal with an attribute command:Command.
I have two interfaces: ICommander, ICommandee, and on my sequence diagram ICommander sends a message to ICommandee.
Now I can define the message as type CommandSignal but then the message parameter is command, which isn't very useful on the sequence diagram.
I can instead define an operation on ICommandee that I call command(), but this doesn't have the parameter I want.
Or I can define a series of operations that I call concreteCommandA(), concreteCommandB(), etc., but if I define parameters of type CommandA, CommandB, etc., this doesn't help me with the parameter specification on the message either.
What I want, of course, is to have the message parameters from the proper ConcreteCommand class.
Is there a way to do this?
As I write, I suppose I could (haven't tried this yet) define the parameters on concreteOperationA to match those for ConcreteCommandA, but then if I change an attribute on ConcreteCommandA, then, unfortunately, concreteOperationA will not automatically follow suit.
Is there a better way?
Thanks!
Paul