1 / 11

Seminarium on Component-based Software Engineering

Seminarium on Component-based Software Engineering. Component interfaces. Marcello Bonsangue LIACS – Leiden University Fall 2005. Interfaces. A component interface define mean to connect a a component In a component based application providers and clients are ignorant of each other

herndons
Download Presentation

Seminarium on Component-based Software Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Seminarium onComponent-based Software Engineering Component interfaces Marcello Bonsangue LIACS – Leiden University Fall 2005

  2. Interfaces • A component interface define mean to connect a a component • In a component based application providers and clients are ignorant of each other • A component can have multiple interfaces • To offer multiple services (possibly with overlapping functionalities) • To allow for multiple versions to live together Seminarium CBSE

  3. Interfaces (II) • For reachability, interfaces should be named according to a unique naming scheme (at least productwise) • Example: • ISBN, an international identifier for each published book • No meaning, only identity • E.g. two different books with the same title Seminarium CBSE

  4. Provided and required interfaces • Provided interface • A specification of what the component provides to its deployment environment • Required interface • A specification of what the deployment environment needs to provide in order the component to function properly Seminarium CBSE

  5. Direct and indirect interfaces • An interface is often a set of named operations that can be invoked by a client • A component can directly provide interfaces as procedural libraries or there can be interfaces provided indirectly by objects made available by the component. Seminarium CBSE

  6. Indirect interface • An indirect interface uses a technique called dispatch which can lead to involvement of a third party which might be unknown to both client and the provider Word processing comp. Grammar checking comp. Word processor class Grammar checker class Has-a Has-a Implements Has-a Text services class Checker interface Text services component Seminarium CBSE

  7. Versioning • Version management is traditionally based on a comparison between numbers to provide upward compatibility • With direct interfaces it suffices to check the version number at bind-time • With indirect interfaces a reference to a compatible version may be passed to another component creating incompatibility • Solution 1: check version number each time a reference cross component boundaries • Solution 2: Interfaces are immutable and multiple versions may live together Seminarium CBSE

  8. Contracts • An interface is a contract between a client of the interface and a provider of its implementation • The contract can be captured by pre-and post-conditions for each operation • The client has to establish the pre-condition before executing an operation • The provider can rely on the pre-condition being met before a call to the operation • The provider has to establish the post-condition before returning to the client • The client can rely on the post-condition being met when the operation returns. Seminarium CBSE

  9. What must be in a contract? • Relevant functional features • Non-functional requirement • Performance • Space requirements • It must be precise but not too restrictive Seminarium CBSE

  10. How can we write a contract • Hoare triples {Pre} operation {Post} • Partial correctness • Total correctness • Temporal logic • Progress (leads-to, eventually) • Safety (Invariants, always) • Fairness (eventually always) • With time and space bounds • Average cases • Together with platform-dependent measurments • Informally, in precise but plain English • Several interpretations can be found • Analogy with real-world laws Seminarium CBSE

  11. Independent extensibility • A system is independently extensible if it is extensible and independently developed extensions can be combined • Examples: • Operating Systems can load and execute applications • WWW-Browsers: plug-ins Seminarium CBSE

More Related