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)