dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Message passing between webservices


From: Peter Minten
Subject: [DotGNU]Message passing between webservices
Date: Sat, 11 Jan 2003 17:39:32 +0100

Hi folks,

in the current DotGNU scheme the client UI libs work with message passing but
webservices work with procedure calling. However it makes sense to use message
passing for webservices too. The message passing mechanism I have in mind is an
variant of the FOX system. I don't simply copy the FOX mechanism because it's
optimised for GUI work, webservices require a different approach.

It works like this: you don't specify variables, constants and methods but
specify members. With message passing every object has only members. You can
send a variety of messages to a member, a simple example is this list:
* GET
* SET
* INVOKE
The handler looks like this: handle(targetname, member, message_type,
custom_data). It returns a 2 part array,
the first element is a possible returned value (else NULL), the second element
is the changed data (or if no change NULL).

Doesn't seem very impressive? I agree fully. The cool part is under the hood.
This could be an implementation of a class using message passing:

[mp]
[description="Example class"]
class Foo
{
  [description="DotGNU RULES"]
  public int A
  {
    [description="Get value, returns null if value > 10"]
    get
    {
      return value
    }
    [description="Set value, returns exception if value > 10"]
    set
    {
      a = value      
    }
  }

  [description="The next big thing after A"]  
  public void B()
  {
    //Do something
  }

  [mp=false]
  public int C()
  {
    //Do something
  }
}

In this example a and b are accessible using messages. A responds to get and
set, B responds to invoke, other messages will be simply ignored. The metadata
is also accessible using messages. I'd set the value of A in an object of this 
class using: handle("FooObject", "A", SET, 5), that's it.

As you can see using messages isn't time-consuming, you only write [mp] on top
of every class you want to publish and [mp=false] for every method in a
published class you don't want to publish. But the message passing system
clearly wins in terms of object oriented, XMLRPC isnt. Also message passing +
metadata allows the construction of shadow objects.

Greetings,

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]