nus-cs2103-AY1920S2 / forum

5 stars 0 forks source link

UML Sequence Diagram Lifeline #138

Closed alloystory closed 4 years ago

alloystory commented 4 years ago

WRT to UML sequence diagrams, is the lifeline for a particular object separate in the opt/ alt/loop frames?

specifcally let's say we have this code,

class Main {
    public static void main(String[] args) {
        int condition = 1;
        if (condition == 0) {
            System.exit(0);
        } else if (condition == 1) {
            System.exit(1);
        } else {
            // continue normal operation
        }
    }
}

how can we draw the alt frame for the main function then?

okkhoy commented 4 years ago

Hint: Lifeline remains the same.

Post what you have in mind here, I would like to see that before giving out an answer directly :-)

eugenetyc commented 4 years ago

Hi there!

Firstly, if the code segment you're describing is significant enough, then the guidelines for the DG have stated that these should be shown at an appropriate level.

Moreover, since they come in conditions, and are significant, then I believe they should be shown with the alt frame. Ultimately, we still are writing for possible future developers of our project, so it should be reader-centric: perhaps think: "Will I, as a new developer, need this or find this helpful?"

Cheers!

alloystory commented 4 years ago

@eugenetyc i am asking not in terms of the team project. i'm asking in terms about the concept.' @okkhoy never mind i confused myself. thanks prof for the hint! (: