Definition of two components

We define a new component called Display that provides an LCD interface as a facet. The Hello component uses the LCD interface as an receptacle. Note that a facet to receptacle connection can only be established when both ports handle the same interface.

    interface LCD {
      void display_text(in string s);
    };

    component Display {
      attribute string prompt;
      provides LCD lcd;
    };

    home DisplayHome manages Display {
    };


    interface Console {
      long println(in string s2);
    };

    component Hello {
      provides Console console;
      uses LCD lcd;
    };

    home HelloHome manages Hello {
    };

As long as we define the components in the same file, we have the same file structure as before:

        hello/
        |-- Hello.idl



2003-11-09