Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 Service Behavior Consistency in the OSGi Platform Authors Y.Qin, H.Hao,L.Jun, G.Jidong and L.Jian Proceedings.

Similar presentations


Presentation on theme: "Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 Service Behavior Consistency in the OSGi Platform Authors Y.Qin, H.Hao,L.Jun, G.Jidong and L.Jian Proceedings."— Presentation transcript:

1 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 Service Behavior Consistency in the OSGi Platform Authors Y.Qin, H.Hao,L.Jun, G.Jidong and L.Jian Proceedings of 12th Asia-Pacific Software Engineering Conference (APSEC’05) (acceptance rate ~= 29%)Reporter C.F.Liao ( 廖峻鋒 ) Feb 15,2007

2 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 2/30 Outline  Preliminaries  Behavior Inconsistency Problem  The Proposed Solutions Service Behavior Modeling Verification of Service Behavior Consistency  Implementation  skipped  Conclusion

3 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 3/30 220 V 110V Reusable Component Structural Consistent Structural Consistent but Behavioral Inconsistent! What this Paper is Talking About?

4 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 4/30 Making Software Reusable openTV(), X.10 Invoker openTV(), UPnP Invoker When you modify service X, You have to rewrite all of it’s invokers!

5 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 5/30 Interface As Service Specification Spec of openTV() (Interface) Invoker X.10 Implementation of openTV() UPnP Implementation of openTV() The developers can substitute the service implementations without affecting the invoker.

6 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 6/30 Substitutable Components We can substitute Service A with Service B without affect overall system behavior iff Service A is Structural Consistent with Service B w.r.t. a common interface I

7 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 7/30 Term Definitions Service Client / Service Invoker Service Specification / Interface Service Implementation / Component / Service

8 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 8/30 Formal Definitions of Interfaces and Services  Service Specification (interface)  Service Implementation A set of exported methods of IFUnique id of IF Unique id of S A set of exported methods of S

9 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 9/30 Structural Consistency  SA is Structural Consistent with Structural Consistent with SB SB w.r.t An Interface IF w.r.t An Interface IF if and only if if and only if and LogService SA SB log

10 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 10/30 Structural Consistency – An Example log finalize init LogService log finalize init log finalize init logDB Given We can obtain that So ConsoleLogService is Structural Consistence with DBLogService w.r.t. LogService ConsoleLogService DBLogService

11 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 11/30 Enhanced Structural Consistency in OSGi  OSGi enhances structural consistency by specifying “Properties” of components.  Format: RFC 1960: ”A String Representation of LDAP search filters”  Example: &(DeviceName=TV2) (Size=21) &(DeviceName=TV2) (Size=21) |(vendor~=HP)(!(dpi<=300))(type=printer) |(vendor~=HP)(!(dpi<=300))(type=printer)

12 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 12/30 OSGi Services Unique id of S A set of exported methods of S A set of properties of S We can revise the previous definition of a Service to the following form:

13 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 13/30 Behavioral Consistency  Proposed by  Proposed by B.Liskov and N.Belkhatir at 1994 in the ACM Trans on PLS. The interface mechanism in traditional OOP only guarantees Structural Consistency The implementations may have unexpected behavior even if they are Structural Consistent. Behavior  A matter of call sequences from the Service Client!

14 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 14/30 220 V The Problem of Structural Consistency  Structural Consistency only guarantees the service implementations are structurally compatible with each other.  The underlying behavior of methods may different.  What if the 110V and 220V have the same socket shape? 110V

15 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 15/30 Behavior Consistency – An Example(1) log finalize init LogService init log finalize ConsoleLogService log finalize init

16 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 16/30 Behavior Consistency – An Example(2) log finalize init LogService init log finalize logDB log finalize init logDB DBLogService The expected call sequences of LogService is different from that of DBLogService !

17 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 17/30 Ensuring the Behavior Consistency  Behavior Modeling Workflow Net  an extension of Petri Net to model the workflow management systems. Proposed by W.M.P. van der Aalst in ATPN 1997.  Consistency Validation Observation / Invocation Behavior Consistency Theory Proposed by J.Ebert and G. Engels in 1994.

18 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 18/30 Behavior Model (BM) BM is essentially a Workflow Net except TM is redefined. Places Transitions Directed Arcs Input place / output place A function that assigns each transition to a method

19 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 19/30 Summary: Revised Definition of Service

20 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 20/30 Invocation Consistency Service S1’s Behavior Model Service S1’s Behavior Model is invocation consistent with S2’s Behavior Model is invocation consistent with S2’s Behavior Model if if What is LMS ?

21 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 21/30 Legal Method Sequence (LMS)  Can be derived by depth-first traversal on a Reachability Graph of a Petri Net. Depth-First Traversal

22 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 22/30 Invocation Consistency - Example init log finalize LogService init log finalize logDB DBLogService

23 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 23/30 init logDB finalize LogService Invocation Consistency isn’t Enough ! init logDB finalize logDBEnc DBLogService

24 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 24/30 Method Projection

25 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 25/30 Observation Consistency Service S1’s Behavior Model Service S1’s Behavior Model is observation consistent with S2’s Behavior Model is observation consistent with S2’s Behavior Model if if LogService DBLogService log init logDB finalize

26 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 26/30 Observation Consistency - Example init log finalize LogService init log finalize logDB DBLogService

27 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 27/30 Verifying Behavioral Consistency The Service Implementation S is Behavioral Consistent with Service Specification I iff : The Service Implementation S is Behavioral Consistent with Service Specification I iff : (S is invocation consistent with I) (S is invocation consistent with I) (S is observation consistent with I) (The proof of this theory is in [J.Ebert and G. Engels 94])

28 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 28/30 Summary (1) Structural Consistency (Traditional OOP Reuse) Enhanced Structural Consistency (OSGi Service Reuse) Behavioral Consistency [Liskov et al.94] Modeling: UML Verification: Language Mechanism Modeling: UML Verification: OSGi Platform Modeling: Workflow Net Verification: IC / OC theorems and Key=value

29 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 29/30 Summary (2) Behavioral Consistency [Liskov et al.94] Modeling: Workflow Net Verification: IC / OC theorems Behavioral Subtyping [Liskov et al.94] Motivation Problem Modeling Workflow Net [ W.M.P. van der Aalst 97 ] OSGi Component Model Problem Domain Reachability Graph / LMS Methodology Integration / Mapping IC / OC Theorems [ J.Ebert et al.94 ] Solution Prototype Multi-Service Coordination Behavioral Consistency Extension SOBECA Implementation

30 Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 30/30 Comments  This paper provides formal modeling methods of reusable components. However, many errors in this paper.  Petri Net modeling will be more valuable if used to model distributed / concurrent components.  Stateful is considered harmful in service design, does the behavior consistency really matter?


Download ppt "Intelligent Space 國立台灣大學資訊工程研究所 智慧型空間實驗室 Service Behavior Consistency in the OSGi Platform Authors Y.Qin, H.Hao,L.Jun, G.Jidong and L.Jian Proceedings."

Similar presentations


Ads by Google