2.5 The Ensemble

Since the Ensemble is an abstraction modeling the operating system of a network host, there is a one-to-one correspondence between ensemble instances and network hosts. Below an abstract presentation of the ensemble pattern is shown.

ensemble: shell
  (# ...
     createShell:
       (# ...
          executableName: ^Text; 
          type: ##Shell; 
          sh: ^Shell;
       enter (executableName[],type##)
       do ...
       exit sh[]
       #);
     ns: @NameServer(# ... #)
  #)

Figure 2: Abstract presentation of ensemble

Part of the ensemble is a name server used as the starting point for distributed BETA processes to get in contact other processes. In a distributed system, there may be any number of network hosts, and in addition to mapping of textual object names to object references, the NameServer part ns has the responsibility of binding ensembles together. ns handles this responsibility by having default knowledge of other ensembles in the distributed environment. This means that if the ns.get operation is given e.g. the internet name of a network host, a reference to the corresponding ensemble instance is returned.

An important operating system task is the management of processes. Therefore, an important Ensemble attribute is the ability to create new Shell instances dynamically on the operating system represented. Ordinary BETA objects are created by instantiating patterns. However, as shells are operating system processes, they are created by instantiating an executable. The createShell attribute of ensemble takes the name of an executable and a pattern variable describing the subpattern of Shell of which the new shell process is expected to be an instance.

The following BETA code illustrates how to dynamically obtain a reference to the remote ensemble named daimi.aau.dk followed by the creation of a shell on this ensemble.

daimi: ^ensemble;
   cs: ^calcServer;
do ...
   (ensemble##,"daimi.aau.dk") -> myEnsemble.ns.get 
      -> daimi[];
   ('calcServer',calcServer##) -> daimi.createShell 
      -> cs[];


Distributed Objects in BETA - Reference Manual
© 1993-2004 Mjølner Informatics
[Modified: Monday October 23rd 2000 at 11:16]