nus-cs2103-AY2324S2 / forum

16 stars 0 forks source link

Why is constructor activation bar not provided? #1054

Closed justincred closed 6 months ago

justincred commented 6 months ago

image

Why is the constructor of C not provided given that its created when the method is called below image

baskargopinath commented 6 months ago

activation bar is optional but showing that s exists before c is not

justincred commented 6 months ago

does this only apply when creating the object as the function is pointed to the box containing the class name so it has to be positioned lower?

justincred commented 6 months ago

like for example, in here its the same level image

jinhanfromNUS commented 6 months ago

Umm, you may say that.

Personally, I fell that another way to say it more accurately is, due to the creation of Client object c is later than Server object s, so it needs to be positioned lower than s.

If there are two object creations, let's say a and b where a is created before b, then it b shall be positioned lower than a.

The reason why s is positioned higher than c is because s already existed before c is created.

damithc commented 6 months ago

Personally, I fell that another way to say it more accurately is, due to the creation of Client object c is later than Server object s, so it needs to be positioned lower than s.

If there are two object creations, let's say a and b where a is created before b, then it b shall be positioned lower than a.

The reason why s is positioned higher than c is because s already existed before c is created.

Yup. Everything that existed at the start should appear at the top, at the same level. Anything that was created during the interaction should appear lower, in order they were created (created later means positioned lower). This is because time flows in the downward direction.

justincred commented 6 months ago

thanks!