Presentation is loading. Please wait.

Presentation is loading. Please wait.

Embedded Software and UML Three Meanings of "Model" A sketch –not precise or complete; not maintained –communicates a rough idea A blueprint –like plans.

Similar presentations


Presentation on theme: "Embedded Software and UML Three Meanings of "Model" A sketch –not precise or complete; not maintained –communicates a rough idea A blueprint –like plans."— Presentation transcript:

1

2 Embedded Software and UML

3 Three Meanings of "Model" A sketch –not precise or complete; not maintained –communicates a rough idea A blueprint –like plans to a house –maps closely to artefact being built An executable –no need to distinguish from the “real thing”

4 Evolution of Software Development Assembly Assembler Machine Code Compiler High Level Language Assembly System Complexity Computing Costs Increased Productivity UML Models Model Compiler High Level Language

5 Model- vs Code-Based Design

6 Blueprint Development Process Repeat every time the technology changes Checking Settings Entry/ OpenShutter( 0.5 ); MeasureLight(); DetermineExposureTime( Checking Che cking Che Ckin Che cking g Problem Checking Settings Entry/ OpenShutter( 0.5 ); MeasureLight(); DetermineExposureTime( Checking Che cking Che Ckin Che cking g Solutio n Checking Checking Settings Entry/ OpenShutter( 0.5 ); MeasureLight(); Code // Shutter Class Class Shutter_c {... } // Exposure Class Class Exposure_c {... }

7 Model Compilers Translates UML to C/C++ etc. One compiler for each software platform Encapsulates embedded software design parameters –separate from application

8 Separation of Application from Architecture Design can be split between: Subject matter experts who understand the application and Embedded experts who understand the architecture Each evolves at its own pace. Architecture Checking Checking Settings Entry/ OpenShutter( 0.5 ); MeasureLight(); Checking Settings Entry/ OpenShutter( 0.5 ); MeasureLight(); DetermineExposureTime( Checking Che cking Che Ckin Che cking g Application

9 Microwave Oven Code struct Oven_s { ArbitraryID_t OvenID; /* Association storage */ Door_s *Door_R1; Cooking_Step_s *Cooking_Step_R2; Cooking_Step_s *Cooking_Step_R3; Magnetron_s *Magnetron_R4; /* State machine current state */ StateNumber_t current_state; };

10 Cooking Step Code struct Cooking_Step_s { i_t stepNumber; i_t cookingTime; i_t powerLevel; Timer_s *executionTimer; /* Association storage */ Oven_s *Oven_R2; Oven_s *Oven_R3; /* State machine current state */ StateNumber_t current_state; };

11 Microwave Oven Class Diagram Cooking Step stepNumber cookingTime powerLevel Magnetron powerOutput pulseTimer Oven R2 R3 R4 Door isOpen R1

12 Terminology Software platform –analogous to hardware platform –set of technologies that make software work –separate from application Architecture –abstract representation of how to map an application to a specific target platform Model compiler –realization of an architecture

13 6/11/2016http://rtlab.knu.ac.kr/Slide 12 Object-Oriented Modeling and UML

14 6/11/2016http://rtlab.knu.ac.kr/Slide 13

15

16

17

18 6/11/2016http://rtlab.knu.ac.kr/Slide 17 Unified Process and UML

19 6/11/2016http://rtlab.knu.ac.kr/Slide 18 Diagrams and Process(Use Case Diagram) Use Case Diagram Inception Elaboration

20 6/11/2016http://rtlab.knu.ac.kr/Slide 19 Inception Elaboration Class and Package Diagram Diagrams and Process(Class and Package Diagram)

21 6/11/2016http://rtlab.knu.ac.kr/Slide 20 Inception Elaboration Interaction Diagram(Scenarios) : Temporal view under conditional setting(scenario, e.g. exception case) Diagrams and Process(Interaction Diagram)

22 6/11/2016http://rtlab.knu.ac.kr/Slide 21 Inception Elaboration Activity Diagram(InterClass Behavior): Conditional view under temporal setting (Workflow, e.g. order product) Diagrams and Process(Activity Diagram)

23 6/11/2016http://rtlab.knu.ac.kr/Slide 22 Inception Elaboration State Transition Diagrams(InterClass Behavior): Diagrams and Process(State Transition Diagram)

24 6/11/2016http://rtlab.knu.ac.kr/Slide 23 Inception Elaboration Source Code Construction Diagrams and Process(Source Code)

25 6/11/2016http://rtlab.knu.ac.kr/Slide 24 Inception Elaboration Deployment Diagram Construction Transition Diagrams and Process(Deployment Diagram)

26 6/11/2016http://rtlab.knu.ac.kr/Slide 25 Inception Elaboration Construction Transition Diagrams and Process(All)

27 6/11/2016http://rtlab.knu.ac.kr/Slide 26 Role of Use Case Diagrams

28 6/11/2016http://rtlab.knu.ac.kr/Slide 27 Example of Use Case(Anesthesia Use Case) Display Patient StatusAlarm on Critical EventVentilate PatientDeliver Anesthesia Physican ECG Monitor Chart Recorder Patient

29 6/11/2016http://rtlab.knu.ac.kr/Slide 28 Scenarios, Workflows and Object Structures

30 6/11/2016http://rtlab.knu.ac.kr/Slide 29 Use Case Model

31 6/11/2016http://rtlab.knu.ac.kr/Slide 30 Use Case Diagrams

32 6/11/2016http://rtlab.knu.ac.kr/Slide 31 System Boundary

33 6/11/2016http://rtlab.knu.ac.kr/Slide 32 Actors

34 6/11/2016http://rtlab.knu.ac.kr/Slide 33 Use Case (I)

35 6/11/2016http://rtlab.knu.ac.kr/Slide 34 Use Case (II)

36 6/11/2016http://rtlab.knu.ac.kr/Slide 35 Relationships

37 6/11/2016http://rtlab.knu.ac.kr/Slide 36 Relationships

38 6/11/2016http://rtlab.knu.ac.kr/Slide 37 Inclusion of Use Cases : Modularization

39 6/11/2016http://rtlab.knu.ac.kr/Slide 38 Generalization of Use Cases : Systematization

40 6/11/2016http://rtlab.knu.ac.kr/Slide 39 Extension of Use Cases : Completion

41 6/11/2016http://rtlab.knu.ac.kr/Slide 40 Generalization of Actors

42 6/11/2016http://rtlab.knu.ac.kr/Slide 41 Summary : Use Case Concepts

43 6/11/2016http://rtlab.knu.ac.kr/Slide 42 Any Question?

44 6/11/2016http://rtlab.knu.ac.kr/Slide 43 Role of Class Diagrams

45 6/11/2016http://rtlab.knu.ac.kr/Slide 44 Conceptual Modeling of Classes

46 6/11/2016http://rtlab.knu.ac.kr/Slide 45 Class Diagram

47 6/11/2016http://rtlab.knu.ac.kr/Slide 46 Class in Conceptual Class Diagrams

48 6/11/2016http://rtlab.knu.ac.kr/Slide 47 Association

49 6/11/2016http://rtlab.knu.ac.kr/Slide 48 Multiplicity

50 6/11/2016http://rtlab.knu.ac.kr/Slide 49 Role

51 6/11/2016http://rtlab.knu.ac.kr/Slide 50 Aggregation and Composition

52 6/11/2016http://rtlab.knu.ac.kr/Slide 51 Generalization

53 6/11/2016http://rtlab.knu.ac.kr/Slide 52 Constraint and Note

54 6/11/2016http://rtlab.knu.ac.kr/Slide 53 Object Diagram

55 6/11/2016http://rtlab.knu.ac.kr/Slide 54 Role of Interaction Diagrams in UML

56 6/11/2016http://rtlab.knu.ac.kr/Slide 55  Interaction diagrams are a series of diagrams describing the behavior of an object-oriented system with object interaction A sequence diagram stresses the temporal sequence of object interactions A collaboration diagram stresses the objects taking part in the object interaction  For the description of object interactions(the dynamic semantic) the following terms are necessary in addition to the term “object”: message(asynchronous signal and synchronous method call) activation of an object active object Interaction diagrams in UML

57 6/11/2016http://rtlab.knu.ac.kr/Slide 56 Conceptual Modeling of Interactions  Interaction results from messages between objects  A message : is sent by an (active) sender object, is sent to a receive object, has a name, may have an ordered sequence of parameters and is delivered with a certain delay from the sender to the receiver  A parameter is a value or an object reference  An object reference in a parameter is marked by a variable name  The sending of a message is an action.

58 6/11/2016http://rtlab.knu.ac.kr/Slide 57 The concepts used in a sequence diagram :Computer:PrinterServer:Printer :Queue print(file) [printer free] print(file) simple message Activation Synchronous message Lifeline return Guard- condition Object

59 6/11/2016http://rtlab.knu.ac.kr/Slide 58 Asynchronous Interactions Characteristics :  Sender and receiver objects are both active objects: They own a thread and can trigger actions  The communication is unidirectional by a signal  The signal triggers an (asynchronous) event at the receiver  The receiver can wait for the occurrence of an event

60 6/11/2016http://rtlab.knu.ac.kr/Slide 59 Sequence Diagram : Asynchronous Interaction

61 6/11/2016http://rtlab.knu.ac.kr/Slide 60 Synchronous(Procedural) Interaction Characteristics:  The calling object must be activated  The calling object activates the called objects  The call is a message which can also be sent remotely in a network  At the receiver a dynamic binding to the method belonging to the message takes place  An activation of the method(operation) of the called object takes place  During the activation the calling object keeps activated(blocked)  The activation of the called object ends with the execution of the method  A return message is sent which can own a result as an argument  The execution of the calling method continues

62 6/11/2016http://rtlab.knu.ac.kr/Slide 61 Synchronous(Procedural) Interaction

63 6/11/2016http://rtlab.knu.ac.kr/Slide 62 Concurrent Procedural Interaction

64 6/11/2016http://rtlab.knu.ac.kr/Slide 63 Grip Sensor Actuator Proxy Protocol Stack Grip View Deadline (B-A < 500 ms) A B Grip it Set Strength Send20ms 10ms 5ms Grip Tighten Visual Update Remote Robot Actuator 5ms 8ms Receive 5ms 10ms Update Visual Update 15ms Timing Example of Sequence diagram

65 6/11/2016http://rtlab.knu.ac.kr/Slide 64 Message StereoTypes Used in Sequence diagram Arrival Patterns Synchronization Patterns Periodic Aperiodic Synchronous Operation Call Signal(always asynchronous) Asynchronous Operation Call Return from a synchronous call Balking Timed

66 6/11/2016http://rtlab.knu.ac.kr/Slide 65 Collaboration Diagram Focus both on the interactions and the links between a set of collaborating objects(a link is an instance of an association) Sequence diagram focuses on time and collaboration diagram focuses on space Static elements  active or passive objects connected by  references (instances of associations or aggregations) with  role names Dynamic elements  dynamically created objects(new)  messages(less often:signals) with arguments  local variables Implicit elements  time(implied by sequence numbers)  activation

67 6/11/2016http://rtlab.knu.ac.kr/Slide 66 Collaboration Diagram : example

68 6/11/2016http://rtlab.knu.ac.kr/Slide 67 Collaboration Diagram : message label  2:display(x,y) Simple message with sequence number  1.2.1:p=find(name)nested call  [x<4] 2:invert(rect)conditional message  3.1*:updateiteration  3.2*[I=1..8] 5:draw(v[I])iteration Concurrency and synchronization are described better by sequence diagrams

69 6/11/2016http://rtlab.knu.ac.kr/Slide 68 Collaboration Diagram : example :Button:Elevator:Queue:Elevator control :Order{new} 1:GetElevator(floorId) Push() 1.2:Create() job 1.1*[all queues]: len := Length(){broadcast} 1.3:Invoke(job) {parameter}job 2:nextjob=Getjob() {local}nextjob

70 6/11/2016http://rtlab.knu.ac.kr/Slide 69 State Machine in UML

71 6/11/2016http://rtlab.knu.ac.kr/Slide 70 Elements of State Diagram

72 6/11/2016http://rtlab.knu.ac.kr/Slide 71 States and State Diagram

73 6/11/2016http://rtlab.knu.ac.kr/Slide 72 Start and Final State

74 6/11/2016http://rtlab.knu.ac.kr/Slide 73 Transitions

75 6/11/2016http://rtlab.knu.ac.kr/Slide 74 Events

76 6/11/2016http://rtlab.knu.ac.kr/Slide 75 Signal Events and Call Events

77 6/11/2016http://rtlab.knu.ac.kr/Slide 76 Call Events

78 6/11/2016http://rtlab.knu.ac.kr/Slide 77 Time and Change Events

79 6/11/2016http://rtlab.knu.ac.kr/Slide 78 Sending Signal

80 6/11/2016http://rtlab.knu.ac.kr/Slide 79 Triggering Actions

81 6/11/2016http://rtlab.knu.ac.kr/Slide 80 Composite Sates

82 6/11/2016http://rtlab.knu.ac.kr/Slide 81 Concurrent Sub Sates

83 6/11/2016http://rtlab.knu.ac.kr/Slide 82 Concurrent Sub Sates : Alternative

84 6/11/2016http://rtlab.knu.ac.kr/Slide 83 Any Question?


Download ppt "Embedded Software and UML Three Meanings of "Model" A sketch –not precise or complete; not maintained –communicates a rough idea A blueprint –like plans."

Similar presentations


Ads by Google