My design has many exception messages being thrown. I am looking for a
way to represent this exceptin messages in the sequence diagram.
I am not sure whether it is not supported by UML2.0 itself, or by
Borland Together Architect design tool, I am using.
Please let me know your idea.
Thanks,
Arun
> My design has many exception messages being thrown. I am looking for a
> way to represent this exceptin messages in the sequence diagram.
>
An exception message is just another message between objects. So it
would look the same in a sequence diagram as any other collaboration
message. IOW, the SD does not imply any special implementation semantics
to the message context; that is supplied by the developer
methodologically when selecting the message name.
I am somewhat concerned by the fact that your design has "many"
exception messages. That sounds suspiciously like you are making use of
an OOPL's exception processing mechanism (e.g., try/throw in the C-based
languages) for routine business logic. If so, I would strongly advise
against doing that. The dedicated exception processing facilities of a
3GL are intended to deal with the situation where the software has
reached an undefined state and results may be incorrect. IOW, it allows
recovery or a graceful abort when the software itself is broken.
There are two problems with using exception processing infrastructure
for business logic. One is that the more bulletproof it is, the more
overhead it carries compared to normal flow of control. For example,
Ada's exception handling will work correctly when you really, really
need it but it is a real pig; OTOH, C++'s exception handling is fairly
efficient but it will usually also be broken when you really, really
need it. The second problem is the exception handling involves a
"sideways" exit from the normal flow of control. Such exits usually
result in code that is difficult to maintain and tends to be unreliable.
So if the "exception" you are processing is anticipated explicitly in
the requirements or implicitly in the problem domain (e.g., human user
make errors in data entry), then it should be handled in a routine
fashion by the application's normal flow of control rather than using
exception processing infrastructure. IOW, you need to specifically
design for it like any other business requirement rather than leaning on
the Crutch of Convenience and using the exception processing simply
because it is handy.
Note that this ties back to the original point that an exception message
is just another message. It would look the same in the SD if it were a
throw or a call to some object that has the responsibility of dealing
with the problem. That is, processing the problem is a pattern with
three steps: (1) detect the problem; (2) notify some entity that can
deal with it; and (3) provide a resolution. Sending a message in (2) is
the same whether or not one uses built-in exception handling facilities.
The only difference is the way handling is implemented at the OOP level
so there is no reason for the OOA/D to distinguish those implementations
and the notification message looks like any other message.
--
Life is the only flaw in an otherwise perfect nonexistence
-- Schopenhauer
H. S. Lahman
H.la...@verizon.net
software blog: http://pathfinderpeople.blogs.com/hslahman/index.html
| As H.S. says below, language-based exceptions are identical to any other messages on a sequence diagram. I sometimes recommending creating a new stereotype for a project to indicate that a particular message is being processed by the exception mechanisms <<exception>> message name.... The real purpose for this is to flag to the sequence diagram reviewers that you're possibly overdoing the use of exceptions. In activity diagrams there are mechanisms to indicate that an exception can interrupt processing and that exception tokens may carry different data than tokens from normal processing. However, these are advanced techniques, not normally applied by newbies, and don't change how the situation would be shown on a sequence diagram Michael --- On Sat, 3/13/10, H. S. Lahman <h.la...@verizon.net> wrote: |
Date du message : mars 12 2010, 11:48 PM
De : "Arunkumar S" <arunkumar...@gmail.com>
A : "UML Forum" <umlf...@googlegroups.com>
Copie :
Sujet : [UML Forum] Representing exception message in sequence diagram
Hi,
My design has many exception messages being thrown. I am looking for a
way to represent this exceptin messages in the sequence diagram.
I am not sure whether it is not supported by UML2.0 itself, or by
Borland Together Architect design tool, I am using.
Please let me know your idea.
Thanks,
Arun
--
You received this message because you are subscribed to the Google Groups "UML Forum" group.
To post to this group, send email to umlf...@googlegroups.com.
To unsubscribe from this group, send email to umlforum+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/umlforum?hl=en.
Raphaël Faudou
Innovation & method definition
Critical systems
Atos Origin Integration