Тема 3. Ролевой анализ Цель: - научить читать ролевые модели - научить составлять ролевые модели Побочные цели: - показать дополнительные примеры диаграмм взаимодействия Содержание Приложение 1. Контекстная и ролевая диаграммы в графическом представлении Приложение 2. Контекстная и ролевая диаграммы в текстовом представлении Приложение 3. Спецификации сценариев в виде диаграмм взаимодействия в графическом представлении Приложение 4. Спецификации сценариев в виде диаграмм взаимодействия в текстовом представлении Приложение 1. Контекстная и ролевая диаграммы в графическом представлении (отдельно) Приложение 2. Контекстная и ролевая диаграммы в текстовом представлении BLOCK vmk; /* context specification */ SUBSTRUCTURE vmk; BLOCK vmk_system REFERENCED; BLOCK vmk_client; ENDBLOCK; BLOCK mgu; ENDBLOCK; CHANNEL client_interface FROM vmk_system TO vmk_client WITH ; FROM vmk_client TO vmk_system WITH ; ENDCHANNEL; CHANNEL mgu_interface FROM vmk_system TO mgu WITH ; FROM mgu TO vmk_system WITH ; ENDCHANNEL; ENDSUBSTRUCTURE vmk; ENDBLOCK vmk; BLOCK vmk_system COMMENT from block vmk; /* use case specification */ SUBSTRUCTURE vmk_system; BLOCK receive_broken_unit; ENDBLOCK; BLOCK return_fixed_unit; ENDBLOCK; BLOCK send_report; ENDBLOCK; CHANNEL r1 FROM ENV TO receive_broken_unit WITH ; FROM receive_broken_unit TO ENV WITH ; ENDCHANNEL; CHANNEL r2 FROM ENV TO return_fixed_unit WITH ; FROM return_fixed_unit TO ENV WITH ; ENDCHANNEL; CHANNEL r3 FROM ENV TO send_report WITH ; FROM send_report TO ENV WITH ; ENDCHANNEL; CONNECT client_interface AND r1, r2; CONNECT mgu_interface AND r3; ENDSUBSTRUCTURE vmk_system; ENDBLOCK vmk_system; Приложение 3. Спецификации сценариев в виде диаграмм взаимодействия в графическом представлении (отдельно) Приложение 4. Спецификация сценариев в виде диаграмм взаимодействия в текстовом представлении MSCDOCUMENT vmk_system; /*--------------------------------*/ MSC receive_broken_unit; INST client : vmk_client, receive_broken_unit; INSTANCE client : vmk_client; OUT unit TO receive_broken_unit; IN receipt FROM receive_broken_unit; ENDINSTANCE; INSTANCE receive_broken_unit DECOMPOSED; CONDITION receive; IN unit FROM client; ACTION register unit; OUT receipt TO client; ACTION fix unit; CONDITION receive; ENDINSTANCE; ENDMSC; /*-----------------------------------*/ SUBMSC receive_broken_unit COMMENT from msc receive_broken_unit; INST office : vmk_office, alarm, order : vmk_order, courier_1 : vmk_courier, courier_2 : vmk_courier, master : vmk_master; INSTANCE office : vmk_office; CONDITION receive; IN unit FROM ENV; ACTION register unit; ACTION estimate T; OUT receipt TO ENV; CREATE alarm ( T ); CREATE order ( unit ); CONDITION receive; ENDINSTANCE; INSTANCE alarm; SET time_to_fix ( T ); TIMEOUT time_to_fix; OUT time_out TO order; STOP; ENDINSTANCE; INSTANCE order : vmk_order; OUT unit TO courier_1; CONCURRENT; IN unit FROM courier_2; IN time_out FROM alarm; ENDCONCURRENT; ENDINSTANCE; INSTANCE courier_1 : vmk_courier; IN unit FROM order; ACTION deliver unit; OUT unit TO master; ENDINSTANCE; INSTANCE master : vmk_master; IN unit FROM courier_1; ACTION fix unit; OUT unit TO courier_2; ENDINSTANCE; INSTANCE courier_2 : vmk_courier; IN unit FROM master; ACTION deliver unit; OUT unit TO order; ENDINSTANCE; ENDSUBMSC; /*---------------------------*/ MSC 1_return_fixed_unit; INST client : vmk_client, return_fixed_unit; INSTANCE client : vmk_client; OUT receipt TO return_fixed_unit; ENDINSTANCE; INSTANCE return_fixed_unit; CONDITION return; IN receipt FROM client; ACTION check; ENDINSTANCE; CONDITION check; ENDMSC; /*----------------------------*/ MSC 2_return_normal; INST client : vmk_client, return_fixed_unit; CONDITION check; INSTANCE client : vmk_client; IN unit FROM return_fixed_unit; ENDINSTANCE; INSTANCE return_fixed_unit DECOMPOSED; OUT unit TO client; CONDITION return; ENDINSTANCE; ENDMSC; /*------------------------------*/ SUBMSC return_fixed_unit COMMENT from msc 2_return_normal; INST office : vmk_office, order : vmk_order, courier_2 : vmk_courier; INSTANCE office : vmk_office; CONDITION return; IN receipt FROM ENV; OUT lookup TO order; IN unit FROM order; OUT unit TO ENV; CONDITION return; ENDINSTANCE; INSTANCE order : vmk_order; IN unit FROM courier_2; IN lookup FROM office; OUT unit TO office; STOP; ENDINSTANCE; INSTANCE courier_2 : vmk_courier; OUT unit TO order; ENDINSTANCE; ENDSUBMSC; /*-----------------------------*/ MSC 3_return_not_ready; INST client : vmk_client, return_fixed_unit; CONDITION check; INSTANCE client : vmk_client; IN not_ready FROM return_fixed_unit; IN receipt FROM return_fixed_unit; ENDINSTANCE; INSTANCE return_fixed_unit DECOMPOSED; OUT not_ready TO client; OUT receipt TO client; CONDITION return; ENDINSTANCE; ENDMSC; /*----------------------------*/ SUBMSC return_fixed_unit COMMENT from msc 3_return_not_ready; INST office : vmk_office, order : vmk_order, courier_2 : vmk_courier; INSTANCE office : vmk_office; CONDITION return; IN receipt FROM ENV; OUT lookup TO order; IN not_ready FROM order; OUT not_ready TO ENV; OUT receipt TO ENV; CONDITION return; ENDINSTANCE; INSTANCE order : vmk_order; IN lookup FROM office; OUT not_ready TO office; IN unit FROM courier_2; ENDINSTANCE; INSTANCE courier_2 : vmk_courier; OUT unit TO order; ENDINSTANCE; ENDSUBMSC; /*-------------------------------*/ MSC 4_return_wrong_office; INST client : vmk_client, return_fixed_unit; CONDITION check; INSTANCE client : vmk_client; IN wrong_office FROM return_fixed_unit; IN receipt FROM return_fixed_unit; ENDINSTANCE; INSTANCE return_fixed_unit DECOMPOSED; OUT wrong_office TO client; OUT receipt TO client; CONDITION return; ENDINSTANCE; ENDMSC; /*------------------------------*/ SUBMSC return_fixed_unit COMMENT from msc 4_return_wrong_office; INST office : vmk_office, office_1 : vmk_office; INSTANCE office : vmk_office; IN receipt FROM ENV; OUT wrong_office TO ENV; OUT receipt TO ENV; ENDINSTANCE; INSTANCE office_1 : vmk_office; OUT unit TO ENV; ENDINSTANCE; ENDSUBMSC; /*------------------------------*/ MSC send_report; INST mgu, send_report; INSTANCE mgu; OUT request TO send_report; IN report FROM send_report; ENDINSTANCE; INSTANCE send_report; CONDITION report; IN request FROM mgu; ACTION prepare report; OUT report TO mgu; CONDITION report; ENDINSTANCE; ENDMSC; ENDMSCDOCUMENT;