Tuesday, July 08, 2008

Sequence diagram a elaboration on its limitation.

Last post raised some interesting questions by a reader . it was a) why does a sequence diagram force sequentiality? and b) what is the problem with bob becoming also a cook tomorrow?.Let me elaborate on each of these points here.

I will first address the first question. But to address this i would like to elaborate on sequence diagram a bit. A sequence diagram depicts how a usecase is realized by depicting the objects and how they collaborate to complete the usecase.The sequence diagram has arrows which represent messages, i.e the arrows represent how message is exchanged between objects. But there is a implicit time ordering, i.e the messages are time ordered and is assumed to start from top and goes in a Left to right and top to bottom (LRTB). The sequence diagram uses a construct called "par" to depict parallelism. As depicted picture in the post, the arrows (in combination with activation boxes) depict control. I.e how one method or message is preceded by another,in a single thread.&nbsp. This implicit time ordering in a sequence diagram makes the sequence diagram sequential.

Elaborating more on this and to answer the second question, i would like to take the instance (refer to the same figure mentioned in the post) of the object Waiter becoming a cook. the object waiter in the picture is capable of two methods order food and Serve fine after it is activated with the orderFood method. So the developed code is Waiter.OrderFood; Cook.OrderFood; Waiter.Pickup; Waiter.ServeFood. Once this waiter adds the capability of a cook, then this sequence diagram and the code that it generates needs to be reworked, without which this new capability will not be added to the sequence. i.e the whole code, which is what a sequence diagram is, needs to be reworked and retested, leading to very expensive SDLC costs.

But, new minituarisation and networking technologies, is bringing in new expectations and possibilities or new waves of technolgies like WEB 3.0. Some of the technolgies that are being discussed are a) Webtops, b)Mashups, and c).Semantic service oriented architectures. These technologies are parallel technologies and cannot be explained with sequence diagram, they need more of a concurrent representation. This i believe is the fundamental limitation of a sequence diagram.