logo       


Re: Questions and discussion on UBF: msg#00408

Subject: Re: Questions and discussion on UBF
Hi Fabien,

Quite a lot to chew on -- I'll bite off just one piece!

On Monday, April 28, 2003, at 07:16 AM, Fabien Dagnat wrote:

Hello,
As I am working on using contracts on component (or service, if one prefer) oriented specifications, I'm looking at UBF.


I'm asking myself why allowing any type for messages in the contracts. I know that this is linked with the fact that in Erlang a message may be of any type. But:
  - a programming rule specifies that all messages should be tagged.
  - as a "universal" format, it should conform to other language
    culture too.
Indeed, in a more abstract view (than erlang usual one), it would be "better" to name (give a tag) messages (from a specification point of view). Combined with some (yet to completly implement) type system, it would perhaps be possible to ensure that a server respect its contracts...

I think I see what you mean here, but please correct me if not. This would basically be extending the UBF(C) from

  Msg$  => {Reply, NextState}$

to

  {SendTag, Msg}$ => {ReplyTag, Reply, NextState}$

In short, I think this would start breaking down the simplicity of UBF. Can't you get that just by always using types which are structures, and having the first element be a constant which serves as your tag?




My second question is why just allowing named type in the automaton description.
More precisely why not having something like:
+STATE start
       ls            => files()     & start;
       {get, file()} => binary()    & start
                     | noSuchFile() & stop.
Is there any technical (or philosophical) limitation that I haven't thougth of? I think it would save type definitions and help reading the automaton (without always shifting to type definitions to remember what are the message types). I know that the current syntax is similar in this point to the message definition in WSDL, but I don't see WSDL as a panacea of XML encoding of interfaces.

Next, to go back to my point on universality. Why not having:
+STATE start
       ls()                 => files()     & start;
       get(file : string()) => binary()    & start
                            | noSuchFile() & stop.
My point here is that I would like to add to the contract some pre and post conditions and to do this usually we have to refer to some arguments of the message. Furthermore, to do this, I would like to add some state variables to the state.
For exemple, a bank account contract could be:
+STATE start
  open() => ok() & created.
+STATE created
  deposit(sum : int()) => ok() & credit(sum).
+STATE credit(balance : int())
  deposit(sum : int())  => if (sum > 0) ok() & credit(balance + sum);
withdraw(sum : int()) => if (sum <= balance) ok() & credit(balance - sum); balance() => {ok, sum} with sum = balance & credit(balance).

I don't advocate that this is a great example of the interest of pre and post conditions. But, I think it is sufficiently interesting to illustrates what I was thinking of.

It is clear that this way of thinking contracts embed a lot more (behavioral) semantics that the current UBF. Indeed, it shift some part of the server state to the "contract checker". But, it could gave some interesting property like the fact that the "contract checker" could use several servers giving them the needed state with the message (we would get some fault tolerance or some load balancing capacity).

Finally, why not allowing a return state in the ANYSTATE declaration. Suppose, I would like to have a stop message available in all states that brings the server in a stopped state. For example,

+STATE stopped
  start() => ok() & s1.
+STATE s1
  ...
+STATE s2
  ...
+ANYSTATE
  stop() => ok() & stopped.

Thanks in advance for any answer, opinion, criticism...

Fabien
--
Fabien Dagnat -- Maître de Conférences
 Mel : Fabien.Dagnat@xxxxxxxxxxxxxxxx
 Web : perso-info.enst-bretagne.fr/~fdagnat/index.php
 Tel : (0|33) 2 29 00 14 09
 Fax : (0|33) 2 29 00 12 82
 Adr : Ecole Nationale Superieure des Télécommunication de Bretagne
       Departement Informatique
       Technopôle Brest Iroise
       BP 832
       29285 Brest Cedex



Erik Pearson
Adaptations
desk +1 510 527 5437
cell +1 510 517 3122




Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe