next up previous
Next: Originator Application Up: Application Development Process Previous: Interface Specification

Implementation of ARC Object

Implementation of the interface is done in class Real in the namespace corresponding to user specified ARC interface. Skeleton of this class is generated from the ARC object interface. The architecture of the generated classes is discussed in next section.


namespace NSIMyObject{
   [Serializable]
   public class Real: PReal, IMyObject, ITrigger{
      public void Trigger(){
         Console.WriteLine(``This Message is Expected 
                                to be Displayed at Remote Node'');
         this.task(); //method to print Hello World!
      }
      public void OnReturn(){ }
      public void OnRetract(){ }
      public void task(){
         Console.WriteLine(``Hello World!'');
      }
      ... // implementation of IRefCount
   }
}

During implementation of Real, definitions of member functions need to be stuffed in by the programmer. Method Trigger() is automatically executed after the object migrates. In this example, method task() is called from within Trigger(). The code for class Real, which implements interface IMyObject is shown below. Notice that methods Trigger(), OnReturn() and OnRetract() are due to inheritance from interface ITrigger. The methods in interfaces ITrigger and IMyObject are to be implemented class Real.



R K Joshi 2003-05-08