This chapter presents the following content: Introduction, general issues of semantic concern, levels of formalism for semantic specifications, phases in a component’s life, a taxonomy for component semantics.
Chapter Semantic Integrity in Component Based Development Building Reliable Componentbased Overview Introduction General Issues of Semantic Concern Levels of Formalism for Semantic Specifications Phases in a Component’s Life A Taxonomy for Component Semantics Building Reliable Componentbased Introduction The specification of an interface: is partly syntactic, partly semantic The semantic component properties are expressed: using invariants for the component as a whole contracts expressed through pre- and postconditions, for each operation Building Reliable Componentbased Specification Levels Levels of a component specification: Syntax: includes specifications on the programming language level Behavior: relates to contracts Synchronization: describes the dependencies between services provided by a component Quality of service: deals with quality of service Building Reliable Componentbased Contracts The semantics of an operation are described with a contract Pre-condition: specifies the required entry conditions for activating the operation Post-condition: specifies the exit conditions guaranteed by the operation at the end of its execution, provided the pre-condition was satisfied at the entry The outcome in case the pre-condition was not satisfied is explicitly left undefined Building Reliable Componentbased Required and Provided Interfaces To be composable solely on the basis of its specification, a component needs to be equipped with: Explicit declarations of functionality, synchronization and quality required properties provided properties Component Building Reliable Componentbased Levels of Formalism for Semantic Specifications The levels of formalism, in an increasing order of formalism: No semantics Intuitive semantics Structured semantics Executable semantics Formal semantics Building Reliable Componentbased An Example C omponent RandomAccess controlling the access to random access file of a record type R records of a fixed size access to the file is by record number It is assumed that the file is continuous Building Reliable Componentbased The contract The precondition for this interface contract single input parameter of the operation is the number of the record concerned, which must exist in the file The post-condition result of the operation is the required data record of type R Building Reliable Componentbased Level 0: No Semantics The following definition of the operation getRecord illustrates how a purely syntactic specification would be given: public R getRecord(int number) throws IOException Building Reliable Componentbased Intuitive Semantics An intuitive specification of the operation getRecord: The operation getRecord retrieves a record by its number, returning the record requested. If an error occurs, such as a disk read error or a file system error, the an I/O error is returned. Building Reliable Componentbased Structured Semantics A structured specification of the operation getRecord: getRecord returns a record identified by its number Parameters: number: the number of the record to retrieve, counted from zero Precondition: number >= 0 and number