There is no such thing as sending an async message over the web - it is just sending a message over the web, which is either request/command or a reply, if you will.įirst, we should focus on behavior (is there one or more response for a given request/command) and timing (how much delay do we expect) this is the high level takeaway of the interaction between A & B. It is an adjective that describes implementation detail and timing of external events relative to the internal threading design of either a client or a server, and evokes strategies to handle such events as the main program may be doing something else at the time.Īt the high level when talking about messages between client and server or two servers (and we are not diving into internal implementation details of either one) we can talk about one way messages, requests/commands (i.e. Async describes an event (message or otherwise) that happens independent of the main flow of the program (here, A or B). The term async doesn't really apply at this level. That means you have a book to hand new employees. If that standard comes out of some version of a UML book so much the better. The most important thing is that your shop have a standard way to do it so you can understand each other. When async is involved predicting object life time this way becomes very complicated. To depict flow of control and to predict object life time so you know when it's safe to delete them. Traditionally sequence diagrams have had two jobs. Really you have two different flows of control marching through A at that point. If you have a call back to A it makes more sense to have a 'return' arrow. In those cases the safest depiction is no return arrow at all. Most likely you don't even know which will happen. Your "or here" line tells me that when B terminates you expect A to have already terminated. Your "response here" line tells me that when B terminates you expect A to still be processing and, because you put it right at the end, to terminate when it see's B respond. Async doesn't really fit in this diagram because being async means you have your own damn y axis. In this metaphor a slant would be lag not asynchronicity. One thing you'll notice is that almost no one puts a slant on the arrows. I can prove this with a google image search. I'm not going to tell you how because every dang shop has their own way of doing them. Depending on the complexity of your program and what you wish to focus on, representing all Javascript objects involved in the canvas manipulation is perhaps not relevant.I used to draw these as part of my job. The subtle point is about identifying the other object making the call (and the original message timeline).įinally, choosing the scope of your diagram is an important step. Each method call is a message addressed to the object timeline. Here is one that could help you (sorry if you are already a Javascript expert).Įach object created should have its own timeline. Multiple documents detailing the basics of Javascript object creation are available. In such a case, the creation syntax is easier to identify. If you wish to create a sequence diagram, I guess you have quite rich objects with methods. Most objects only contain values: these have few interest in a sequence diagram as their interactions are limited to read/write operations. Javascript objects are not equals in quality. But identifying correctly an object creation can be quite challenging as there are multiple ways to do that. However, a sequence diagram is mainly behavioral with a few structural features. In a purely structural diagram such as a class diagram, a Javascript program would be very challenging to model. A class is a structure, more appropriate for static programming languages. Such a programming technique is more appropriated for dynamic languages as it focuses more on objects than on classes. JavaScript and UML are average companions because Javascript is not like traditional oriented languages as it is prototype-based. This is a subtle question: it all depends on what you wish to model.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |