Modelling Web Navigation by Statechart(8)

时间:2025-02-23

UML,OOP,面向对象

Figure12.Modelingframedpage

eventjp(next,pos)inFigure12.

Synchronizationbetweenframescanbedonebyeventsofclientsidescriptsandprograms.Mostoftheeventsgen-eratedhaveoneintendedreceivertosynchronizewith.ThissynchronizationismodeledbyeventbroadcastofState-chart.Everyeventisreceivedbyallframestoreactupon,sothattheirstatescanbesynchronizedbyevents.Thediffer-encebringaboutbyusingbroadcastinthestatechartmodelinsteadofunicasteventscanbesolvedbyaddingthere-ceiver’sidenti ertotheeventnamewhenmodeling,sothateveniftheeventisbroadcasted,onlytheintentionalreceiverwillactonit.Othercomponentscanrealizetheeventisnotforthemanddiscardit.

Figure13demonstratesthis.Awebpagenext.htmlneedstohaveitsproductinformationandphotogallerydisplayedinsynchronization.AmenuframeisusedfordisplayinginformationofproductAandproductB.Aphotoframeisusedfordisplayingthephotogalleryofthecurrentlydisplayingproduct.Synchronizationbe-tweenthedisplayingproductanditsphotogalleryisbythejp(target,pos)events(Figure14).Initially,thepageisinthesub-statesmenu.htmlandgeneral.html.Wheneventjp(productA,pos)happens,framemenutransittostatepro-ductA.htmlandframephototransittostatephotoA(Fig-ure15).InphotoA,thephotogalleryofproductAcanrunbytheeventsjp(2,pos)andjp(3,pos).Thetwoframesaresynchronized.Eventsjp(productB,pos)andjp(menu,pos)performssimilarly.4.2.4MultipleWindows

ConcurrentviewingofwebpagesbymultiplewindowsismodeledbyusingaseparateStatechartforeachwindow.ThisismodeledinFigure16.Thesystem rststartedwithonewindowmainWin.Wheneventjp(next,pos)happened,anewwindowispoppedupcontainingads.html.ThisisrepresentedbyspecifyingthenameoftheanotherstatechartadsWin(whichisofthenewlycreatedwindow)astheac-

Figure13.SynchronizationinFrames

Figure14.InitialStateofFigure13

Figure15.Aftereventjp(productA,pos)

Modelling Web Navigation by Statechart(8).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219