Theory and Application the Real-Time UML Standard
Total Page:16
File Type:pdf, Size:1020Kb
TheThe RealRealReal-Time--TimeTime UMLUML Standard:Standard: TheoryTheory andand ApplicationApplication Bran Selic Ben Watson Rational Software Canada Tri-Pacific Software, Inc. [email protected] [email protected] TutorialTutorial ObjectivesObjectives ♦♦ToTo clarifyclarify thethe relationshiprelationship betweenbetween thethe objectobject paradigmparadigm andand realrealreal-time--timetime systemssystems II matchmatch oror mismatch?mismatch? ♦♦DescribeDescribe andand analyzeanalyze UMLUML fromfrom aa realrealreal-time--timetime designer’sdesigner’s perspectiveperspective ♦♦ToTo introduceintroduce thethe “UML“UML ProfileProfile forfor Schedulability,Schedulability, Performance,Performance, andand Time”Time” ♦♦ToTo introduceintroduce anan engineeringengineeringengineering-oriented--orientedoriented designdesign approachapproach forfor realrealreal-time--timetime systemssystems 2 TutorialTutorial OverviewOverview ♦♦RealRealReal-Time--TimeTime SystemsSystems andand thethe ObjectObject ParadigmParadigm ♦♦UMLUML asas aa RealRealReal-Time--TimeTime ModelingModeling LanguageLanguage ♦♦TheThe RealRealReal-Time--TimeTime UMLUML ProfileProfile ♦♦EngineeringEngineeringEngineering-Oriented--OrientedOriented DesignDesign ofof RealRealReal-Time--TimeTime SystemsSystems ♦♦SummarySummary andand ConclusionsConclusions 3 ♦♦RealRealReal-Time--TimeTime SystemsSystems andand thethe ObjectObject ParadigmParadigm II RealRealReal-Time--TimeTime SystemSystem EssentialsEssentials ♦♦UMLUML asas aa RealRealReal-Time--TimeTime ModelingModeling LanguageLanguage ♦♦TheThe RealRealReal-Time--TimeTime UMLUML ProfileProfile ♦♦EngineeringEngineeringEngineering-Oriented--OrientedOriented DesignDesign ofof RealRealReal-Time--TimeTime SystemsSystems ♦♦SummarySummary andand ConclusionsConclusions 4 RealReal--TimeTime SystemSystem ♦♦SystemsSystems thatthat maintainmaintain anan ongoingongoing timelytimely interactioninteraction withwith itsits environmentenvironment environment signal Real-Time source System inputs (state) controlledcontrolled entitiesentities signal •outputs = f (inputs, state) outputs source •coordination inputs 5 UnderUnder thethe HoodHood ♦♦AA persistentpersistent structurestructure thatthat providesprovides aa frameworkframework forfor behaviorbehavior environment ConcurrencyConcurrency conflictconflict signal Real-Time AgentReal-Time source System inputs (state) controlled Agent controlled entitiesentities signal •outputs = f (inputs, state) outputs Agent source •coordination inputs 6 ClassificationsClassifications ofof RTRT SystemsSystems ♦♦BasedBased onon naturenature ofof keykey inputsinputs II timetimetime-driven:--driven:driven: forfor continuouscontinuous (synchronous)(synchronous) inputsinputs II eventeventevent-driven:--driven:driven: forfor discretediscrete (asynchronous)(asynchronous) inputsinputs ♦♦BasedBased onon timetime criticalitycriticality II hardhard RTRT systems:systems: everyevery inputinput mustmust havehave aa timelytimely responseresponse II softsoft RTRT systems:systems: mostmost inputsinputs mustmust havehave timelytimely responseresponse ♦♦BasedBased onon load:load: II static:static: fixedfixed deterministicdeterministic loadload II dynamic:dynamic: variablevariable (non(non(non-deterministic)--deterministic)deterministic) loadload ♦♦ManyMany practicalpractical systemssystems areare combinationscombinations ofof thesethese 7 SampleSample RealReal--TimeTime ApplicationApplication INSTRUCTORINSTRUCTOR STATIONSTATION AIRFRAMEAIRFRAME ATMOSPHEREATMOSPHERE MODELMODEL CONTROL CONTROLCONTROL PILOT SURFACES PILOT SURFACESSURFACES CONTROLS GROUNDGROUND CONTROLS MODELMODEL ENGINESENGINES Which procedure(s) describe this system? 8 ClassicalClassical Approach:Approach: CyclicalCyclical ExecutiveExecutive The miscellaneous procedural slices are executed cyclically based on time resolution A A A B B B A C C B D D A A E B B F A C G B D H 50msec = 50 msec band ENGINESENGINES = 100 msec band (2 parts: A and B) = 200 msec band (4 parts: A, B, C, D) = 400 msec band (8 parts: A, B, C, D, E, F, G, H) The crucially important system structure is almost completely obscured 9 ProblemsProblems withwith thethe TraditionalTraditional SolutionSolution ♦♦TheThe solutionsolution isis adjustedadjusted toto fitfit thethe implementationimplementation technologytechnology (i.e.,(i.e., thethe stepstepstep-at-a-time--atat--aa--timetime programmingprogramming stylestyle ofof proceduralprocedural programming)programming) ratherrather thanthan humanhuman needsneeds ⇒⇒ InIn additionaddition toto thethe inherentinherent complexitycomplexity ofof thethe problemproblem designersdesigners needneed toto contendcontend withwith thethe accidentalaccidental complexitycomplexity ofof thethe implementationimplementation technologytechnology ♦♦OverwhelmingOverwhelming complexitycomplexity isis byby farfar thethe biggestbiggest hurdlehurdle inin mostmost realrealreal-time--timetime softwaresoftware systemssystems reducingreducing complexitycomplexity isis crucialcrucial toto successsuccess 10 ♦♦RealRealReal-Time--TimeTime SystemsSystems andand thethe ObjectObject ParadigmParadigm II RealRealReal-Time--TimeTime SystemSystem EssentialsEssentials II EssentialsEssentials ofof thethe ObjectObject ParadigmParadigm ♦♦UMLUML asas aa RealRealReal-Time--TimeTime ModelingModeling LanguageLanguage ♦♦TheThe RealRealReal-Time--TimeTime UMLUML ProfileProfile ♦♦EngineeringEngineeringEngineering-Oriented--OrientedOriented DesignDesign ofof RealRealReal-Time--TimeTime SystemsSystems ♦♦SummarySummary andand ConclusionsConclusions 11 TheThe EssenceEssence ofof thethe ObjectObject ParadigmParadigm ♦♦CombinesCombines allall thethe variousvarious featuresfeatures ofof aa logicallogical unitunit (procedures(procedures andand data)data) intointo aa singlesingle packagepackage calledcalled anan objectobject ♦♦DefinesDefines aa softwaresoftware systemsystem asas aa structurestructure ofof collaboratingcollaborating objectsobjects AirframeAirframe ControlControl AtmosphereAtmosphere SurfacesSurfaces 12 ObjectsObjects andand RealReal--TimeTime SystemsSystems ♦♦TheThe structurestructure ofof realrealreal-time--timetime systemssystems tendstends toto persistpersist throughthrough timetime becausebecause itit reflectsreflects thethe physicalphysical entitiesentities ofof thethe realreal worldworld ♦♦ThisThis structurestructure isis thethe frameworkframework throughthrough whichwhich (infinitely)(infinitely) manymany differentdifferent behaviorbehavior threadsthreads areare executedexecuted ♦♦Hence,Hence, thethe focusfocus isis onon structurestructure ratherrather thanthan behaviorbehavior ♦♦TheThe structuralstructural focusfocus ofof thethe objectobject paradigmparadigm isis betterbetter suitedsuited toto realrealreal-time--timetime systemssystems thanthan thethe proceduralprocedural paradigmparadigm 13 Yes,Yes, ButBut WhatWhat About...About... ♦♦Performance?Performance? II thethe costcost ofof abstractionabstraction (encapsulation,(encapsulation, automaticautomatic garbagegarbage collection,collection, dynamicdynamic binding,binding, etc.)etc.) ♦♦ModelingModeling realrealreal-time--timetime specificspecific phenomena?phenomena? II timetime andand timingtiming mechanismsmechanisms II resourcesresources (processors,(processors, networks,networks, semaphores,semaphores, etc.)etc.) ♦♦ExploitingExploiting currentcurrent realrealreal-time--timetime systemsystem theory?theory? II ssschedulabilitychedulabilitychedulability analysisanalysis (e.g.,(e.g., rateraterate-monotnic--monotnicmonotnic theory)theory) theory) II performanceperformance analysisanalysis (queueing(queueing theory)theory) 14 PerformancePerformance ofof OOOO TechnologyTechnology ♦♦HardwareHardware isis becomingbecoming everever fasterfaster (((Moore’sMoore’sMoore’s law)law) II previouslypreviously unacceptableunacceptable responseresponse timestimes maymay nownow bebe acceptableacceptable ♦♦OOOO softwaresoftware technologiestechnologies areare becomingbecoming realrealreal-time--timetime awareaware II boundedbounded dynamicdynamic bindingbinding techniquestechniques II tunabletunable automaticautomatic garbagegarbage collectioncollection (bounded(bounded latency)latency) II realrealreal-time--timetime variantsvariants ofof popularpopular OOOO languageslanguages (e.g.,(e.g., EC++,EC++, RTRT Java)Java) 15 ObjectsObjects ♦♦ConceptualConceptual unitsunits withwith I aa uniqueunique identityidentity (dedicated(dedicated memory)memory) I aa publicpublic interfaceinterface I aa hiddenhidden (encapsulated)(encapsulated) implementationimplementation DataData AttributesAttributes Telephone1: void:offHook (); busy : boolean {busy = true; reqDialtone(); offHook() … }; OperationsOperations onHook () ring() 16 ConceptualConceptual ObjectsObjects ♦♦NotNot allall objectsobjects necessarilynecessarily requirerequire aa physicalphysical underpinningunderpinning ♦♦ForFor example,example, thethe “telephone“telephone call”call” objectobject Telephone1Telephone1 Telephone2Telephone2 TelephoneTelephone CallCall Telephone Call Object abortCall () addParty (t:Telephone) reportDuration () The object paradigm allows us to create our own (virtual) reality! 17 ObjectObject BehaviorBehavior ♦♦InIn essence,essence, anan objectobject isis aa serverserver II genericgeneric objectobject lifecycle:lifecycle: InitializeInitialize HandlingHandling dependsdepends ObjectObject onon specificspecific requestrequest typetype andand objectobject statestate WaitWait for for Request InvokesInvokes Request operationsoperations onon other objects other objects void:offHookvoid:offHook