[
Back ]
-- ail.rpd
-- michael chen
-- this program correctly runs an "interpretation" of the AIL
-- communication architecture; the animation can be viewed using
-- raptor and ail.arch
-- three separate event sequences are generated: 1) client requests a
-- web document and the http server delivers it 2) when the client
-- requests the document, an address location is sent to the www logfile
-- and tracker 3) the client sends some sort of action request to the
-- server (e.g., add node, open graph) and the server in turn sends
-- event procedures to the postgres database, the coaching tutor and
-- the connection manager. these actions ultimately result in the client
-- receiving a response from the server and coaching advice from the tutor.
-- client modules
type WebBrowser is interface
action in ReceiveWebDocument();
out RequestWebDocument(), SendAddressLocation();
behavior
begin
start ||> RequestWebDocument;;
start ||> SendAddressLocation;;
end WebBrowser;
type JavaTools is interface
action in ReceiveServerResponse(), ReceiveCoachingHelp();
out SendActionRequest();
behavior
begin
start ||> SendActionRequest;;
end JavaTools;
-- client architecture
type Client is interface
action in InWebDocument(), InServerResponse(), InCoachingHelp();
out OutActionRequest(), OutDocumentRequest(), OutAddress();
end Client;
architecture ClientArch() for Client is
WB : WebBrowser;
JT : JavaTools;
connect
WB.RequestWebDocument ||> OutDocumentRequest;
WB.SendAddressLocation ||> OutAddress;
InWebDocument ||> WB.ReceiveWebDocument;
JT.SendActionRequest ||> OutActionRequest;
InServerResponse ||> JT.ReceiveServerResponse;
InCoachingHelp ||> JT.ReceiveCoachingHelp;
end ClientArch;
-- server modules
type HTTPServer is interface
action in ReceiveDocumentRequest(), ReceiveQueryResult(),
ReceiveReturnCode(), ReceiveActionRequest(), ReceiveAddress();
out SendWebDocument(), SendServerResponse(), SendQueryOrUpdate(),
NotifyActionToCoach(), NotifyActionToConMan(),
SendAddressToLog();
behavior
begin
ReceiveAddress ||> SendAddressToLog;;
ReceiveDocumentRequest ||> SendWebDocument;;
ReceiveActionRequest ||> SendQueryOrUpdate;;
ReceiveActionRequest ||> NotifyActionToCoach;;
ReceiveActionRequest ||> NotifyActionToConMan;;
ReceiveQueryResult ||> SendServerResponse;;
end HTTPServer;
type WWWLogfile is interface
action in ReceiveHTTPAddress();
out SendAddressToTracker();
behavior
begin
ReceiveHTTPAddress ||> SendAddressToTracker;;
end WWWLogfile;
type WWWTracker is interface
action in ReceiveAddress();
end WWWTracker;
type Postgres is interface
action in ReceiveQueryOrUpdate(), ReceiveCoachQuery();
out DispatchQueryResultToCGI(), DispatchQueryResultToCoach();
behavior
begin
ReceiveQueryOrUpdate ||> DispatchQueryResultToCGI;;
ReceiveCoachQuery ||> DispatchQueryResultToCoach;;
end Postgres;
type StudentModelingCoaching is interface
action in ActionNotification(), ReceiveQueryResult();
out SendHelpToClient(), SendQuery();
behavior
begin
ActionNotification ||> SendQuery;;
ReceiveQueryResult ||> SendHelpToClient;;
end StudentModelingCoaching;
type ConnectionManager is interface
action in ActionNotification();
end ConnectionManager;
-- server architecture
type Server is interface
action in InActionRequest(), InDocumentRequest(), InAddress();
out OutWebDocument(), OutServerResponse(), OutCoachingHelp();
end Server;
architecture ServerArch() for Server is
HTTP : HTTPServer;
LOG : WWWLogfile;
TRAC : WWWTracker;
POST : Postgres;
COACH : StudentModelingCoaching;
CONMAN : ConnectionManager;
connect
HTTP.SendWebDocument ||> OutWebDocument;
InAddress ||> HTTP.ReceiveAddress;
InDocumentRequest ||> HTTP.ReceiveDocumentRequest;
InActionRequest ||> HTTP.ReceiveActionRequest;
HTTP.SendServerResponse ||> OutServerResponse;
COACH.SendHelpToClient ||> OutCoachingHelp;
HTTP.SendAddressToLog ||> LOG.ReceiveHTTPAddress;
LOG.SendAddressToTracker ||> TRAC.ReceiveAddress;
HTTP.SendQueryOrUpdate ||> POST.ReceiveQueryOrUpdate;
POST.DispatchQueryResultToCGI ||> HTTP.ReceiveQueryResult;
HTTP.NotifyActionToCoach ||> COACH.ActionNotification;
COACH.SendQuery ||> POST.ReceiveCoachQuery;
POST.DispatchQueryResultToCoach ||> COACH.ReceiveQueryResult;
HTTP.NotifyActionToConMan ||> CONMAN.ActionNotification;
end ServerArch;
-- ail super architecture
architecture ail()
is
C : Client is ClientArch();
S : Server is ServerArch();
connect
C.OutDocumentRequest ||> S.InDocumentRequest;
C.OutAddress ||> S.InAddress;
C.OutActionRequest ||> S.InActionRequest;
S.OutWebDocument ||> C.InWebDocument;
S.OutServerResponse ||> C.InServerResponse;
S.OutCoachingHelp ||> C.InCoachingHelp;
end ail;
[
Back ]