-- Binding for video on demand using RPC and VideoTape modules. -- -- $Id: videoOnDemand.fin,v 1.1 1997/11/24 03:49:08 andyb Exp $ Binding VideoOnDemand { Import RPC, VideoTape; Roles { MovieBuff { -- MovieBuff does a search RPC to get a list of available videos matching -- a search pattern search {RPC.client((p:pattern),(a:availability_list))} -> -- then a video is selected select!(title) -> -- and a video stream started VideoTape.consumer } MovieDatabase { -- Movie database responds to a search RPC by replying with list of -- titles matching a search pattern search {RPC.server((p:pattern),(t:title_list))} } VideoStore { -- the VideoStore responds to a check RPC by giving a list of available -- videos as (title, cost) tuples check {RPC.server((t:title_list),(a:availability_list))} -> -- when a title is selected, the store plays it select?(title) -> VideoTape.producer(v:VideoData) } } Interactions { -- Although the MovieDatabase, VideoStore and MovieBuff all use RPC -- protocols, the results of the MovieDatabase search request are passed -- directly to the VideoStore check service, which in turn replies to the -- MovieBuff. This is possible because Finesse decouples outputs and inputs -- at various interfaces, leaving the routing decisions to the middleware -- program. In this case, it saves the MovieBuff executing an additional, -- redundant RPC. The '*=prev' indicates that the parameters of requests -- are passed with name equivalence - input parameters get the value of the -- previous output parameter with the same name. MovieBuff.search.send -> MovieDatabase.search.receive {*= prev} -> MovieDatabase.search.send -> VideoStore.check.receive {*= prev} -> VideoStore.check.send -> MovieBuff.search.send {*= prev} -> -- The MovieBuff selection is passed to the videostore, and a nested -- VideoTape binding is established to play the video. MovieBuff.select -> VideoStore.select{title = prev.title} -> VideoTape(MovieBuff, VideoStore) } -- -- Revision history: -- -- $Log: videoOnDemand.fin,v $ -- Revision 1.1 1997/11/24 03:49:08 andyb -- Initial version used for OMG/DARPA workshop position statement. -- --