i'm make a sequence diagram for the registration process to a website. The registration should include the following information:
This is the sequnce diagram I made:
is the sequnece correct? and do i need to make the the username and phone number messages in a alternative to indicate that they are optional or not?
Basically your SD is almost correct. The fragments need to indicate the type in a tab top left which in this case would contain alt
and also the constraint in square brackets to show the condition.
However, SDs are not meant for graphical programming. What you intend to show is better served in an activity diagram which focuses on business aspect (dialogs and their conditional order). An SD is useful to show complex communication between instances. Fragments should only be used sparse. The above would (in terms of implementation) better be shown in (abstract) code fragments, if ever. Any coder would prefer to look into an AD and go from there. Also think: cui bono? Who has use of it?