deployment components with parametric concurrency
play

Deployment Components with Parametric Concurrency Einar Broch - PowerPoint PPT Presentation

Deployment Components with Parametric Concurrency Einar Broch Johnsen Olaf Owe Rudolf Schlatte S. Lizeth Tapia Tarifa University of Oslo 10 March 2011, Tallinn http://www.hats-project.eu Rudolf Schlatte Deployment Components 10.3.2011,


  1. Model Deployment Component method1() Object1 result methodB() ObjectA methodN() ObjectC methodA() ObjectN result ObjectB Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 9 / 43

  2. Model with DC Deployment Resources Global clock Component method1() DC Object1 result methodB() ObjectA methodN() ObjectC methodA() ObjectN result ObjectB Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 10 / 43

  3. Deployment Components (1) A deployment component has a number of concurrent resources Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 11 / 43

  4. Deployment Components (1) A deployment component has a number of concurrent resources ◮ These resources are shared between the component’s objects Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 11 / 43

  5. Deployment Components (1) A deployment component has a number of concurrent resources ◮ These resources are shared between the component’s objects ◮ Resources abstract from the number and speed of the physical processors available to the component Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 11 / 43

  6. Deployment Components (1) A deployment component has a number of concurrent resources ◮ These resources are shared between the component’s objects ◮ Resources abstract from the number and speed of the physical processors available to the component ◮ Resources reflect the execution capacity of the deployment component in a time interval Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 11 / 43

  7. Deployment Components (2) Consider a deployment component D method1() DC with r units of processing resources Object1 result methodB() ObjectA methodN() and G objects ObjectC methodA() ObjectN result ObjectB Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 12 / 43

  8. Deployment Components (2) Consider a deployment component D method1() DC with r units of processing resources Object1 result methodB() ObjectA methodN() and G objects ObjectC methodA() ObjectN result ObjectB ◮ Any number n of objects in G can execute concurrently ( n ≤ r ) Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 12 / 43

  9. Deployment Components (2) Consider a deployment component D method1() DC with r units of processing resources Object1 result methodB() ObjectA methodN() and G objects ObjectC methodA() ObjectN result ObjectB ◮ Any number n of objects in G can execute concurrently ( n ≤ r ) ◮ Let A ⊆ G such that n = | A | Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 12 / 43

  10. Deployment Components (2) Consider a deployment component D method1() DC with r units of processing resources Object1 result methodB() ObjectA methodN() and G objects ObjectC methodA() ObjectN result ObjectB ◮ Any number n of objects in G can execute concurrently ( n ≤ r ) ◮ Let A ⊆ G such that n = | A | ◮ After one concurrent execution step, D has r 1 = r − n available units of resources. Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 12 / 43

  11. Deployment Components (2) Consider a deployment component D method1() DC with r units of processing resources Object1 result methodB() ObjectA methodN() and G objects ObjectC methodA() ObjectN result ObjectB ◮ Any number n of objects in G can execute concurrently ( n ≤ r ) ◮ Let A ⊆ G such that n = | A | ◮ After one concurrent execution step, D has r 1 = r − n available units of resources. ◮ If r 1 > 0, another execution step can be done (leaving r 2 remaining units of resources available) Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 12 / 43

  12. Deployment Components (2) Consider a deployment component D method1() DC with r units of processing resources Object1 result methodB() ObjectA methodN() and G objects ObjectC methodA() ObjectN result ObjectB ◮ Any number n of objects in G can execute concurrently ( n ≤ r ) ◮ Let A ⊆ G such that n = | A | ◮ After one concurrent execution step, D has r 1 = r − n available units of resources. ◮ If r 1 > 0, another execution step can be done (leaving r 2 remaining units of resources available) Execution inside the time interval stops when no units of resources are available or the objects are blocked Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 12 / 43

  13. Abs Syntax Extension method1() DC Object1 result methodB() ObjectA methodN() ObjectC methodA() ObjectN result ObjectB Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 13 / 43

  14. Abs Syntax Extension method1() DC Object1 result methodB() ObjectA methodN() ObjectC methodA() ObjectN result ObjectB Extension of the Syntax of Abs: ◮ now() returns the current time Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 13 / 43

  15. Abs Syntax Extension method1() DC Object1 result methodB() ObjectA methodN() ObjectC methodA() ObjectN result ObjectB Extension of the Syntax of Abs: ◮ now() returns the current time ◮ component ( r ) creates a new deployment component dc := component ( r ); Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 13 / 43

  16. Abs Syntax Extension method1() DC Object1 result methodB() ObjectA methodN() ObjectC methodA() ObjectN result ObjectB Extension of the Syntax of Abs: ◮ now() returns the current time ◮ component ( r ) creates a new deployment component dc := component ( r ); ◮ An optional clause in the object creation new C ( e ) in dc; Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 13 / 43

  17. Operational Semantics - Extension The operational semantics of Abs is formalized in rewriting logic and is executable on the Maude tool Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 14 / 43

  18. Operational Semantics - Extension The operational semantics of Abs is formalized in rewriting logic and is executable on the Maude tool A Abs configuration (system state) consists of: Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 14 / 43

  19. Operational Semantics - Extension The operational semantics of Abs is formalized in rewriting logic and is executable on the Maude tool A Abs configuration (system state) consists of: Classes, Objects, Futures and Invocation messages Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 14 / 43

  20. Operational Semantics - Extension The operational semantics of Abs is formalized in rewriting logic and is executable on the Maude tool A Abs configuration (system state) consists of: Classes, Objects, Futures and Invocation messages Extend the configurations with: ◮ Global clock � t :Clock | Limit: l � method1() DC Object1 result methodB() ◮ Deployment components ObjectA methodN() ObjectC methodA() � dc :Comp|Free: r , Limit: l � ObjectN result ◮ Object attribute ObjectB mycomp Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 14 / 43

  21. Operational Semantics - Extension Extend the rewriting rules with time, deployment components, and resource consumption Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 15 / 43

  22. Operational Semantics - Extension Extend the rewriting rules with time, deployment components, and resource consumption Some of the statements consume resources when they execute. Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 15 / 43

  23. Operational Semantics - Extension Extend the rewriting rules with time, deployment components, and resource consumption Some of the statements consume resources when they execute. Simple example: skip ; Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 15 / 43

  24. Operational Semantics - Extension Extend the rewriting rules with time, deployment components, and resource consumption Some of the statements consume resources when they execute. Simple example: skip ; Old rule: rl [ skip ] : � o : C | Pr : { l | skip; s } � − → � o : C | Pr : { l | s } � . Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 15 / 43

  25. Operational Semantics - Extension Extend the rewriting rules with time, deployment components, and resource consumption Some of the statements consume resources when they execute. Simple example: skip ; Old rule: rl [ skip ] : � o : C | Pr : { l | skip; s } � − → � o : C | Pr : { l | s } � . New rule: skip consumes a resource crl [ skip ] : � o : C | Att: a , Pr : { l | skip; s } � � dc :Comp |Free: r � − → � o : C | Att: a , Pr : { l | s } � � dc :Comp |Free: r − 1 � if dc = a [ mycomp ] . Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 15 / 43

  26. Operational Semantics - Extension Old rule: crl [ async-call ] : � o : C | Att : a , Pr : { l | x := e ! m ( e ); s }, Lcnt : f � − → � o : C | Att : a , Pr : { l [ x �→ n ] | s }, Lcnt : f + 1 � invoc( [ [ e ] ] ( a ◦ l ) , none , n , m , [ [ e ] ] ( a ◦ l ) , none ) � n :Fut |Done:false,Value: ⊥� if n := label( o , f ) ∧ o � = [ [ e ] ] ( a ◦ l ) , none . New rule consumes resources and evaluates expressions using time: crl [ async-call ] : � o : C | Att : a , Pr : { l | x := e ! m ( e ); s }, Lcnt : f � � t :Clock | � � dc :Comp |Free: r � − → � o : C | Att : a , Pr : { l [ x �→ n ] | s }, Lcnt : f + 1 � � t :Clock | � � dc :Comp |Free: r − 1 � ] t ] t invoc( [ [ e ] ( a ◦ l ) , none , n , m , [ [ e ] ( a ◦ l ) , none ) � n :Fut |Done:false,Value: ⊥� ] t if n := label( o , f ) ∧ o � = [ [ e ] ∧ dc = a [ mycomp ] . ( a ◦ l ) , none Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 16 / 43

  27. Operational Semantics - Extension crl [ progress ] : � t : Clock | limit : limit � } { cn − → {Adv( cn ) � t + 1: Clock | limit : limit � } if canAdv( cn , t ) ∧ t < limit . Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 17 / 43

  28. Operational Semantics - Extension crl [ progress ] : � t : Clock | limit : limit � } { cn − → {Adv( cn ) � t + 1: Clock | limit : limit � } if canAdv( cn , t ) ∧ t < limit . Adv( cn ) resets the free resources of each deployment component to their specified limit. Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 17 / 43

  29. Operational Semantics - Extension crl [ progress ] : � t : Clock | limit : limit � } { cn − → {Adv( cn ) � t + 1: Clock | limit : limit � } if canAdv( cn , t ) ∧ t < limit . Adv( cn ) resets the free resources of each deployment component to their specified limit. canAdv( cn , t ) is true if ◮ no object can do anything and no invocation messages to that object are in the configuration. Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 17 / 43

  30. Operational Semantics - Extension crl [ progress ] : � t : Clock | limit : limit � } { cn − → {Adv( cn ) � t + 1: Clock | limit : limit � } if canAdv( cn , t ) ∧ t < limit . Adv( cn ) resets the free resources of each deployment component to their specified limit. canAdv( cn , t ) is true if ◮ no object can do anything and no invocation messages to that object are in the configuration. An object can not do anything if: • Its deployment component has run out of resources or • All its process are blocked Otherwise, time cannot advance. Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 17 / 43

  31. Operational Semantics - Extension crl [ progress ] : � t : Clock | limit : limit � } { cn − → {Adv( cn ) � t + 1: Clock | limit : limit � } if canAdv( cn , t ) ∧ t < limit . Adv( cn ) resets the free resources of each deployment component to their specified limit. canAdv( cn , t ) is true if ◮ no object can do anything and no invocation messages to that object are in the configuration. An object can not do anything if: • Its deployment component has run out of resources or • All its process are blocked Otherwise, time cannot advance. Paper: Validating Timed Models of Deployment Components with Parametric Concurrency. Proc. Int. Conference on Formal Verification of Object-Oriented Software (FoVeOOS) 2010. LNCS 6528, pg. 46–60. Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 17 / 43

  32. Example: A Shopping Service order() Client success? Web Shop Model order() Client success? Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 18 / 43

  33. Example: A Shopping Service getsession() order() Client Agent Sessions success? order() makeorder() Session DB Client result success? Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 19 / 43

  34. Example: A Shopping Service - Abs Model Database interface Database { Bool makeOrder (); } class Database (Nat min, Nat max) implements Database { Bool makeOrder () { Time t:= now ; await now >= t + min; return now <= t + max; } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 20 / 43

  35. Example: A Shopping Service - Abs Model interface Database { Bool makeOrder (); } class Database (Nat min, Nat max) implements Database { Bool makeOrder () { Time t:= now ; await now >= t + min; return now <= t + max; } } Session interface Session { Bool order (); } class Session (Agent agent, Database db) implements Session { Bool order () { return db.makeorder(); agent.free(this); } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 20 / 43

  36. Example: A Shopping Service - Abs Model interface Database { Bool makeOrder (); } class Database (Nat min, Nat max) implements Database { Bool makeOrder () { Time t:= now ; await now >= t + min; return now <= t + max; } } interface Session { Bool order (); } class Session (Agent agent, Database db) implements Session { Bool order () { return db.makeorder(); agent.free(this); } } Agent interface Agent { Session getSession (); Void free (Session session); } class Agent (Database db, Set[Session] sessionPool) implements Agent { Session getSession () { if isempty(sessionPool) { return new Session(this, db); } else { session:=choose(sessionPool); sessionPool:=remove(session,sessionPool); return session; } } Void free (Session session) {sessionPool := add(sessionPool, session); } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 20 / 43

  37. Example: Client Behavior Periodic Client order() order() order() order() order() order() ... time c c Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 21 / 43

  38. Example: Client Behavior Periodic Client order() order() order() order() order() order() ... time c c Sync Client success success success order() order() order() order() time c c c Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 21 / 43

  39. Example: Client Behavior - Abs Model Synchronous client class SyncClient (Agent a, Nat c) { Void run { Time t := now ; Session s := a.getsession(); Bool result := s.order(); await now >= t + c; this!run(); } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 22 / 43

  40. Example: Client Behavior - Abs Model class SyncClient (Agent a, Nat c) { Void run { Time t := now ; Session s := a.getsession(); Bool result := s.order(); await now >= t + c; this!run(); } } Periodic client class PeriodicClient (Agent a, Nat c) { Void run { Time t := now ; Session s := a.getsession(); Fut(Bool) rc := s!order(); await now >= t + c; this!run(); } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 22 / 43

  41. Example: Simulation getsession() Shop order() Client Agent Sessions success? order() makeorder() Session DB result Client success? Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 23 / 43

  42. Example: Simulation and Testing - Abs Model Different configurations: Void main () { Component shop := component (10); Database db := new Database(5, 10) in shop; Agent a := new Agent(db, {}) in shop; SyncClient c := new SyncClient(a, 5); ... } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 24 / 43

  43. Example: Simulation and Testing - Abs Model Different configurations: Void main () { Component shop := component (10); Database db := new Database(5, 10) in shop; Agent a := new Agent(db, {}) in shop; SyncClient c := new SyncClient(a, 5); ... } or Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 24 / 43

  44. Example: Simulation and Testing - Abs Model Different configurations: Void main () { Component shop := component (10); Database db := new Database(5, 10) in shop; Agent a := new Agent(db, {}) in shop; SyncClient c := new SyncClient(a, 5); ... } or Void main () { Component shop := component (10); Database db := new Database(5, 10) in shop; Agent a := new Agent(db, {}) in shop; PeriodicClient c := new PeriodicClient(a, 5); ... } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 24 / 43

  45. Example: Simulations in the Maude Interpreter Use Maude as a language interpreter to simulate the different scenarios Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 25 / 43

  46. Example: Simulations in the Maude Interpreter - Results The total and successful requests, depending on the number of clients and resources Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 26 / 43

  47. Example: Simulations in the Maude Interpreter - Results The total and successful requests, depending on the number of clients and resources Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 26 / 43

  48. Example: Simulations in the Maude Interpreter - Results The total and successful requests, depending on the number of clients and resources Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 26 / 43

  49. Example: Simulations in the Maude Interpreter - Results The total and successful requests, depending on the number of clients and resources For a larger number of periodic clients, the system becomes unresponsive Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 26 / 43

  50. Deployment Component method1() DC Object1 result methodB() ObjectA methodN() ObjectC methodA() ObjectN result ObjectB Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 27 / 43

  51. Dynamic Resource Reallocation DC1 method1() methodB() ObjectA ObjectC Object1 result Balancer1 request() methodA() DC2 Balancer2 methodN() ObjectN ObjectB result Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 28 / 43

  52. Dynamic Resource Reallocation ◮ Let components and resources be first-class citizens in the language Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 29 / 43

  53. Dynamic Resource Reallocation ◮ Let components and resources be first-class citizens in the language ◮ Now, we can store and pass on components and resource values Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 29 / 43

  54. Dynamic Resource Reallocation ◮ Let components and resources be first-class citizens in the language ◮ Now, we can store and pass on components and resource values More new expressions and statements in Abs Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 29 / 43

  55. Dynamic Resource Reallocation ◮ Let components and resources be first-class citizens in the language ◮ Now, we can store and pass on components and resource values More new expressions and statements in Abs Consider a variable dc of type Component and r of type Resource : Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 29 / 43

  56. Dynamic Resource Reallocation ◮ Let components and resources be first-class citizens in the language ◮ Now, we can store and pass on components and resource values More new expressions and statements in Abs Consider a variable dc of type Component and r of type Resource : ◮ The expression mycomp returns dc of the object. Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 29 / 43

  57. Dynamic Resource Reallocation ◮ Let components and resources be first-class citizens in the language ◮ Now, we can store and pass on components and resource values More new expressions and statements in Abs Consider a variable dc of type Component and r of type Resource : ◮ The expression mycomp returns dc of the object. ◮ The expression available returns the number of resources currently allocated to mycomp Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 29 / 43

  58. Dynamic Resource Reallocation ◮ Let components and resources be first-class citizens in the language ◮ Now, we can store and pass on components and resource values More new expressions and statements in Abs Consider a variable dc of type Component and r of type Resource : ◮ The expression mycomp returns dc of the object. ◮ The expression available returns the number of resources currently allocated to mycomp ◮ The expression load ( e ) returns the average number of used resources in mycomp during the last e time intervals Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 29 / 43

  59. Dynamic Resource Reallocation ◮ Let components and resources be first-class citizens in the language ◮ Now, we can store and pass on components and resource values More new expressions and statements in Abs Consider a variable dc of type Component and r of type Resource : ◮ The expression mycomp returns dc of the object. ◮ The expression available returns the number of resources currently allocated to mycomp ◮ The expression load ( e ) returns the average number of used resources in mycomp during the last e time intervals ◮ The statement transfer ( dc , r ) reallocates r resources from mycomp to another component dc Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 29 / 43

  60. Dynamic Resource Reallocation ◮ Let components and resources be first-class citizens in the language ◮ Now, we can store and pass on components and resource values More new expressions and statements in Abs Consider a variable dc of type Component and r of type Resource : ◮ The expression mycomp returns dc of the object. ◮ The expression available returns the number of resources currently allocated to mycomp ◮ The expression load ( e ) returns the average number of used resources in mycomp during the last e time intervals ◮ The statement transfer ( dc , r ) reallocates r resources from mycomp to another component dc Paper: Dynamic Resource Reallocation Between Deployment Components. Proc. Int. Conference on Formal Engineering Methods (ICFEM) 2010. LNCS 6447, pg. 646–661. Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 29 / 43

  61. Example: Phone Services call(n) Client tel sms() call(n) Client sms sms() Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 30 / 43

  62. Example: Phone Services telcomp call(n) Client tel telb request() sms() call(n) smscomp Client sms smsb sms() Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 31 / 43

  63. Example: Phone Services - Abs Model Telephone Service interface TelephoneService { Void call (Int duration); } class TelephoneService implements TelephoneService { Void call (Int duration) { Time t; t := now ; await now >= t + duration; } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 32 / 43

  64. Example: Phone Services - Abs Model interface TelephoneService { Void call (Int duration); } class TelephoneService implements TelephoneService { Void call (Int duration) { Time t; t := now ; await now >= t + duration; } } SMS Service interface SMSService { Void sendSMS (); } class SMSService implements SMSService { Void sendSMS () { skip ; } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 32 / 43

  65. Example: Load Balancing Strategy - Abs Model The proposed resource-related language-constructors available , load and transfer allow to express different load balancing schemes: Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 33 / 43

  66. Example: Load Balancing Strategy - Abs Model The proposed resource-related language-constructors available , load and transfer allow to express different load balancing schemes: A simple balancer scheme interface Balancer { Void setPartner (Balancer p); Void request (Component comp); } class Balancer { Balancer partner := null; Void setPartner(Balancer p) { partner := p; } Void request (Component comp) { if ( load (1) < available − 10 ) { transfer (comp, available /2);} } Void run () { Time t := now ; await now > t; if (partner � = null ∧ available < load (1)*0.9) { partner.request( mycomp );} this!run(); } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 33 / 43

  67. Example: The New Year’s Eve Client Behavior Alternate Huge number of Alternate sms and call sms per time interval sms and call time Midnight Window 50 70 Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 34 / 43

  68. Example: The New Year’s Eve Client Behavior Normal behavior of client class NYEbehavior (cycle: Int, ts: TelephoneService, smss: SMSService) { Time created := now ; Bool call := false; Void normalBehavior () { Time t := now ; if ( now > created + 50 && now < created + 70) { !midnightWindow(); } else { if (call) ts.call(1;) else !smss.sendSMS() call := ˜ call; await now >= t + cycle; !normalBehavior(); } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 35 / 43

  69. Example: The New Year’s Eve Client Behavior Midnight behavior of client Void midnightWindow () { Time t := now ; Int i := 0; if ( now > created + 70) { !normalBehavior(); } else { while (i < 10) { !smss.sendSMS(); i := i+1; } await now > t; !midnightWindow(); } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 36 / 43

  70. Example: The New Year’s Eve Client Behavior Void midnightWindow () { Time t := now ; Int i := 0; if ( now > created + 70) { !normalBehavior(); } else { while (i < 10) { !smss.sendSMS(); i := i+1; } await now > t; !midnightWindow(); } } Run op run () { !normalBehavior(); } } Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 36 / 43

  71. Example: Simulating and Testing - Abs Model Void main () { Component smscomp := component (50); Component telcomp := component (50); Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 37 / 43

  72. Example: Simulating and Testing - Abs Model Void main () { Component smscomp := component (50); Component telcomp := component (50); SMSService sms := new SMSService() in smscomp; TelephoneService tel := new TelephoneService() in telcomp; Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 37 / 43

  73. Example: Simulating and Testing - Abs Model Void main () { Component smscomp := component (50); Component telcomp := component (50); SMSService sms := new SMSService() in smscomp; TelephoneService tel := new TelephoneService() in telcomp; Balancer smsb := new Balancer in smscomp; Balancer telb := new Balancer in telcomp; Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 37 / 43

  74. Example: Simulating and Testing - Abs Model Void main () { Component smscomp := component (50); Component telcomp := component (50); SMSService sms := new SMSService() in smscomp; TelephoneService tel := new TelephoneService() in telcomp; Balancer smsb := new Balancer in smscomp; Balancer telb := new Balancer in telcomp; smsb.setPartner(telb); telb.setPartner(smsb); Rudolf Schlatte Deployment Components 10.3.2011, Tallinn 37 / 43

Recommend


More recommend