Next: 3 Case Study: The
Up: 2 Position
Previous: 2.2 Connectors
functor Component1 (Connector: Interface1) : sig val proc : ; end = struct ( hidden internal structures ) fun proc () = ... end;
The process proc created by the component can be executed both sequentially and in parallel according to the application. Connector is the formal name for a connector which connects Component to the interacting component through Interface. The number of the connectors in the parameter list of this functor is the number of inward stubs in its pattern, as shown in the following examples.
functor Component2 (Connector: Interface2) : sig val proc : ; end = struct ... end;
The specific components, C1 and C2 in Figure 1, are given by:
structure C1 = Component1();It is not difficult to derive the semantics of an Application module from the definitions of the connector and the component in terms of a ML functor:
structure C2 = Component2();
functor Application (Connector: Interface) :The introduction of the Application module makes the notation more expressive, as illustrated in the following section. In an object-oriented system [Booc86,GHJV95], it is often the case that an object uses another object in order to provide a new service.
sig
val input : ;
val output : ;
end
=
struct
( implementation of the input and the output functions )
end;
Hongyan Sun and Anders P. Ravn