Formal dialogues a new approach to remote object communication



Yüklə 343 Kb.
tarix07.11.2018
ölçüsü343 Kb.
#78334


Formal dialogues

  • A new approach to remote object communication

  • implemented as an extension to C# on ROTOR/.NET

  • Raphael Güntensperger

  • Jürg Gutknecht

  • ETH Zürich


Agenda

  • Overview

  • Concepts

  • Model

  • Implementation

  • Development platform for tiny devices (outlook)



Overview

  • Communication model

  • Formal dialogues

  • Syntactic integration in C#



Concepts

  • Motivation

    • Autonomous behavior of hardware objects
      • Independent activities
      • Asynchronous execution
      • Example: Clock
    • Rich interface to the environment
      • More than only a set of methods
      • Dialog-based interfaces
      • Objects have a status


Concepts

  • A new model for remote objects

    • Active Objects (activities)
    • Formal Dialogues (channels)
    • Universal encoding of syntactic Tokens
    • No: RPC, RMI, IDL, Proxies, Marshalling
  • Optimal Support by C# and .NET runtime

    • Compiler integration
    • Small library (System.Channels)


Concepts

  • Activities

    • Separate thread of control
    • Member of a class
    • Started at instantiation time of the object


Concepts

  • More about activities

    • No activity, one or more activities per class
    • Derived classes can define their own activities
    • All activities are started at instantiation time (incl. Base class activities) and run in parallel


Concepts

  • Channels

    • Vehicle for the implementation of formal dialogues
      • Channel type formal dialogue Interface
      • Channel instance dialogue in execution
      • Channel implementation syntax parser


Concepts

  • More about channels

    • Remote Interface of an object
    • Channel instances run in separate threads
    • Opened and closed by a client
    • Member of a class
    • In contrast to activities:
      • controlled by client
      • one instance (thread) per connection
      • communication capabilities (through accessors)


Concepts

    • Communication follows a formal dialogue
    • Parser defines semantic actions
    • Strongly typed tokens
    • Dialogue has its own status


Concepts



Concepts

    • Example:


Concepts

  • Advantages to Remote Method Invocation:

    • Sender is not blocked
    • State of the dialogue is completely captured by the channel
    • Tokens are typed by the underlying grammar and encoded according to universal rules.


Model



Model

  • Channel accessors:

    • open Instantiate channel, invoke parser
    • close abort parser thread
    • send pass token to buffer of remote channel
    • receive read token from buffer of remote channel
    • put pass token to internal channel buffer
    • get read token from internal channel buffer


Model



Model



Model

  • Gateway channels

    • Abstraction of a remotely available channel in the clients address space
    • ONE gateway (instead of proxies)
    • Implemented as member of channel manager
      • ChannelManager.RemoteChannel
    • Buffer content is directly sent to the remote channel manager and vice versa


Model

    • Transmit Buffer-Content by channel manager
    • Channel instances are identified by GUID


Model

  • Home Channel:

    • Query for implemented protocols
    • Implicitly implemented (by the compiler) for any channel provider
    • Provides a query mechanism comparable to COM (IUnknown)
    • Behaves exactly like any other channel but follows a fixed syntax
  • Syntax

    • List names of implemented channels


Implementation (Compiler)



Implementation (Compiler)

  • Threading model

    • Thread represents channel instance
    • Buffer references stored relative to thread context
    • Thread is started by open accessor
  • Code example



Implementation (Library)

  • Token

    • Map a set of basic types: char, int, long, float, double, keyword, string, bool, block, escape
    • Define their own encoding
      • Basic Format: tagByte { dataByte }
      • Shortest encoding for most frequently used types
      • Use value bits in the tag byte (for small data types)
  • Buffer

    • Ring-buffer implementation
      • enlarged automatically if the get full
    • Limit can be specified


Implementation (Library)

  • Channel manager

    • Responsible to handle channel instances and map their corresponding parts (local/remote)
    • Defines gateway channel
    • Channel manager messages:
      • Open/Close requests
      • Data transmission
      • Close enquiry
      • Acknowledgements


Implementation (Library)

  • Transport manager

    • Abstract class
      • Must be implemented for a specific technology
      • Current implementations: TCP/IP, Nullmodem
    • Must provide reliable transmission of encoded data
    • Destination


Implementation (Compiler/Library)

    • Implicit interface for channel providers
      • Defined in library, implemented by compiler
    • ChannelManager calls OpenChannel method of specific channel implementation
    • OpenChannel method
      • Implicitly generated by the compiler
      • Maps channel names to channel types
      • Returns buffer and thread references by ChannelNode structure


Implementation (Example)



Development platform for tiny devices (outlook)

  • Cross compiler: IL StrongARM

    • Limited to the functionality demanded by tiny devices
  • Device represents active object

  • Implement a specific transport technology

    • Bluetooth / Smart-Its (University of Karlsruhe)
  • ‘Burn’ mechanism invokes cross compiler and builds operating system environment of the small device



Reference

  • .NET Developer’s Journal, Volume 01, Issue 3

    • A New Approach to Remote Object Communication
      • http://www.sys-con.com/dotnet/


Yüklə 343 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə