Specification and Analysis of Contracts Lecture 2 Components, - - PowerPoint PPT Presentation

specification and analysis of contracts lecture 2
SMART_READER_LITE
LIVE PREVIEW

Specification and Analysis of Contracts Lecture 2 Components, - - PowerPoint PPT Presentation

Specification and Analysis of Contracts Lecture 2 Components, Services and Contracts Gerardo Schneider gerardo@ifi.uio.no http://folk.uio.no/gerardo/ Department of Informatics, University of Oslo SEFM School, Oct. 27 - Nov. 7, 2008 Cape


slide-1
SLIDE 1

university-logo

Specification and Analysis of Contracts Lecture 2 Components, Services and Contracts

Gerardo Schneider

gerardo@ifi.uio.no http://folk.uio.no/gerardo/ Department of Informatics, University of Oslo SEFM School, Oct. 27 - Nov. 7, 2008 Cape Town, South Africa

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 1 / 28

slide-2
SLIDE 2

university-logo

Plan of the Course

1 Introduction 2 Components, Services and Contracts 3 Background: Modal Logics 1 4 Background: Modal Logics 2 5 Deontic Logic 6 Challenges in Defining a Good Contract language 7 Specification of ’Deontic’ Contracts (CL) 8 Verification of ’Deontic’ Contracts 9 Conflict Analysis of ’Deontic’ Contracts 10 Other Analysis of ’Deontic’ Contracts and Summary Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 2 / 28

slide-3
SLIDE 3

university-logo

Plan

1

Components

2

Service-Oriented Computing

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 3 / 28

slide-4
SLIDE 4

university-logo

Plan

1

Components

2

Service-Oriented Computing

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 4 / 28

slide-5
SLIDE 5

university-logo

What is a Component?

We will concentrate only on software components

Definition (?!)

A component has to be a unit of deployment

It has to be an executable deliverable for a (virtual) machine

A component has to be a unit of versioning and replacement

It has to remain invariant in different contexts It lives at the level of packages, modules, or classes, and not at the level of objects

It is useful to see software components as a collection of modules and resources

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 5 / 28

slide-6
SLIDE 6

university-logo

What is a Component?

What is Deployment?

1 Acquisition is the process of obtaining a software component 2 Deployment is the process of readying the component for installation

in a specific environment

3 Installation is the process of making the component available in the

specific environment

4 Loading is the process of enabling an installed component in a

particular runtime context Deployment is not a development activity: it does not happen at the supplier’s site

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 6 / 28

slide-7
SLIDE 7

university-logo

Components Vs. Objects

1 Components are supposed to be self-contained units, platform

independent, and independently deployable.

Objects are usually not executable by themselves

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 7 / 28

slide-8
SLIDE 8

university-logo

Components Vs. Objects

1 Components are supposed to be self-contained units, platform

independent, and independently deployable.

Objects are usually not executable by themselves

2 A component may contain many objects which are encapsulated and

thus are not accessible from the outer of the components

If an object creates another object inside a component, this new object is not visible from the outside unless explicitly allowed by the interface

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 7 / 28

slide-9
SLIDE 9

university-logo

Components Vs. Objects

1 Components are supposed to be self-contained units, platform

independent, and independently deployable.

Objects are usually not executable by themselves

2 A component may contain many objects which are encapsulated and

thus are not accessible from the outer of the components

If an object creates another object inside a component, this new object is not visible from the outside unless explicitly allowed by the interface

3 Components are unique and cannot be copied within one system

There might exists many copies of an object

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 7 / 28

slide-10
SLIDE 10

university-logo

Components Vs. Objects

1 Components are supposed to be self-contained units, platform

independent, and independently deployable.

Objects are usually not executable by themselves

2 A component may contain many objects which are encapsulated and

thus are not accessible from the outer of the components

If an object creates another object inside a component, this new object is not visible from the outside unless explicitly allowed by the interface

3 Components are unique and cannot be copied within one system

There might exists many copies of an object

4 Components are static entities representing the main elements of the

run-time structure

Classes can be instantiated dynamically in any number A purely class-oriented program does not identify the main elements of a system

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 7 / 28

slide-11
SLIDE 11

university-logo

Why Components?

Four main “levels” of reasons:

1 “Make and buy”

Balance between purpose-built software and standard software

2 Reuse partial design and implementation fragments across multiple

solutions or products

3 Use components from multiple sources, and integrate them on site

(i.e., not part of the software build process)

The integration is called deployment The matching components are called deployable components

4 Achieve highly dynamic servicing, upgrading, extension, and

integration of deployed systems

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 8 / 28

slide-12
SLIDE 12

university-logo

Challenges

Practical use of components stop in the third reason above

Truly dynamic components needs to address correctness, robustness and efficiency

Components can be combined in many ways

No possibility to perform exhaustive and final integration tests at the component supplier’s site Verification of component properties are crucial A compositional reasoning at all levels is required

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 9 / 28

slide-13
SLIDE 13

university-logo

Challenges

Practical use of components stop in the third reason above

Truly dynamic components needs to address correctness, robustness and efficiency

Components can be combined in many ways

No possibility to perform exhaustive and final integration tests at the component supplier’s site Verification of component properties are crucial A compositional reasoning at all levels is required

Remark

A correct component is 100% reliable A component with a very slight defect is 100% unreliable!

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 9 / 28

slide-14
SLIDE 14

university-logo

Components and Contracts I

In “traditional” component-based development, contracts are understood as specification attached to interfaces

Behavioral interfaces instead of static interfaces

A four-level approach for contract awareness has been proposed in [BJP+99]

1

Basic contracts

2

Behavioral contracts

3

Synchronization contracts

4

Quality-of-service contracts

[BJP+99] A. Beugnard, J.-M. Jézequel, N. Plouzeau and D. Watkins. “Making Components Contract Aware”.

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 10 / 28

slide-15
SLIDE 15

university-logo

Components and Contracts I

  • 1. Basic Contracts

These basic contracts specify static behavior

It determines the signature or the interface

The designer specify

The operations a component can perform The input and output parameters Possible exceptions raised during operation

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 11 / 28

slide-16
SLIDE 16

university-logo

Components and Contracts I

  • 2. Behavioral Contracts

Contract on static properties are limited and it does not deal with dynamic interactions Behavioral contracts use invariants, pre- and post-conditions, as in the “design-by-contract” approach The contract carries mutual obligations and benefits for both provider and user of a routine/method The behavioral specification could be seen as the contract itself

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 12 / 28

slide-17
SLIDE 17

university-logo

Components and Contracts I

  • 3. Synchronization Contracts

Level 2 (behavioral) contracts assume interactions are atomic or executed as transactions Synchronization contracts specify global behavior of components

In terms of synchronizations between method calls It describes dependencies: sequence, parallelism, etc

In a (concurrent) multi-client setting, the contract guarantees that whatever is requested it will be executed correctly

It requires a synchronization policy E.g. when mutual exclusion is necessary

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 13 / 28

slide-18
SLIDE 18

university-logo

Components and Contracts I

  • 4. Quality-of-Service Contracts

The previous levels allow to qualify behavioral contractual properties Quality-of-Service Contracts allows to specify quantitative contractual issues Examples of quality-of-service parameters

Maximum response delay Average response Precision of quality of a result Statistics

The problem is how to enforce such contracts

“Observing” such quantitative issues may involve the use of monitors affecting the behavior

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 14 / 28

slide-19
SLIDE 19

university-logo

Components and Contracts II

What we have seen was a hierarchical classification of contracts There is no mention of how to analyze such contracts

Our Proposal

We propose the use of ’deontic’ e-contracts to help verification of and reasoning about components To be used both at the development and deployment phases

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 15 / 28

slide-20
SLIDE 20

university-logo

Components and Contracts II

Development Phase

Development: Associate one or more contracts to each component, specifying the obligations, permissions, and prohibitions in the component’s interacting behavior

Conformance

Co1 Cc1 Cc1 Co1 Static Analysis Testing/Simulation (Maude) Co1 Cc1 Con Ccn Ccn Cc1

Compatibitliy/Conflict−free

Con Ccn Development (Creol)

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 16 / 28

slide-21
SLIDE 21

university-logo

Components and Contracts II

Development Phase

Development: Associate one or more contracts to each component, specifying the obligations, permissions, and prohibitions in the component’s interacting behavior Static Analysis: The contract is formally analyzed to guarantee that it is contradiction free. Static conformance between the component and its contract is also proved.

Conformance

Co1 Cc1 Cc1 Co1 Static Analysis Testing/Simulation (Maude) Co1 Cc1 Con Ccn Ccn Cc1

Compatibitliy/Conflict−free

Con Ccn Development (Creol)

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 16 / 28

slide-22
SLIDE 22

university-logo

Components and Contracts II

Development Phase

Development: Associate one or more contracts to each component, specifying the obligations, permissions, and prohibitions in the component’s interacting behavior Static Analysis: The contract is formally analyzed to guarantee that it is contradiction free. Static conformance between the component and its contract is also proved. Testing/Simulation: Simulate and test each component separately and its interaction with other components being developed

Conformance

Co1 Cc1 Cc1 Co1 Static Analysis Testing/Simulation (Maude) Co1 Cc1 Con Ccn Ccn Cc1

Compatibitliy/Conflict−free

Con Ccn Development (Creol)

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 16 / 28

slide-23
SLIDE 23

university-logo

Components and Contracts II

Deployment Phase

Pre-execution Analysis: – Before composition the contracts are checked to guarantee compatibility – If disagreement: a phase of negotiation may start, or the component is simply rejected – Kind of static analysis on the side of the execution platform

Coi Cci Coi Con Ccn Pre−execution Analysis Co1 Cc1 Con Ccn Executing Platform Co1 Cc1 Monitor Cci

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 17 / 28

slide-24
SLIDE 24

university-logo

Components and Contracts II

Deployment Phase

Pre-execution Analysis: – Before composition the contracts are checked to guarantee compatibility – If disagreement: a phase of negotiation may start, or the component is simply rejected – Kind of static analysis on the side of the execution platform Execution: – If accepted, component is deployed – A monitor guarantees that the components behave according to the contract – In case of contract violation, the monitor acts as stipulated in the contract, or cancel the contract and disable the component

Coi Cci Coi Con Ccn Pre−execution Analysis Co1 Cc1 Con Ccn Executing Platform Co1 Cc1 Monitor Cci

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 17 / 28

slide-25
SLIDE 25

university-logo

Plan

1

Components

2

Service-Oriented Computing

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 18 / 28

slide-26
SLIDE 26

university-logo

What is a Service?

Definition

A service is a self-describing, platform-independent computational element It supports rapid, low-cost composition of distributed applications It allows to offer competences over intra-nets or the Internet using standard languages (e.g., XML-based) and protocols

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 19 / 28

slide-27
SLIDE 27

university-logo

What is a Service?

Definition

A service is a self-describing, platform-independent computational element It supports rapid, low-cost composition of distributed applications It allows to offer competences over intra-nets or the Internet using standard languages (e.g., XML-based) and protocols Services must be

Technology neutral: Invocation mechanisms should comply with standards Loosely coupled: Not require any knowledge, internal structure, nor context at the client or service side Locally transparent: Have their definition and local information stored in repositories accessible independent of their location

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 19 / 28

slide-28
SLIDE 28

university-logo

What is a Service?

Definition

A service is a self-describing, platform-independent computational element It supports rapid, low-cost composition of distributed applications It allows to offer competences over intra-nets or the Internet using standard languages (e.g., XML-based) and protocols Services must be

Technology neutral: Invocation mechanisms should comply with standards Loosely coupled: Not require any knowledge, internal structure, nor context at the client or service side Locally transparent: Have their definition and local information stored in repositories accessible independent of their location

Services may be

Simple Composite

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 19 / 28

slide-29
SLIDE 29

university-logo

Service-Oriented Computing

Definition

“Service-Oriented Computing (SOC) is the computing paradigm that utilizes services as fundamental elements for developing applications / solutions.” “To build the service model, SOC relies on the Service-Oriented Architecture (SOA), which is a way of reorganizing software applications and infrastructure into a set of interacting services.”

(*) From “Service-Oriented Computing: Concepts, Characteristics and Directions”, by Mike P. Papazoglou

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 20 / 28

slide-30
SLIDE 30

university-logo

Services vs. Components

Services and Components

Payment of services is on execution basis (per-use value) for the delivery of the service

In components, there is a one-time payment for the implementation of the software

Services may be a non-component implementation

A deployed component may offer one or more services

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 21 / 28

slide-31
SLIDE 31

university-logo

A Taxonomy of SOA Contract Specification Languages

We will follow the taxonomy proposed in [OR08]

Services seen abstractly as Mealy machines

Three broad families of languages and standards to deal with service contracts —Those dealing with:

1

Web services

2

Semantic Web services

3

Electronic business

[OR08] J.C. Okika and A.P. Ravn. A Taxonomy of SOA Contract Specification Languages.

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 22 / 28

slide-32
SLIDE 32

university-logo

A Taxonomy of SOA Contract Specification Languages

We will follow the taxonomy proposed in [OR08]

Services seen abstractly as Mealy machines

Three broad families of languages and standards to deal with service contracts —Those dealing with:

1

Web services

2

Semantic Web services

3

Electronic business

Some Preliminaries:

Definition

An ontology is a formal representation of a set of concepts within a domain and the relationships between those concepts. It is used to reason about the properties of that domain, and may be used to define the domain

[OR08] J.C. Okika and A.P. Ravn. A Taxonomy of SOA Contract Specification Languages.

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 22 / 28

slide-33
SLIDE 33

university-logo

A Taxonomy of SOA Contract Specification Languages

Examples of the three families: (1) Web services; (2) Semantic Web services; (3) Electronic business

Example

1 Web Service Definition Language (WSDL)

An XML-based language Describes capabilities of WS through its interface description Others: WS-BPEL, WS-CDL, WS-Security, WSLA, WS-Policy

2 Semantic Markup for Web Services (OWL-S)

Built on top of the Ontology Web Language (OWL) An ontology of services for to discover, invoke, compose, and monitor Web resources offering particular services

3 Business Process Specification Schema (BPSS)

A framework to support execution of business collaborations consisting

  • f business transactions

It supports the specification of business transactions Other examples: ebXML, CPP, CPA

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 23 / 28

slide-34
SLIDE 34

university-logo

A Taxonomy of SOA Contract Specification Languages

Aspects of Services

Interface: Defines the (syntactic) interaction between services (or between a service provider and consumer) Functionality: What the service can do for a user Preconditions: What must be true when the service is called Post-conditions: Which guarantees hold when the service is done Protocol: Describes the input events, the response of the service to those events, signals and messages Security: Techniques and practices ensuring confidentiality properties for a service Extra functional properties

Performance: Measure in terms of:

Throughput: Nr. of requests served a at a given time period Latency: Round-trip time between sending-receiving

Reliability: Capability of keeping the service in operation (and service quality) Availability: Whether the service is ready for immediate use

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 24 / 28

slide-35
SLIDE 35

university-logo

A Taxonomy of SOA Contract Specification Languages

Web Services Semantic Web Electronic Business Interface WSDL OWL-S ebBSI Functionality WS-BPEL, WSOL OWL-S, WSMO ebBPSS Protocol WS-BPEL, WS-CDL OWL-S, WSMO ebBPSS Security WS-Security OWL-S ebCPA Policy WS-Policy OWL-S Trust WS-Trust ebCPP (XMLDSIG) Availability WSOL Performance WSLA, WSOL WSMO, WSML ebCPA Response Time Throughput

[OR08] J.C. Okika and A.P. Ravn. A Taxonomy of SOA Contract Specification Languages.

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 25 / 28

slide-36
SLIDE 36

university-logo

Services and Contracts

In the above taxonomy languages were classified according to many aspects None of them covers all the aspects

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 26 / 28

slide-37
SLIDE 37

university-logo

Services and Contracts

In the above taxonomy languages were classified according to many aspects None of them covers all the aspects

Challenges

How to obtain a general language for describing service contracts How to reason about service contracts How to address (automatic) negotiation How to enforce the fulfillment of the contract How to describe normal and exceptional behavior

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 26 / 28

slide-38
SLIDE 38

university-logo

Services and Contracts

In the above taxonomy languages were classified according to many aspects None of them covers all the aspects

Challenges

How to obtain a general language for describing service contracts How to reason about service contracts How to address (automatic) negotiation How to enforce the fulfillment of the contract How to describe normal and exceptional behavior

Observation

We propose the use of ’deontic’ e-contracts to help specification of and reasoning about services Such contracts may also be useful in the negotiation process

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 26 / 28

slide-39
SLIDE 39

university-logo

Services and Contracts

1

Translate the informal contract into a formal language

(6) (1) (3) (2) (4) (5)

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 27 / 28

slide-40
SLIDE 40

university-logo

Services and Contracts

1

Translate the informal contract into a formal language

2

Verify the contract (e-g-, that it is contradiction-free)

(6) (1) (3) (2) (4) (5)

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 27 / 28

slide-41
SLIDE 41

university-logo

Services and Contracts

1

Translate the informal contract into a formal language

2

Verify the contract (e-g-, that it is contradiction-free)

3

Negotiate the contract

(6) (1) (3) (2) (4) (5)

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 27 / 28

slide-42
SLIDE 42

university-logo

Services and Contracts

1

Translate the informal contract into a formal language

2

Verify the contract (e-g-, that it is contradiction-free)

3

Negotiate the contract

4

After negotiation verify the contract again

(6) (1) (3) (2) (4) (5)

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 27 / 28

slide-43
SLIDE 43

university-logo

Services and Contracts

1

Translate the informal contract into a formal language

2

Verify the contract (e-g-, that it is contradiction-free)

3

Negotiate the contract

4

After negotiation verify the contract again

5

Obtain the final contract and “sign” it

(6) (1) (3) (2) (4) (5)

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 27 / 28

slide-44
SLIDE 44

university-logo

Services and Contracts

1

Translate the informal contract into a formal language

2

Verify the contract (e-g-, that it is contradiction-free)

3

Negotiate the contract

4

After negotiation verify the contract again

5

Obtain the final contract and “sign” it

6

Monitor/enforce contract fulfillment

(6) (1) (3) (2) (4) (5)

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 27 / 28

slide-45
SLIDE 45

university-logo

Further Reading

  • C. Szyperski. Component Technology - What, Where, and How?
  • A. Beugnard, J.-M. Jézequel, N. Plouzeau and D. Watkins. Making

Components Contract Aware

  • M. Papazoglou. Service-Oriented Computing: Concepts,

Characteristics and Directions

  • O. Owe, G. Schneider and M. Steffen. Objects, Components and

Contracts J.C. Okika and A.P. Ravn. A Taxonomy of SOA Contract Specification Languages COSoDIS project: http://www.ifi.uio.no/cosodis

Gerardo Schneider (UiO) Specification and Analysis of e-Contracts SEFM, 3-7 Nov 2008 28 / 28