[erlang-questions] UML or other modeling tools
Ulf Wiger
ulf.wiger@REDACTED
Sat Jan 15 21:36:26 CET 2011
It's not an entirely easy question to answer, because there are (at least)
three levels to consider:
- what the UML standard says
- *which version* of the UML standard (since there are semantic differences)
- what the specific tool actually supports
The UML standard doesn't specify in which order state machines
should process messages, but in practice, this usually means FIFO.
Messages are processed with run-to-completion semantics, so so
far, it's pretty similar to Erlang's gen_server.
However, there is no selective receive support in UML. You can specify
an event as 'deferrable' in a given state (this is not exactly prominent
in the spec, and not all tools support it). You can also explicitly defer
and recall messages.
One consequence of this is that it's near impossible to model a
generic RPC* in UML. In UML 2.0, there is a synchronousCall()
method, so you can get by to some extent anyway…
* or gen_server:call()
UML's method of tackling state machine complexity is to support
hierarchical state machines, but this mainly gives some modularity
assuming that the order of messages is ok; it cannot really help
you if messages can arrive out of order or in undefined order.
BR,
Ulf W
On 14 Jan 2011, at 01:46, Geoffrey Biggs wrote:
> On 09/01/11 23:06, Ulf Wiger wrote:
>> - The things most interesting to model in an Erlang program are the
>> state machines and the interaction between processes, but UML
>> state machines have very complex - and most importantly, *different*
>> - semantics, making it quite probable that the design becomes subject
>> to compromises forced by the modeling tool, rather than reflecting the
>> power of the programming language.
>
> I wonder if you could expand on what these differences are. As a novice
> at both UML and Erlang, I don't want to fall into any traps caused by
> making false assumptions.
>
> Geoff
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com
More information about the erlang-questions
mailing list