ISO/IEC JTC1/SC22/WG11
WDTR 14369, Guidelines for the preparation of language-independent service specifications (LISS)
Version 3.1, April 1997
Contents
Editor's foreword to current version, with issue list 3
1. Introduction 6
1.1 Background 6
1.2 Principles 6
2. Scope 8
3. References 8
4. Definitions 9
5. Overview 12
5.1 Services, interfaces, service providers and service users 12
5.2 Information technology services 12
5.3 Services and language independence 13
5.4 Language-independent specifications 14
5.5 Problems of language dependence and inbuilt assumptions 15
6. Guidelines on strategy 17
6.1 Dependence of the interface on the service 17
6.2 What to do if starting from scratch 18
6.3 What to do if starting from an existing language-dependent specification 20
7. Guidelines on document organisation 26
7.1 Guideline: The general framework 26
7.2 Guideline: Separation of concerns 27
7.3 Guideline: Production and publication 28
7.4 Guideline: Document organisation when starting from a language-specific specification 28
8. Guidelines on terminology 29
8.1 Guideline: The need for rigour 29
8.2 Guideline: The need for consistency 29
8.3 Guideline: Use of undefined terms 29
8.4 Guideline: Use of ISO 2382 29
8.5 Guideline: Use of definition by reference 30
8.6 Guideline: Terminology used in bindings 30
9. Guidelines on use of formal specification languages 31
9.1 Guideline: Use of a formal specification language 31
9.2 Checklist of formal specification languages 31
9.3 Guideline: Using formal specifications from the outset 32
9.4 Guideline: Use of operational semantics 33
10. Guidelines on interoperability 34
10.1 Introduction 34
10.2 Guidelines on interoperability with other instantiations of the same service 35
10.3 Guidelines on interoperability with other services 36
11. Guidelines on concurrency issues 38
11.1 Guidelines on concurrency within the service specification 38
11.2 Guidelines on concurrency of interaction with service users 39
11.3 Guidelines on concurrency requirements on bindings 39
12. Guidelines on the selection and specification of datatypes 41
12.1 Guideline: Use of ISO/IEC 11404 41
12.2 Guideline: Specification of datatype parameter values 41
12.3 Guideline: Treatment of values outside the set defined for the datatype 42
12.4 Guideline: Specification of operations on data values 42
12.5 Guideline: Recommended basic set of datatypes 42
12.6 Guideline: Specification of arithmetic datatypes 42
12.7 Guideline: Approach to language bindings of datatypes 43
12.8 Guideline: Avoidance of representational definitions 43
13. Guidelines on specification of procedure calls 45
13.1 Guideline: Avoidance of unnecessary operational assumptions or detail 45
13.2 Guideline: Use of ISO/IEC 13886 (LIPC) procedure calling model 45
13.3 Guidelines on the use of ISO/IEC 13886 (LIPC) 46
13.4 Interfacing via remote procedure calling (RPC) 48
13.5 Guideline: Guidance concerning procedure calling to those defining language bindings to the LISS 49
14. Guidelines on specification of fault handling 51
14.1 Guideline: Fault detection requirements 51
14.2 Checklist of potential faults 51
14.3 Guideline: Recovery from non-fatal faults 52
15. Guidelines on options and implementation dependence 53
15.1 Guidelines on service options 53
15.2 Guidelines on interface options 54
15.3 Guidelines on binding options 54
15.4 Guidelines on implementation dependence 55
16. Guidelines on conformity requirements 58
16.1 Guidelines for specifying conformity of implementations of the service 59
16.2 Guidelines for specifying conformity of implementations of the interface 59
16.3 Guidelines for specifying conformity of bindings 59
17. Guidelines on bindings 61
17.1 Guideline: Use of bindings to LID and LIPC 61
17.2 Guideline: Adherence to defined semantics 61
17.3 Guideline: Binding document organisation 61
17.4 Guideline: "Reference card" binding documents 62
18. Guidelines on revisions 64
18.1 Kinds of change that a revision can introduce 64
18.2 General guidelines applicable to revisions 65
18.3 Guidelines on revision of the service specification 66
18.4 Guidelines on revision of the service interface 66
18.5 Guidelines on revision of language bindings following revision of the service interface 66
18.6 Guidelines on revision of a language binding following revision of the language 67
Annex A Brief guide to language-independent standards 69
A.1 Language-independent arithmetic 69
A.2 Language-independent datatypes 69
A.3 Language-independent procedure calling 70
Annex B Glossary of language-independent terms 72
A.1 Source indications 72
A.2 Index of terms 72
Editor's foreword to current version
[BLM: not for inclusion in final document - BLM]
Change bars since version 2.5 have been added for paragraphs where there have been significant changes, and changed or new wording has been underlined. (It has not been done for the new annexes - nor, for obvious reasons, for this foreword!) It has been done manually since the number of minor corrections has been so great that they would have swamped the significant changes had the automatic facility been used.
In this version two annexes have been added, as decided at the 1996 WG11 meeting: a brief guide to language-independent standards in Annex A and a glossary of language-independent terms in Annex B. There are many detailed changes elsewhere consequent on WG11's review at the 1996 meeting, especially in clauses 1, 5, 6 and 7.
These new clauses 16 and 18, and the two annexes, are so far empty. The other clauses still not yet "complete" are 4 and parts of 13, especially 13.4. Clause 4 still requires WG11 to approve the terminology to be used and to agree definitions. Clause 13.4 requires expertise in RPC that the acting project editor does not possess, and no draft has yet been offered.
The following clauses have not changed other than in some case for correction of typographical errors and minor editorial improvements of wording: 12, 14, 15, 16, 18.
The actions placed upon me at the 1996 meeting of WG11 were:
1. Change "internal service" to "service" and "external interface" to "interface".
Action taken: Done, though there may still be still echoes of that terminology in some paragraphs. It is assumed that any such echoes will be picked up during the next review, if they cause confusion, though I hope that "internal" and "external" are now clear enough in their everyday sense from the context.
2. Check that each use of "language-independent service specification" does mean that and not "language-independent interface specification".
Action taken: Done, though others will need to check that I haven't slipped up anywhere.
3. Send out revised versions of the Introduction and of Clause 5 to attendees at the 1996 meeting of WG11, for review and comment.
Action taken: Done.
4. Remind John Dawes that he had promised some PCTE material which might be used.
Action taken: Done. I have reviewed it, made note of relevant points, and have gone through them. I think they are now all covered, directly or indirectly - most were already. The main resulting changes have been considerable improvements to Clause 9.
5. Use hyphenation as follows: include it in forms like "this is a language-independent specification" but not in forms like "this specification is language independent".
Action taken: Done, though others will need to check that I haven't slipped up anywhere. (Change indications have not been made for any alterations here.)
Issues list
1. Should there be a clause on testing?
Status: Unimplemented
Comments: Yes there should. Make new clause on conformity testing after 16 but also make new clause after 15 on enquiry functions, so that testing validity of the service and its interface can be distinguished from testing availability of the service. That on conformity testing should distinguish between general issues on service and interface and testing for language independence.
Actions: WG11 members and LISS reviewers were requested to submit material to project editor, in the form of proposed guidelines, or identification of existing material which could be used.
Resulting changes: None - insufficient material to use was received.
Acting project editor's recommendation: Omit from the first edition, unless complete usable clauses are received as a result of PDTR balloting. SC22's remit to WG11 was to produce a usable TR as quickly as practicable, even if it was not comprehensive in coverage.
2. Should the TCOS document be referenced?
Status: Resolved
Comments: Yes, either in the Foreword (to be added) or in a bibliography.
Actions: The acting project editor was asked to consider how best to do this. In fact it did not seem to me that there was any benefit in having a Foreword additional both to the usual ISO Foreword and the Introduction, or in having a bibliography. Hence I decided to put the reference in the Introduction.
Resulting changes: A new paragraph has been added and the Introduction divided into two subclauses, 1.1 Background, in which the paragraph appears, and 1.2 Principles.
3. Should the relationship to APIs be covered?
Status: Unimplemented
Comments: (none)
Actions: WG11 members and LISS reviewers were requested to comment on this issue.
Resulting changes: None - insufficient material to use was received.
Acting project editor's recommendation: Omit from the first edition, unless complete usable clauses are received as a result of PDTR balloting. SC22's remit to WG11 was to produce a usable TR as quickly as practicable, even if it was not comprehensive in coverage.
4. Should examples be included?
Status: Unimplemented
Comments: Yes, but try to ensure that they do not imply too restricted applicability.
Actions: WG11 members and LISS reviewers requested to submit examples to project editor, bearing the comment in mind.
Resulting changes: None - insufficient material to use was received.
Acting project editor's recommendation: Include suitable examples if any are submitted as a result of PDTR balloting.
5. What should be said on interoperability?
Status: unresolved
Comments: Current draft unsatisfactory.
Actions: WG11 members and LISS reviewers were requested to submit material to project editor, in the form of proposed guidelines, or identification of existing material which could be used.
Resulting changes: None - insufficient guidance on required changes was received.
Acting project editor's recommendation: Await comments submitted as a result of PDTR balloting.
6. What should be said on concurrency?
Status: unresolved
Comments: Current draft unsatisfactory.
Actions: WG11 members and LISS reviewers were requested to submit material to project editor, in the form of proposed guidelines, or identification of existing material which could be used.
Resulting changes: none as yet.
Resulting changes: None - insufficient guidance on required changes was received.
Acting project editor's recommendation: Await comments submitted as a result of PDTR balloting.
7. Should there be guidelines on what to do if there are no LID/LIPC bindings for the language you want to use, and if so what should they be?
Status: Unimplemented
Comments: (none)
Actions: WG11 members and LISS reviewers were requested to submit material to project editor, in the form of proposed guidelines, or identification of existing material which could be used.
Resulting changes: None - no proposed guidelines were received.
Acting project editor's recommendation: Omit from the first edition, unless usable guidelines are received as a result of PDTR balloting. SC22's remit to WG11 was to produce a usable TR as quickly as practicable, even if it was not comprehensive in coverage.
Brian Meek, 7 April 1997
[Address: Computing Centre, King's College London, Strand, London WC2R 2LS, UK. Please for preference use electronic mail to brian.meek@kcl.ac.uk for comment, or failing that fax to +44-171-836-1799, marked clearly for my attention. Please do not use telephone: I am often hard to reach, and I am unable to return international telephone calls.]
1. Introduction
1.1 Background
(1) This Technical Report provides guidance to those writing specifications of services, and of interfaces to services, in a language-independent way, in particular as standards. It can be regarded as complementary to ISO/IEC TR 10182 Guidelines for language bindings, which provides guidance to those performing language bindings for such services and their interfaces.
NOTES
1. Here and throughout, "language" , on its own or in compounds like "language-independent", means "programming language", not "specification language" nor "natural (human) language", unless explicitly stated.
2. A "language-independent" service or interface specification may be expressed using either or both of a natural language like English or a formal specification language like VDM-SL or Z; in a sense, a specification might be regarded as "dependent" on (say) VDM-SL. The term "language-independent" does not imply otherwise, since it refers only to the situation where programming language(s) might otherwise be used in defining the service or interface.
(2) The development of this Technical Report was prompted by the existence of an earlier draft IEEE Technical Report (IEEE TCOS-SCC Technical Report on Programming Language Independent Specification Methods, draft 4, May 1991). The TCOS draft was concerned with specifications of services in a Posix systems environment, and as such contained much detailed Posix-specific guidance; nevertheless it was clear that many of the principles, if not the detail, were applicable much more generally. This Technical Report was conceived as a means of providing such more general guidance. Because of the very different formats, and the Posix-related detail in the TCOS draft, there is almost no direct correspondence between the two documents, except in the discussion of the benefits of a language-independent approach in clause 1.2. below. However, the spirit and principles of the TCOS draft were of great value in developing this Technical Report, and reappear herein, albeit in much altered and more general form.
NOTE
The TCOS draft has not in fact been published, as the result of an IEEE decision to concentrate activities in other Posix areas.
1.2 Principles
(1) Service or interface specifications that are independent of any particular language, particularly when embodied in recognised standards, are increasingly seen as an important factor in promoting interoperation and substitution of system components, and reducing dependence on and consequent limitations due to particular language platforms.
NOTE
It is of course possible for a specification to be "independent" of a particular language in a formal sense but still be dependent on it through inbuilt assumptions derived from that language which do not necessarily hold for other languages. The term "language-independent" here is meant in a much stronger sense than that, though complete independence from all inbuilt assumptions may be difficult if not impossible to achieve.
(2) Potential benefits from language-independent service or interface specifications include:
A language-independent interface specification specifies those requirements that are common to all language bindings to that interface, and hence provides a specification to which language bindings may conform.
A language-independent interface specification is a re-usable component for constructing language bindings.
A language-independent interface specification aids the construction of language bindings by providing a common reference to which all bindings can relate, and allowing use to be made of pre-existing language bindings to language-independent standards for common features such as datatypes and procedure calls, and to other language-independent specifications with related concepts.
A language-independent service or interface specification provides an abstract specification of a service in isolation from language-dependent extensions or restrictions, and hence facilitates more rigorous modelling of services and interfaces.
Language-independent service specifications facilitate the specification of relationships between one service and another, by making it easier to relate common concepts than is generally possible when the specifications are dependent on different languages.
A language-independent interface specification facilitates the definition of relationships between different language bindings to a common service (such as requirements for interoperability between applications based on different languages that are sharing a common service implementation), by providing a common reference specification to which all the languages can relate.
A language-independent interface specification facilitates the definition of relations between bindings to multiple services, including the requirements on management of multiple name spaces.
A language-independent service or interface specification brings economic benefits by reducing the effort and resources needed to ensure compatibility and consistency of behaviour between implementations of the same service in different languages or between applications based on different languages using the same interface.
2. Scope
(1) This Technical Report provides guidelines to those concerned with developing specifications of information technology services and their interfaces intended for use by clients of the services, in particular by external applications that do not necessarily all share the environment and assumptions of one particular programming language. The guidelines do not directly or fully cover all aspects of service or interface specifications, but they do cover those aspects required to achieve language independence, i.e. required to make a specification neutral with respect to the language environment from which the service is invoked. The guidelines are primarily concerned with the interface between the service and the external applications making use of the service, including the special case where the service itself is already specified in a language-dependent way but needs to be invoked from environments of other languages. Language bindings, already addressed by another Technical Report, ISO/IEC TR 10182 Guidelines for language bindings, are dealt with by providing advice on how to use the two Technical Reports together.
(2) This Technical Report provides technical guidelines, rather than organizational or administrative guidelines for the management of the development process, though in some cases the technical guidelines may have organizational or administrative implications.
3. References
ISO/IEC TR 10034:1990, Guidelines for the preparation of conformity rules in programming language standards
ISO/IEC TR 10176:1991, Guidelines for the preparation of programming language standards
ISO/IEC TR 10182:1993, Guidelines for language bindings
ISO/IEC 10967, Language independent arithmetic
ISO/IEC 11404:1996, Language independent datatypes
ISO/IEC 11578:1995, Remote procedure call
ISO/IEC 13719:1995, Portable common tools environment
ISO/IEC 13886:1996, Language independent procedure calling
4. Definitions
client see service user
datatype
A set of values, usually accompanied by a set of operations on those values.
formal language, formal specification language see specification language
interface
In this Technical Report, "interface" means the mechanism by which a service user invokes and makes use of a service.
language
Unless otherwise qualified, in this Technical Report "language" means "programming language", not "specification language" or "natural (human) language"
language binding
A specification of the standard interface to a service, or set of services, for applications written in a particular programming language.
language-dependent
Making use of the concepts, features or assumptions of a particular programming language.
language-independent
Not making use of the concepts, features or assumptions of any particular programming language or style of language.
language processor
The entire computing system which enables a programming language user to translate and execute programs written in the language, in general consisting both of hardware and of the relevant associated software.
NOTE
This definition comes from ISO/IEC TR 10176, Guidelines for the preparation of programming language standards
mapping
(noun) A defined association between elements (such as concepts, features or facilities) of one entity (such as a programming language, or a specification, or a standard) with corresponding elements of another entity. Mappings are usually defined as being from one entity into another. A language binding of a language L into a standard S usually incorporates both a mapping from L into S and a mapping from S into L.
(verb) The process of determining or utilising a mapping.
NOTE
Depending upon what is being mapped, a mapping is not necessarily one-to-one. This means that mapping an element E from system A into an element E' of system B, followed by mapping E' back into system A, may not necessarily get back to the original E. In such situations, if a two-way correspondence is to be preserved, execution of the mappings must include recording the place of origin and returning to it.
marshalling
The process of collecting the actual parameters used in a procedure call, converting them if necessary, and assembling them for transfer to the called procedure. This process is also carried out by the called procedure when preparing to return the results of the call to the caller.
NOTE
Marshalling can be regarded as being performed by a service user when preparing input values for a service provider, the service concerned being regarded as the procedure being called.
procedure
In this Technical Report, the term "procedure" is used in the generic sense to cover both those (sometimes called subroutines) which do not return a value associated with the procedure name, and those (sometimes called functions) which do, and hence can be called from within expressions).
NOTE
Primarily for historical reasons, some programming languages use different terminology.
server see service provider
service
In this Technical Report, "service" means a facility or set of facilities made available to service users through an interface.
service provider
In this Technical Report, "service provider" means a computer system or set of computer systems that implements a service and makes it available to service users.
NOTES
1. In this definition, "computer system" means a logical system, not a physical system; it may correspond to part of all of one or more physical computer systems.
2. The term "server" is often used in a similar sense, though sometimes implying a physical computer system which has no other function that to provide its service.
service user
In this Technical Report, "service user" means an application (typically a program in some language) which makes use of a service.
NOTE
The term "client" is often used in a similar sense, though sometimes implying the physical computer system on which the application is running, rather than just the application itself.
specification language
A formal language for defining the semantics of a service or an interface precisely and without ambiguity.
unmarshalling
The process of receiving and disassembling transferred parameters, and converting them if necessary, to prepare the values for further use. This process is carried out by the called procedure on receipt of the actual parameters for the call, and by the caller on receipt of the returned results of the call.
NOTE
Unmarshalling can be regarded as being performed by a service provider when receiving input values from a service user, and by a service user when receiving results from a service provider, the service concerned being regarded as the procedure being called.
5. Overview
5.1 Services, interfaces, service providers and service users
(1) The concept of a "service" is a very general one. In some contexts it is customary to use it in a restricted sense, e.g. when talking about "service industries" as contrasted with "manufacturing industries". Despite such usages, almost any activity or behaviour can be regarded as a "service", if it serves some useful purpose to do so (for example, manufacturing spoons can be regarded as a service for those needing spoons).
(2) With the concept of a service come the concepts of a "service provider" and a "service user". The provider performs the activity that constitutes the service; the user is the customer or the client for the service, for whom the service is performed. In the information technology field, the "client-server model" incorporates these concepts: the server provides, the client uses.
(2a) Between the service provider and the service user is an interface which allows them to communicate. The service user communicates through the interface the requirement for the service, and any relevant information (e.g. not only the need for spoons, but the number and size of spoons required), and the service provider communicates through the interface the response to the order for the service, and any addition information or queries (e.g. the spoons can be delivered in six days, do you want silver spoons or plastic spoons?). In the information technology field, such interfaces are usually explicit, realised in hardware or software or both. In the world in general, they are sometimes explicit, but sometimes subsumed in more general human or other interactions.
(3) This distinction between provider and user, client and server, must not be assumed to correspond to identifiable distinct entities. The distinction, and the service interface, may be purely notional, and possibly not normally thought of in that way. The service itself may similarly not correspond to a distinct, separate activity, and again and possibly not normally thought of as such; it may be subsumed in some other activity or group of activities, and may possibly be implicit.
(4) Hence, for example, in a transaction between two parties, each one may be providing a service for the other: each is a client, and each a server. In another context, the provider is providing the service to itself; the provider is also the user. Though it may be possible to subdivide the provider/user into a provider part and a user part when considering provision of the service, this may be inconvenient in other respects.
(5) In summary, "client" and "server", are roles that are carried out, rather than elements that necessarily must be implemented separately. Though the term "client-server" is sometimes used in the information technology field in ways that are more specific than it is used here, it is important not to carry over assumptions from particular client-server models when reading this Technical Report. Still more important is not to assume that implementation of any service, in the sense used here, has to be done using a client-server model.
5.2 Information technology services
(1) The history of information technology has many instances of the technology, or a product, being used for very different purposes and in very different ways from those originally envisaged. The kinds of service that information technology and products provide have continually expanded and diversified, and this is still continuing.
(2) It is as common in information technology as in the outside world for the term "service" in particular contexts to be used in a rather specific way. The history of the technology suggests that, for the purposes of formulating guidelines about services, the term should instead be used as generally as possible.
(3) This Technical Report has adopted this very general approach to the concept of "service". It is therefore important that, when using this Technical Report and the guidelines it contains, no presuppositions should be made about what a service is, or about how and by what it is provided or how and by what it is used. The guidelines should be interpreted and applied in that light.
(3a) This Technical Report does, however, carefully distinguish between the service itself, and the interface used to communicate with it. In some usages the term "service" includes the interface, and the interface may be embedded in the service and its specification (as in the phrase "all part of the service"). However, logically they are distinct, and this logical distinction is maintained throughout this Technical Report.
(4) Services in the most general sense often simply evolve naturally, but information technology services are usually consciously designed. They are also often built from explicit specifications, though some are developed ad hoc. Whichever the case, it is useful to make a clear logical distinction between service providers, service users, and the interface between them, even if, when implemented, one or both of these distinctions will be purely notional, and will not be embodied in identifiable and separable artefacts like particular hardware components or particular blocks of code. Indeed, thinking about service provision in such a way, in an environment which is normally regarded as a more integrated whole, can help to improve a specification, or at least to test it and verify its validity.
(5) This is especially so in the increasing number of cases where information technology environments and services, though originally conceived as self-contained, have to interact with external environments and services, many of which will need the distinction between providers and users to be made explicit. An instance of direct relevance to this Technical Report is where interacting entities are based upon different languages and hence different sets of underlying assumptions.
5.3 Services and language independence
(1) The term "language-independent service (or interface) specification" means, in this Technical Report, "language-independent specification of a service (or interface)", not "specification of a language-independent service (or interface)". Hence a language-independent specification of a service does not imply that the service itself is "language independent" in the sense intended here. The service specified may be relevant only to environments of particular languages.
NOTE
The implementation of a service which meets the specification will use some language or other, if only machine language, and so will in a sense be "dependent" on that language, but that is not the sense intended here.
(1a) Also, a language-independent specification of an interface does not imply that the service interfaced to is either itself "language independent", or specified in a language-independent way (though it may be).
(2) A trivial instance is that of a language processor for a particular language providing a service by executing a program in that language. For one of the long-established languages (like Cobol or Fortran) the interface is the provision of input data and the output of results. The language was designed for particular forms of input and output media, presumed under the control of a human user. However, a language-independent interface specification could define the input and output in such a way that the data can come from, and the results be returned to, some other system, in general using a different language.
(3) In a simple case like that, the user system and the interface are distinct and not closely coupled. The interface can be implemented as a "black box" which acts in the same way that a human interpreter would for two people with different languages conversing: it takes input from the client and translates it into the equivalent input for the service, and takes the output from the service and translates it into the equivalent
output for the client.
(3a) In the more general case the interface might need to be embedded in the client system so that it appears to be integrated in that host environment. That environment may need invoking the service to be expressed in more meaningful terms than just sending data and getting results.
NOTE
One example is in the functional standards for graphics. In some languages the most suitable invocation method is a procedure call to an external library, while in others the most suitable method is use of additional commands (keywords).
(4) Both the simple and the general case are referred to as "binding" to the interface, though the binding is much tighter in the general case. A "language binding" to the interface binds a particular programming language (not, of course, in general the same one as that used by the server), so that programs written in that language can have access to the service. A good language binding allows language users to use a style of accessing the service which is familiar to them, and will also, of course, accord with official standard for the language.
(5) ISO/IEC TR 10182 Guidelines for language bindings provides guidance to those performing language bindings and writing standards for them. This Technical Report provides complementary guidance to those specifying service interfaces in a language-independent way, and writing standards for them.
(6) A way of looking at language independence that can be useful is that of levels of abstraction. The various elements of programming languages can be regarded as existing at three possible levels of abstraction: abstract, computational, or representational, where the middle, computational level can be divided into two sublevels, linguistic and operational. The linguistic elements are regarded as instantiations at the computational level of the abstract concepts, while the operational level deals with manipulation of the elements, which inevitably looks "downwards" to the realisation of the elements in actual, processible entities at the representational level.
NOTE
The representational level does not necessarily mean the physical hardware level, or the logical level of bits and bytes; see the discussion under 5.6 below.
5.4 Language-independent specifications
(1) As the preceding discussion has shown, a language-independent specification may be a service specification, specifying the service itself, or be an interface specification, specifying the how the service is accessed by clients. It may of course cover both.
(2) This Technical Report is concerned primarily with specification of the interface to the service, rather than of the service itself. The service may be predefined in a language-dependent way. How a service is specified is likely to depend to some extent on the nature of the service and its application area, so guidelines on specification of the service are definitely outside the scope of this Technical Report. However, where it is wished to produce a language-independent specification of a service, so that it can be implemented in a variety of different languages, then the guidelines presented may be useful, directly or indirectly. For example, they may draw attention to factors that should borne in mind, and it may then be possible to adapt them to the particular circumstances.
(3) This Technical Report therefore provides guidelines applicable in the following cases:
- specification of a service interface;
- specification both of a service interface and of the corresponding service itself, together;
- specifying from scratch (i.e. without anything pre-existing to base it on);
- specifying on the basis of an existing (probably language-dependent) service;
- specifying on the basis of an existing (language-dependent) binding.
(4) Guidelines are grouped under various headings, dealing with different aspects. As far as possible each group is independent, in the sense that they can be referred to without necessarily working through preceding groups. Any necessary cross-references are provided.
5.5 Problems of language dependence and inbuilt assumptions
(1) Producing a language-independent specification can present many problems, especially if starting from an existing service which was not originally designed to be language independent - typically, a service designed in and for a particular language environment. If a service is specified in the "wrong" way - it may of course not have been "wrong" in its original context - it can make producing a language-independent interface very difficult. In particular, it may making explicit or (more likely) implicit assumptions about the language that applications using the service will be written in. Languages that are similar in character to the original one may not have many problems, but a language-independent interface specification needs to cater for different styles. This is one of the greatest challenges in developing language-independent specifications, whether for services or for interfaces.
NOTE
Examples of styles of language are: procedural, declarative, functional, interpretive, object-oriented, ...., and these are not necessarily mutually exclusive.
(2) Such problems can still occur even if the service concerned is not an existing service. Since most service developers tend to come from a particular language environment, it is all too easy, even when consciously attempting to produce a language-independent specification, to carry over implicit assumptions from that environment, simply because they are implicit and hence rarely questioned or even realised.
5.5.1 Representational assumptions
(1) An important class of language-dependent assumptions is that of representational assumptions. Some languages have explicit or implicit models of how language elements are represented at the hardware level, either physically or logically. Simple instances are storage of numerical values or of aggregate datatypes such as indexed arrays or character strings, or numbers of datatype Complex (assumed to be represented by two numbers of datatype Real, for the cartesian real and imaginary parts).
(2) Such models tend to become implicit for those used to that language environment, even when the language definition makes the model explicit. Users of the language get so used to that model that they take it for granted. It is all too easy for such assumptions to get carried over into what is intended to be a language-independent specification.
(3) Representational assumptions are not confined to the hardware level, they can occur at more abstract levels too: for example, a supposedly "language-independent" specification may use an integer datatype for a value which logically is not, or need not be, an integer. The fact that virtually all languages have an integer datatype or its equivalent is not relevant: the original language may have used the integer datatype, because it was the best or only choice, but other languages may have alternatives which the original language did not. A language-independent specification should avoid requirements which constrain how things should be represented, and concentrate upon what should be represented.
NOTE
It is of course possible for a language-independent specification to be developed which is explicitly concerned with the representation of language elements. For such a specification the principles outlined above may not all apply - though some may still be relevant.
5.5.2 Implementation assumptions
(1) Representational assumptions are a specific form of implementation assumption, though not all implementation assumptions are language-dependent. Service designers make implementation assumptions when they take it for granted that a particular implementation approach will be adopted. Here a simple example is assuming that the service will be invoked by a procedure call or, even more specifically, will use procedure calls using a parameter passing mechanism of a particular kind.
(2) Implementors of language-independent service specifications should not be required to adopt a particular implementation approach. Instead, the specification should require only what is needed for the service, or is needed to ensure that different implementations will be mutually consistent or (if interoperability is required) interact with one another correctly.
6. Guidelines on strategy
(1) The discussion in clause 5 above shows that a large number of factors need to be taken into account when producing a language-independent service specification. This clause provides guidance on how to go about the task.
(2) The guidelines that follow are divided into general guidelines (clause 6.1) and more specific ones (the later clauses). Some of the more specific guidelines are in fact similar to one another, appearing in various modified and specific forms under various headings, and could have been made "general" guidelines. The apparent duplication increases the length of the document, but is intended to reduce the amount of interpretation and adaptation that will be needed in particular circumstances, and to emphasise the relevance in particular contexts. It also allows different Notes, specific to the context, to be appended.
6.1 General guidelines
6.1.1 Guideline: Dependence of the interface on the service
A service specification should be designed with the requirements for the language-independent interface in mind.
NOTE
If a service is specified in the wrong way, it can make producing a language-independent interface very difficult, in particular by making explicit or implicit assumptions about the languages that applications using the service will be written in.
An example is assuming a particular method for invoking the service, e.g. the use of object classes, or the use of low-level procedure calls (i.e. using only simple datatypes for parameters).
6.1.2 Guideline: What to do when there are interoperability, concurrency, or time constraint issues
Language-independent service and interface specifications may be affected by issues relating to interoperability with other services, or concurrency, or time constraints of other kinds. If this is the case, the nature of such issues makes it vital that they be addressed first, with the remainder of the service being designed later, around the aspects handling those issues.
NOTES
1. Interoperability, concurrency, and time constraint issues can often cause difficulties, compared with which other issues are comparatively straightforward to deal with. They can also place requirements or constraints on other aspects of the service. It will therefore aid the design process to address those issues first. For example, if a service is to have multiple clients, this needs to be taken into account very early on.
2. Guidelines on interoperability appear in clause 10, and guidelines on concurrency appear in clause 11.
[BLM: The following two guidelines are respectively the former 6.3.4.2 (now 6.1.3) and the former 6.3.2.6 (now 6.1.4). The are no wording changes to 6.1.3 - BLM]
6.1.3 Guideline: Use of marshalling/unmarshalling
When specifying the way that values are communicated across the interface between the application using the language binding and the service, the marshalling/unmarshalling approach used in ISO/IEC 13886:1995 Language independent procedure calling in relation to passing of parameters may prove useful.
NOTE
The marshalling/unmarshalling concept for communicating values is sufficiently general to be of use even when the service and its interface do not involve explicit procedure calling.
6.1.3 Guideline: Recruiting expertise from a variety of backgrounds
When developing a language-independent specification, every attempt should be made to recruit the involvement of, or to obtain input from, language experts from a variety of backgrounds, and also experts in language independence issues. In any event, before the language-independent specification is finalized, arrangements should be made to get a complete draft reviewed by experts of that kind from outside the group designing the specification.
[BLM: This is my attempt to redraft the former 6.3.2.6 as a guideline under 6.1. The following Note from 6.3.2.6 is unchanged from before - BLM]
NOTE
Because of the particular nature of the problems involved it achieving language independence, it is preferable to choose language experts who have some experience of binding to language-independent specifications, and/or who are familiar with other languages than their own main language.
6.2 What to do if starting from scratch
It is rare for the designer of a language-independent service or interface specification to be able to "start from scratch", i.e. to be able to design without having to take into account an existing (and usually language-dependent) service or interface which is already in use (and with which compatibility is required, or expected even if not required.) However, for completeness this Technical Report does need to cover the possibility. Furthermore, guidelines on what ideally might be done can serve as a benchmark against which to measure what has actually been possible, given the constraints that a pre-existing service or interface may have placed upon the design. In principle, they might even establish that it would be preferable to treat the pre-existing version simply as a prototype to be discarded.
6.2.1 General guidelines
6.2.1.1 Guideline: Avoidance of implementation assumptions
When designing a language-independent service specification, representational or other implementation assumptions should be avoided.
NOTES
1. Languages differ greatly in character so a form of implementation suitable for one may be quite unsuitable for another. Furthermore some languages themselves make explicit or implicit representational or other implementation assumptions, not always consistent with those in other languages. Language-independence is therefore best assisted by avoiding all such assumptions, however attractive they may be in other respects.
2. This guideline reappears in various more specific forms throughout this Technical Report and the general question has already been introduced in clause 5.5. This has been done deliberately, both to stress its importance and to aid in interpreting the guideline in various contexts.
6.2.2 Specifying the service in language-independent form
6.2.2.1 Guideline: Allowing for different approaches
When specifying the service in language-independent form, it should not be assumed that implementations in every language will use the same approach, and implementations should not be required to adopt a particular approach. Instead, the specification should require only what is needed for the service, or is needed to ensure that different implementations will be mutually consistent or (if interoperability is required) interact with one another correctly.
NOTES
1. It is not necessary to use an implementation model to specify requirements, whether these are needed to provide the service itself, to ensure mutual consistency, or to ensure interoperability. Such requirements can and should be expressed in an abstract, language-independent way.
2. Guidelines on interoperability appear in clause 10.
6.2.2.2 Guideline: Documenting external constraints and minimising their impact
If there are external constraints which the service is required to satisfy, these should be carefully examined to assess their impact, whether on implementation strategies for the service, or on the interface. The relevant aspects of the service should then be specified in a way which minimises the impact of the constraints. The external constraints (including the rationale for their presence), and the steps taken in the specification to cope with them, should be documented.
NOTES
1. Particular attention will be needed in the case of constraints which seem to require things to be done in accordance with some implementation model. In many cases it should be possible to avoid passing on these implementational requirements by absorbing them into the service, for example by internal conversions.
2. In general, it is preferable to leave as much as possible to implementations to handle as best they can, provided this can be done without compromising either the integrity of the service or of language independence.
3. Sometimes, the cost of an extra conversion interface will be justified by gains elsewhere, for example in resource terms or in safety or reliability terms.
6.2.2.3 Guideline: Allowing for different binding methods
When specifying the service in language-independent form, it should not be assumed that the interface will use or specify a particular binding method; rather, the specification should be neutral with respect to binding methods.
6.2.3 Specifying the interface to the service in language-independent form
When specifying the interface to the service in language-independent form, it should not be assumed that a particular binding method will be used by every language, and use of a particular binding method should not be required. The specification should require of bindings only what is to be passed across the interface, not how it should be passed.
NOTES
1. Language bindings should be able to make maximum use of the facilities of the language. Assuming or requiring a particular binding method can lead to suboptimal bindings to the service and in extreme cases could make it impossible to specify an adequate binding.
2. Language bindings are also designed for many different purposes, and it can create many problems if a binding to one service is required to be markedly different from other bindings.
6.3 What to do if starting from an existing language-dependent specification
The task of producing a language-independent service or interface specification from an existing language-dependent specification is one of "reverse engineering". In general it can be expected that the original language-dependent specification will have treated the service, the interface, and the language binding as one, and will not, deliberately, have kept the different aspects separate. For a language-independent specification, whether for a service or for an interface, it is necessary to ensure that these different aspects are kept separate. Clause 6.3.1 provides guidelines on identifying significant language-dependent aspects. Clause 6.3.2 addresses conversion of language-dependent features to language-independent form. Clause 6.3.3 addresses the consequences for language bindings. Clause 6.3.1 addresses the situation where the interface specification but not the service specification is to be made language independent.
6.3.1 General guidelines
6.3.1.1 Guideline: Identifying implementation assumptions
Any representational or other implementation assumptions in the original language-dependent specification should be carefully reviewed, and any which are derived from the particular language used, rather than dictated by the semantics of the service, should be identified.
6.3.1.2 Guideline: Identifying language-dependent terminology
The terminology used in the original language-dependent specification should be carefully reviewed from the language-independent point of view, to see if it is derived from the terminology of the particular language rather than from the service.
6.3.1.3 Guideline: Identifying aspects specified at the wrong level of abstraction
The language-dependent specification should be carefully reviewed for features which are specified at a level of abstraction inappropriate for the language-independent version. The review should in particular search for those at too low a level which do not involve overt representational or implementation assumptions as under clause 6.3.1.1, but arise from the way the service has been conceived in the original language environment. Attention should, however, also be paid to any at too high a level, which may take the form of features being left under-specified because the missing aspects are taken for granted in that language environment, or because the language definition leaves such aspects implementation dependent.
NOTES
1. The concept of levels of abstraction is discussed in clause 5.3.
2. An example of too low a level is specifying the service in terms of independent entities when in fact they naturally form fields of a Record datatype.
3. An example of too high a level is specifying a datatype without defining permitted or required ranges of values of the datatype.
4. When rectifying inappropriate levels of abstraction, care needs to be taken not to over-compensate.
6.3.1.4 Guideline: Identifying aspects derived from the language rather than inherent to the service
The language-dependent specification should be carefully reviewed for features which are not inherent to the service, but whose inclusion seems to have been prompted by the nature of the implementation language and its facilities. Particular attention should be paid to any such inessential features which could be difficult to provide in some other languages. Attempts should be made to discover how heavily these features are used by users of the original specification.
NOTE
1. Some such features may in fact be included because they are useful elsewhere in the language, for purposes unrelated to the service itself.
2. It may be appropriate to include features of this kind in the specific language binding for the language concerned; though strictly inessential to the service, there may nevertheless be a continuing demand for them from that language community, which cannot readily be satisfied in another way (e.g. by the provision of separate services). If that is the case, the conformity rules should permit bindings to include these supplementary features, though they should not require them for all languages.
3. However, it is possible that such features are rarely used by users of the original specification, in which case the opportunity could be taken to remove them, or to designate them as "obsolete", to be removed at the next revision.
6.3.1.5 Guideline: Identifying desirable but absent features
The language-dependent specification should be carefully reviewed to see if there are any features which would be desirable, but which are in fact absent from the original (e.g. because they could not conveniently or efficiently be provided in the original language, or where they are implicit in that language and did not need to be spelled out). Any such features should be studied, to see if they should now be added, either as options or as mandatory requirements.
NOTES
1. Such "absentee features" can occur because the original language may have been chosen for reasons other than being ideal for the purpose of providing the service.
2. The original language may be subject to revisions which will remove the previous difficulties in providing a feature.
3. It will be necessary to pay special attention to the binding to the original language.
6.3.2 Converting an existing language-dependent specification of the service into language-independent form
6.3.2.1 Guideline: Avoiding undue dependence on the original language-dependent version
While it is desirable and even necessary to use the original language-dependent specification as a guide when developing a language-independent specification from it, the detailed form and content should not necessarily be dictated by the detailed form and content of the original. In particular, changes that correct weaknesses in the original, and especially changes that enhance language independence, should be seriously considered, and if possible included in the specification, with due regard for the impact on existing implementations using the original specification. However, change should be avoided if what is in the original is adequate for the purpose, and does not adversely impact language independence, even if a change would appear to be an improvement.
NOTES
1. The guidelines in Clause 6.3.1 show how to identify aspects of the original specification that should be considered for changes.
2. When assessing the impact of changes on existing implementations using the original specification, the guidelines on revisions in Clause 20 may be helpful - see Guideline 6.3.2.5.
3. A change that does not correct a weakness but "would appear to be an improvement" can of course be contemplated if the development of the language-independent specification is being accompanied by a parallel revision of the original specification.
6.3.2.2 Guideline: Recasting scope of specification
In the light of the results of following previous relevant guidelines, the scope of the specification should, if necessary, be recast at as high a level of abstraction as is possible while remaining consistent with the nature of the service.
NOTES
1. It may not necessary to recast the scope of the specification: it may be sufficient to keep it at the same level of abstraction but to remove anything not at that level.
2. Examples of too low a level of abstraction would be specifying a representational model of integers when a non-representational one is sufficient, or specifying use of an integer datatype for a value which logically is not, or need not be, an integer.
3. An example of a level of abstraction higher than is consistent with the nature of the service would be specifying an integer datatype without stating a minimum range of values, when such a minimum range is needed by services for interoperability purposes.
6.3.2.3 Guideline: Revising language-dependent terminology
Language-dependent terms used in the original specification should be changed if necessary, e.g. if they are likely to be misinterpreted in a different language environment. If not changed, they should be clearly explained, for the benefit of those not familiar with the original language or specification.
NOTES
1. For the benefit of those familiar with the original language-dependent specification, any such changes of terminology should be listed, and the reasons for the change explained.
2. If a term is particular to the original language and not encountered elsewhere, confusion can still occur if language environments use a different term for the same or a similar concept.
6.3.2.4 Guideline: Conversion of datatypes and procedure calling
A suggested strategy for converting a language-dependent specification into language-independent form is to start by converting the datatypes of values used, together with all the required operations on the data, including input-output. If any procedure calling appears in the original specification, conversion of that should then follow. Conversions should be based on what the service needs, rather than what was chosen in the original specification, since those choices are inevitably language-dependent.
NOTES
1. Since all services will handle data values of some kind, and many use procedure calling as a mechanism, converting these first may help the rest to fall into place more easily.
2. It is not sufficient merely to use a binding of the original language to ISO/IEC 11404 Language independent datatypes and leave it at that; a particular choice of datatype may have been dictated by what the language had available, and may not be the best language-independent choice. (See clause 12.)
3. For similar reasons it is also insufficient to use a binding of the original language to ISO/IEC 13886:1995 Language independent procedure calling; particular choices of procedure parameters and passing mechanisms will have been limited to those the language had available.
6.3.2.5 Guideline: Documenting language-dependent aspects
The relationship between the original and the language-independent specifications should be fully explained (e.g. in an annex) and all language-dependent assumptions or features that have been recast or removed should be documented. A migration path to allow existing language-dependent implementations to be revised in line with the language-independent version should be provided.
NOTE
With suitable adaptation, the revision guidelines in clause 20 can be used to help in specifying a migration path for existing implementations.
[BLM: 6.3.2.6 now redrafted as 6.1.4 - BLM]
6.3.3 Converting an existing implicit interface into an explicit language-independent interface
It is possible in some cases that the interface to an existing service (language-independent or not) has not previously been defined explicitly, but exists only in the form of a "binding" to one language, this binding itself probably being implicit rather than explicit. This clause provides guidance on coping with that situation. Mostly, the guidelines below are simply reinterpretations of previous guidelines, adapted to suit those particular circumstances.
6.3.3.1 Guideline: Aspects derived from the language
Any aspects of the language binding which are derived from the particular language, rather than dictated by the need to interface to the service, should be identified, and replaced by language-independent equivalents where appropriate.
NOTES
1. It is likely that the revised binding, for the original language to the language-independent interface, will be able to continue to include these aspects, if only as optional language-specific additions.
2. Language-dependent aspects can include things like the structure of the binding document, as well as simply the features of the language concerned. Language independence may involve complete restructuring, including the revised binding for the original language. In that case extra guidance may be needed, e.g. in the form of an informative annex.
6.3.3.2 Guideline: Absent features
The language binding should be carefully checked, or rechecked, to see if there are any aspects of the service, relevant to the interface, which are in fact absent from it (e.g. because they could not conveniently or efficiently be accessed from the language concerned, or because they were irrelevant for the language).
NOTE
A feature may be absent from the binding simply because the language already contains that particular feature as part of its own service. The revised binding, for the original language to the language-independent interface, will of course still be able to continue to omit that feature, for the same reason.
6.3.3.3 Guideline: Identifying aspects not required by the service
Any aspects of the language binding which are inessential to providing an interface to the service should be identified, reviewed, and considered for removal from the language-independent interface specification.
NOTE
Though there will in some cases be some overlap between this guideline and guideline 6.3.3.1, the presumption will normally be that inessential features will be removed. The aspects referred to here are not so much "derived from the particular language" but are service-related facilities seen to be of use to the language community concerned, or arise from inbuilt assumptions about how or why the service is used within that community. However, the possibility must also be held in mind that these "inessential" features, in some form, will nevertheless prove of value to users from other language communities, and they should therefore not be discarded without due consideration.
6.3.3.4 Guideline: Avoiding assuming the binding method
The language-independent interface specification should not be based on the assumption that the (explicit or implicit) binding method used for the original language will be used for all other languages.
NOTES
1. The binding method used for the original language will inevitably be chosen to suit that particular language, and may not be the most appropriate for all. In general the language-independent interface specification should permit the use of any binding method.
2. ISO/IEC TR 10182 Guidelines for language bindings provides guidance on binding methods.
6.3.4 Specifying a language-independent interface to a service whose specification is language-dependent
It is quite possible that the existing service for which a language-independent interface is needed is itself specified in one particular language and is therefore, at least potentially and possibly necessarily, language dependent. This clause provides guidance on coping with that situation. The guidelines below are primarily logical extensions or adaptations to others elsewhere in this Technical Report.
NOTE
A service may be necessarily language dependent when it depends on specialist facilities which are available only in one specialist language (for example the database facilities in SQL) and which in practical terms cannot sensibly be simulated in another available language. It may be language dependent in a less restrictive sense when only a small minority of languages have suitable facilities (for example knowledge-based systems that can be implemented readily in languages such as Prolog or Lisp but only with great difficulty in others).
6.3.4.1 Guideline: Protecting bindings from language dependence
The language-independent interface should be specified in a way that protects language bindings as much as possible from the language dependence of the service, by absorbing the limitations and assumptions arising from the language of the service, and providing the necessary conversions within the interface, rather than propagating them to the bindings.
[BLM: 6.3.4.2 now relocated as 6.1.3 - BLM]
7. Guidelines on document organisation
A language-independent service specification can be a very complex document, depending on the complexity of the service and the scope of the specification. This clause provides guidance on how to organise the material needing to be covered.
NOTE
Guidelines on document organisation for language bindings are in clauses 17.3 and 17.4.
7.1 Guideline: The general framework
The language-independent service specification should be designed to include the parts in the checklist that follows in Clause 7.1.1 (though it should not necessarily confined to only to the parts listed). Where a particular part seems not to be necessary in a given case, allowance should still be made for its possible future inclusion, e.g. as a result of a later change in the scope of the specification, or of a development of the service concerned.
NOTE
Here the term "part" is used in the everyday general sense: it does not imply the need for a separate "Part" of a standard in the formal sense. See clause 7.3 below.
7.1.1 Checklist of parts for inclusion
1) If the scope of the specification includes the semantics of the service, a definition of those semantics, including rules for conformity of implementations.
2) If the scope of the specification does not include the semantics of the service, an explanation of how the semantics relates to the content of the document.
NOTE
It will of course be necessary to include a reference to the definition of the semantics, and may be necessary to include a brief summary of the semantics, e.g. in an informative annex.
3) If the scope of the specification includes the interface to the service, a definition of that interface, including rules for conformity of implementations.
4) If the scope of the specification does not include the interface to the service, an explanation of how the interface relates to the content of the document.
5) In the case of implementations of the interface, a specification of requirements on name correspondence between names used in the interface specification and names used in a calling program.
NOTES
1. This part will entail requirements on language bindings to the interface.
2. Even when the application of ISO/IEC 11404 Language independent datatypes and ISO/IEC 13886 Language independent procedure calling is sufficient to cover all functionality, name correspondence requirements are still likely to be needed.
3. A normative annex may be appropriate for specifying name correspondence requirements.
6) The specification of all further requirements on standard-conforming implementations (such as fault detection, reporting and handling; provision of implementation options to the user; documentation; validation; etc.), and of rules for conformity.
NOTE
It will probably be necessary to specify such further requirements separately for implementations of the service and for implementations of the interface.
7) A description, as well as a reference, and if necessary a complete specification, of any formal specification language used in (1) or (3), and for each case an annex containing a summary of the formal definitions.
8) One or more annexes containing an informal description of the service and of the interface, a glossary, guidelines for service users (on implementation-dependent features, documentation available, etc.), and a cross-referenced index to the document.
NOTES
1. In general, each informal description should appear even if its full definition is within the scope of the specification and is included in the document, though this may not be necessary for some simple services.
2. Where the full definition of either the service or the interface is not within the scope of the specification, and hence does not appear in the document, an informative clause may be more appropriate than an annex, if only to emphasise its importance. This is particularly the case for the specification of the interface when the specification of the service appears elsewhere, and in the case of language bindings.
9) An annex containing one or more checklists of any implementation-defined features.
10) An annex containing guidelines for implementors, including short examples where appropriate.
11) An annex providing guidance to users of the language-independent service specification on questions relating to the validation of conformity, and any specific requirements relating to validation contained in (1), (3), (5) and (6) above.
12) In the case where the language-independent service specification is a revision of an earlier version, an annex containing a detailed and precise description of the areas of incompatibility between the old version and the new version.
13) An annex which forms a tutorial commentary containing examples that illustrate the use of the service.
7.2 Guideline: Separation of concerns
If the scope of the specification includes the semantics both of the service and of the interface, the two should not be intermingled in the document, but kept clearly separate. The same applies to any issues relating to language bindings.
NOTE
Confusion is almost certain to occur between what is the concern of the service and what is the concern of the interface, unless this separation is maintained.
7.3 Guideline: Production and publication
Though guideline 7.1 does not imply that the "parts" of the specification should be in a number of physically separate documents, for a very complex service this should be considered, especially if different aspects (the service, the external service, language bindings, etc) are likely to be implemented separately.
NOTES
1. This would mean that a language-independent service specification published as an International Standard would be published as a set of separate Parts.
2. Publication in a set of separate documents implies a need for careful cross-referencing, and inclusion in each one of informative summaries or extracts from others that are relevant, or needed for understanding. This implies some duplication, the need to keep changes and revisions consistent across the set, and consequently an increase in overall length and of effort involved. Such costs need to be carefully weighed against the advantages of dividing the whole into more manageable pieces.
7.4 Guideline: Document organisation when starting from a language-specific specification
Where a language-independent service specification is being developed which is based on an existing language-specific specification, and changes to the original document organization may seem desirable in the language-independent case, the benefits of such changes should be weighed against the value of maintaining a close correspondence between the two, to aid comparison and review.
NOTES
1. Factors to be considered include the extent of use of the original language-specific specification and hence the volume of review expected from those familiar with the original version, and how soon it will be before the original specification is replaced by a binding of the language-independent specification to the language concerned.
2. It may help to apply similar criteria to those in clause 20 on revisions, when deciding whether and by how much to change the document organization from the original.
3. See also clauses 6.3.3.2 (in particular Note 2), 17.3 and 17.4.
8. Guidelines on terminology
The careful and precise use of terminology is important for any kind of specification, particularly a standard specification, but it is especially important for language-independent service specifications.
8.1 Guideline: The need for rigour
The terminology used in a language-independent service specification should be defined rigorously, even where it is believed that a term is generally well understood. Different usages of the same terminology (and unspoken assumptions that may not hold) commonly encountered in language communities should be pointed out.
NOTES
1. Languages vary greatly in terminology, using same or similar words for very different things, or for slightly different things, and different words for same or slightly different things, which make it critically important to be very precise in their use.
2. Slight variations of meaning can cause more trouble than large ones, simply because they are easy to overlook, so rigour, in the sense of completeness as well as accuracy, is especially important where these might occur.
3. The use of a formal specification language can help to eradicate insufficiently rigorous definition of terminology, even if not used normatively, since the formal definitions can be used to check the interpretation of natural-language terms.
8.2 Guideline: The need for consistency
All normative terms and phrases, once defined rigorously in accordance with 8.1 above, should used consistently throughout the language-independent service specification, with the precise meaning as defined.
NOTES
Note 3 under 8.1 applies here also.
8.3 Guideline: Use of undefined terms
All uses of undefined terms in the language-independent service specification should be carefully checked to ensure that they cannot lead to normative ambiguity.
NOTES
1. In any specification, undefined terms, whose meaning is assumed to be understood, will at some point have to be used, but providing definitions, either directly or by reference, should stop only when the resulting lack of rigour is not relevant to the specification.
2. Again, the use of a formal specification language (Note 3 under 8.1) may be helpful.
8.4 Guideline: Use of ISO 2382
As far as possible, the language-independent service specification should use the terminology given in the appropriate parts of ISO 2382, taking into account common practice in the community providing and using service, and in the various language communities concerned, and also the possible costs of transfer to new terminology. ISO 2382 terminology should nevertheless be used in preference to terminology specific to one particular implementation or binding language. Additional terms not covered by ISO 2382 should be defined in a specific section of the standard.
8.5 Guideline: Use of definition by reference
Though definition of terms can be by normative reference rather than detailed exposition, the language-independent service specification should in general include the text of the referenced definitions, at least for information, and it should be made clear that, since usages vary, users of the language-independent service specification should not assume (without having explicitly checked) that their habitual use of a term is identical to that given.
NOTE
This applies to all reference terms including those in ISO 2382.
8.6 Guideline: Terminology used in bindings
Language bindings should be explicitly required to address and explain fully any differences of terminology between the language and the language-independent service specification.
9. Guidelines on use of formal specification languages
9.1 Guideline: Use of a formal specification language
Serious consideration should be given to the use of a formal specification language to define the service semantics.
NOTES
1. The use of a formal specification language will reduce the risk of divergence and incompatibility between bindings and implementations in different languages, arising from differing connotations and underlying assumptions in the use of natural-language terms.
2. A formal specification language will often make it possible to carry out automatic checks for errors, omissions and inconsistencies in definitions, which with natural-language methods may be difficult to spot (e.g. an inconsistency between two requirements that are widely-separated in the document text). It of course remains a human responsibility to ensure that the resulting complete, consistent and precise definition is of the semantics intended.
9.2 Checklist of formal specification languages
(1) Services vary so greatly that it would served no useful purpose for this Technical Report to recommend the use of one formal specification language or even one style of formal specification language. However, to assist those using this Technical Report, there follows a list of formal specification languages which have been made the subject of international standards, together with a brief indication of their style and of their range of applicability.
9.2.1 Estelle
Estelle (ISO 9074, 1989) is a standardized formal specification language. The Estelle language is based on a stripped-down version of Pascal that has been extended with a notion of modules and communication between those modules. Estelle semantics are based on extended finite state automata. A system is modelled by a set of module instances that communicate messages asynchronously over given channels.
Modules are defined by a body and a header. The body defines, in a Pascal-like way, the behaviour of the module, and the header defines the external interface. Channels are defined by two roles (one for each end of the channel), where each role definition defines the messages that may be sent.
Although Estelle was originally designed to specify communication services and protocols, it may be used to specify other systems. The module definition appears to map well onto the notion of specifying internal services and external interface separately. However, the Pascal-like nature of the module body language is liable to exert strong bias on any implementations developed from the specification, because of the detailed nature of those specifications.
9.2.2 Lotos
Lotos (ISO 8807:1989) is a standardized formal specification language. The Lotos language is based on a combination of the ACT-ONE specification language with a process algebra based on the concepts of CCS and CSP. Lotos semantics are based either on abstract datatype specifications or on process algebras, depending on which part of the language was employed. A system is modelled as a collection of processes that communicate potentially complex data objects synchronously over given ports.
Data objects may be defined in the ACT-ONE part of Lotos. Their definition consists of an interface defining the syntax of the operations used to manipulate the data object, and a set of rules that define how the operations interact with each other. Processes are defined by a header that names the ports through which the process may communicate with other processes, and a behaviour expression that defines the allowable behaviours (as seen through interactions on the ports) of the process.
Lotos was originally designed to specify communication services and protocols, but has been used to specify other types of system. That Lotos comprises both an abstract datatype component and a process algebra component means that it may be used in any circumstance where either would be appropriate.
9.2.3 VDM-SL
The Vienna Development Method Specification Language (VDM-SL) is undergoing international standardisation and has been approved as a draft international standard. VDM-SL is based on a rich set of basic and compound types with syntax that allows the definition of functions, global state, and operations that may modify the state. VDM-SL semantics are based on denotational style lambda calculus. A system is modelled as a collection of global state variables and the operations used to modify the state and other functions.
Global state variables model the state of the system and are defined by constructions of the basic or compound types of VDM-SL. Invariants may be added to the types of the state variables providing appropriate constraints. Operations are defined by a header that defines which state variables will be accessed, and a pre-condition and a post-condition that define the behaviour of the operation. Functions are defined using a lambda calculus notation.
In addition to specification by pre- and post- conditions, VDM-SL has programming-language-like constructs to describe iteration and assignment, and has a well-defined refinement process that may be used to refine datatypes or function or operation definitions.
VDM-SL was first developed for the specification of compiler semantics, but has been used for many sequential (and some concurrent system) system specifications.
9.2.4 Z
Z is a specification language currently undergoing international standardisation. Z is based on a typed set theory where the types of the values are well-defined and may be relations. Z semantics are provided in a denotational style using a specially developed relational algebra. A system is modelled in Z as a collection of schemas that define desirable properties that the system must exhibit.
Schema definitions have two parts, either of which may be optional. The first part is declarative and introduces the variables for which a relationship is to be defined. The second part is the predicate part, and defines the relationship that must hold between the variables defined in the scope of the schema. Schemas may be used to define complex data objects, or types with or without invariants, or to define operations or functions. Z provides powerful mechanisms for composing schemas to construct larger specifications from smaller components.
Z has been used in a variety of software and system specifications such as transaction processing systems or heart pacemakers. Z has also been used to specify the semantics of some of the Posix standards.
9.3 Guideline: Using formal specifications from the outset
Once the decision has been made to use a formal specification language, and the particular language has been selected, the chosen specification language should be used from the outset, all participants in the project being required to submit proposals and drafts using formal rather than informal semantics.
NOTE
Formal methods, especially for defining semantics, are at present not widely known or used among IT practitioners, despite their known advantages. Experience has shown that using the agreed formal specification language from the start is much easier than trying to introduce one later on when participants have become used to discussing issues relating to the project in informal terms. Early progress may be slower than it might have been, through initial unfamiliarity with the formal language, but any lost time is usually recovered in due course since ambiguities and errors are less likely to occur and are easier to detect.
[BLM: The former 9.3 now follows as 9.4 - BLM]
9.4 Guideline: Use of operational semantics
Care should be taken if using operational semantics for formal definition of a language-independent service specification, to avoid appearing to provide an implementation specification.
NOTE
1. In operational semantics, the definition of the semantics is made in terms of the operation of an "abstract machine" which implements that semantics. There is a consequent danger of providing a detailed implementation model, especially with a formal specification language capable of operational semantics with translation into an executable (even if inefficient) actual implementation. Other formulations, such as axiomatic or denotational semantics, do not rely on such an implementation model.
2. If the specification is derived from an original implementation based on a particular programming language, there is the added danger of the "abstract machine" reflecting the character and inbuilt assumptions of that language.
3. Depending on the nature of the service being defined, it may be possible to provide an operational semantics at a sufficiently high level of abstraction to avoid these dangers.
4. There may be cases where external constraints or other considerations means that the use of operational semantics, at a level implying an implementation model, is nevertheless indicated. In such cases the assumptions of the model should be spelled out, and guidance given on alternative forms of implementation where those assumptions are invalid or inappropriate. It is especially important that such a specification be reviewed by experts familiar with a variety of language environments and implementation strategies, to minimise the risk of inbuilt bias.
10. Guidelines on interoperability
10.1 Introduction
The term interoperability is used in many contexts, sometimes in a very vague and general way, and is sometimes confused with the related but distinct concept of portability. This introduction is intended to clarify the concept of interoperability in the context of service specifications, as a preliminary to the associated guidelines for language-independent service specifications.
10.1.1 Interoperability with what?
(1) Interoperability issues arise when a service is required to interoperate with other services in the course of providing its own services to an external user. The other services concerned may be other instantiations of the same service, or may be different services, or of course both.
(2) If interoperability is with other instantiations of the same service, that becomes one of the design requirements of the language-independent service specification and while, this may add to the difficulty of defining the specification, it is a relatively straightforward situation to deal with.
(3) If interoperability is with different services, then the extent of the difficulty of defining the specification will depend upon whether these are being specified at the same time, or pre-existing services that are already specified.
(4) In general, the effect of interoperability requirements is to add constraints to the specification, which is why the strategic guideline 6.1.2 recommends that they be deal with first, along with any concurrency requirements (clause 11), when developing a specification. When constraints arise in connection with other instantiations of the same service, or different services being specified at the same time, though they will exist they may not be especially troublesome. Constraints are likely to be much more severe when interoperability is required with an existing, already specified service, since it is unlikely that it will be possible to alter the specification of that service to make interoperability easier. Even if the specification of that service is being revised, the scope for adjustment to ease interoperability may be limited, or even non-existent.
(5) In the worst cases, the constraints may create pressure to compromise the aims of the language-independent service specification, for example if another service makes representational assumptions about exchange values, or makes other implementation assumptions which have an impact on interoperation. They may even create pressure to compromise the aim of language independence. This needs handling with great care, and preservation of language independence may require some ingenuity. This clause provides some guidelines on dealing with such situations.
(6) Severe constraints can also occur if there is a need for synchronicity, or at least some guaranteed response time. If the service being specified has to meet such a requirement for an external user, the need to interact with some other service can create complications. Alternatively, if the other service demands synchronicity or other forms of time constraint, this can potentially affect the ability of the service to respond to its own external users. In general, how services can handle time constraints is outside the scope of this Technical Report, except that languages vary very greatly in their ability to handle synchronicity and time constraints, which may place severe difficulties in the way of defining the service itself, or language bindings, in a truly language-independent way.
(7) Though the nature of the other services is the most important factor affecting interoperability, two other factors may be important: the nature of the interoperation, and how it is invoked.
10.1.2 The nature of the interoperation
(1) Interoperation may be master-slave, slave-master, or peer-peer. In a master-slave relationship, the language-independent service invokes the other service, but has to do no more than state its requirements, expecting the other service to deliver what is required. In a slave-master relationship, the language-independent service is invoked by the other service, and has to deliver what that other service requires. In a peer-peer relationship, the services cooperate to deliver what the external user requires.
(2) The master-slave situation should cause relatively little difficulty, the first because it is a matter only of invoking the other service and being able to handle its various responses. The slave-master situation can be treated as if the other, "master", service is another external user, with its own interface, the main problems arising if the other service is pre-defined and imposes requirements involving severe constraints. The peer-peer situation may also involve severe constraints if the other service is pre-defined, and may pose tricky design problems.
10.1.3 How interoperation is invoked
(1) Interoperation may be invoked by the external user (e.g. by exercising an option or selecting a parameter) or may take place in the background, solely within the service, so that the external user is not directly concerned with it (and may not even be aware of it).
(2) Neither of these situations should present too many problems, provided that it is clearly understood which form of interoperation is involved, and it is handled in the appropriate way. Where interoperation is invoked by the external user, this can be treated as part of the interface like any other feature of the service. Where interoperation takes place solely in the background, depending on the nature of the interoperating service it may be appropriate to define an explicit further interface, separate from the interface to the external user, to handle the interactions. Difficulties are likely to occur only when these two situations are confused, or not kept clearly separate.
10.2 Guidelines on interoperability with other instantiations of the same service
Where interoperability is required with other instantiations of the same service, it is probable that the relationship will be peer-peer. The guidelines that follow are therefore devised on that assumption. Circumstances can be envisaged in which this is not the case, in which case the guidelines in clause 10.3 for the master-slave relationship will need to be appropriately adapted.
10.2.1 Guideline: Identifying features affecting interoperability
All aspects of the service that affect interoperability with other instantiations of the service should be identified, and the specification should ensure that these are clearly distinguished from other aspects.
10.2.2 Guideline: Precise definition and rigorous conformity requirements
All aspects of the service that affect interoperability with other instantiations of the service should be precisely defined, and conformity requirements should be made rigorous enough to ensure that the ability to interoperate will always be maintained, whatever combination of options and implementation-defined choices are used by this and the other instantiations.
NOTES
1. Experience shows that interoperability between standard-conforming implementations is often prevented because conformity rules are not strong enough to ensure it.
2. The temptation to overspecify the requirements - e.g. making rigid representational requirements - simply to make absolutely sure that interoperability will always be possible, should be avoided. It is sufficient to keep the scope of the specification and its level of abstraction clearly in mind, and to ensure that implementors understand what is required and that strict adherence to the conformity rules is necessary.
3. The use of formal definitions to eliminate ambiguity is particularly useful in relation to interoperability requirements.
10.2.3 Guideline: Importance of exchange values
In specifying interoperability requirements, particular attention should be paid to the datatypes used for exchange values, and to the exact ranges of validity of data values needed for interaction.
NOTES
1. ISO/IEC 11404:1995 Language independent datatypes includes facilities for specifying precise ranges of values in a language-independent way, so representational requirements should not be needed, unless the service itself is at a representational level of abstraction.
2. It is possible, without breaching this guideline, to allow values outside the specified range of validity for interaction to be used in situations where interaction is not invoked. This, however, is a risky practice, and is probably best avoided unless a strong rationale exists to permit it.
10.3 Guidelines on interoperability with other services
(1) Where interoperability is required with other services, it is possible that the relationship will be peer-peer, but more likely that it will be master-slave or slave-master. A peer-peer relationship is most likely to occur when specifications for the two (or more) services are being developed together. Master-slave or slave-master relationships can occur with specifications being developed together, but it is more likely that the "slave" service will be defined first and the "master" service is specified later to make use of it. However it can happen that a "master" service is defined and then (for example at a revision which extends the service) requires a "slave" service which it can invoke.
(2) The guidelines that follow therefore cover the two main cases, of services (whatever the relationship) being developed together, and of a service being developed to interoperate (whatever the relationship) with some pre-defined service.
NOTE
Where more than two services are involved it is of course possible that there is a "mixed" situation where two are more services are being developed together to interoperate with one or more services already defined. Those faced with that task will need to apply the guidelines below as best they can, to meet the needs of the particular case.
10.3.1 Guideline: Interoperability with other services being defined at the same time
Where interoperability is required with other services which are also being defined at the same time, the services should be regarded as a single "super-service" in respect of the interoperability aspects, and the guidelines in Clause 10.2 should then be applied to that "super-service".
NOTES
1. Care will be needed, with duplication of definitions if necessary, to ensure consistency across the different components of the "super-service", and allowance will need to made for the possibility that these different component services may be implemented using different languages.
2. Treating two or more services as a single "super-service" for the purposes of specification is simpler to arrange if the same group is responsible for all of them. A high level of liaison, cooperation, and mutual trust will be called for if more than one group is involved.
10.3.2 Guideline: Interoperability with a pre-defined service
Where interoperability is required with another service which is already, all aspects of the pre-defined service that affect interoperability with the service now being defined should be identified, particular note being made of those which impose pre-defined requirements. If these requirements are specified in a language-dependent way, they should be re-specified in language-independent form. An interface should then be defined which allows the language-independent service to appear to the pre-defined service as if it were a service in the same language. All definitions should be made precise, and conformity rules should be made rigorous, especially for this interface, particular attention being paid to exchange values.
NOTE
The interface to be defined above will not be the same as the user interface of the pre-defined service, other than possibly in the special case where is the pre-defined service is a slave service which is only ever used through invocation from other services.
11. Guidelines on concurrency issues
(1) Concurrency issues, i.e. issues concerning whether actions should take place serially or in parallel, can arise within the specification of the service, in the way the interface with users of the service operates, or in what the service, through its interface, requires from the user.
(2) In general, the processes of a service can be divided into three groups: essentially serial, optionally concurrent, and essentially concurrent. A process that is essentially serial has to have its parts carried out in a specified sequence if it is to function correctly. A process that is essentially concurrent has to have its parts carried out in parallel if it is to function correctly (though the parallelism can often be simulated by a serial process achieving the same end result, if there are no external constraints to make that impossible). A process that is optionally concurrent will function correctly whether or not its parts are carried out in parallel (since the parts are not interdependent in any way that affects the process).
NOTES
1. The logical fourth possibility, optionally serial, is identical to optionally concurrent.
2. The replacement of the values a,b,c of the sequence (a,b,c) by the values x,y,z, giving (x,y,z), is an example of an optionally concurrent action. However, their replacement by the values c,a,b to give (c,a,b) is an example of an essentially concurrent action, since changing the values one at a time will in general not produce the required result. The essentially concurrent action can, however, be simulated serially by making copies of values that would otherwise be lost, and using them when needed.
(3) In this clause, the term "concurrency requirement" is used to denote any requirement relating to any of these three possibilities; in particular it may mean either or both of a requirement to perform tasks in a given sequence or of a requirement to perform tasks in parallel.
(4) In general, the effect of concurrency requirements is to add constraints to the specification, which is why the strategic guideline 6.1.2 recommends that they be deal with first, along with any interoperability requirements (clause 10), when developing a specification.
11.1 Guidelines on concurrency within the service specification
11.1.1 Guideline: Avoidance of unnecessary concurrency requirements
A language-independent service specification should avoid concurrency requirements other than any which are absolutely necessary to provide the service; in particular it should not require serial processing when parallel processing can achieve the required, nor should it require actual parallel processing (as opposed to simulated parallel processing) unless this is demanded by external constraints or the nature of the service. Every apparently necessary concurrency requirement should be examined closely, to see if there is a way of avoiding it, so that the number that eventually remain in the specification is kept to a minimum.
NOTES
1. Unnecessary concurrency requirements, whether for serial processing or parallel processing, is an example of overspecification arising from the inclusion of implementation assumptions.
2. Requirements to handle a number of service users simultaneously (see clause 11.2) may entail some degree of parallelism, but this guideline still applies.
11.2 Guidelines on concurrency of interaction with service users
Depending on the nature of a service, it may necessarily have to deal with one user at a time. In that case it may be possible that it will not be able to accept a demand from another user until the current one has been dealt with, or it may be able to support a queuing system, where incoming calls on the service are accepted as they arise, but are still dealt with one at a time. Alternatively, it may be able to handle a number of service users simultaneously.
11.2.1 Guideline: Handling of concurrent service requests
A language-independent service specification should explicitly state whether an implementation must be capable of handling concurrent service requests, and if so whether the services must be provided concurrently, or may be queued and the service provided to the users in the queue one at a time.
11.2.2 Guideline: Number of concurrent service requests handled
Where handling of concurrent service requests is required, either through simultaneous provision or by a queuing system, the language-independent service specification should state the minimum number of such requests that it must be possible to handle simultaneously, and require the maximum number that can be handled to be documented.
NOTE
A service may of course be able to handle a certain number of users simultaneously, but also to maintain a queue of those unable to be dealt with immediately. This guideline then applies, separately, both to the simultaneous provision and to the queue.
11.2.3 Guideline: Order of processing of service requests
A language-independent service specification should explicitly state whether an implementation must handle service requests in order of arrival, or may prioritize requests, or must prioritize requests.
11.2.4 Guideline: Criteria for prioritizing service requests
Where a service must or may prioritize requests, the language-independent service specification should explicitly define the criteria which must or may govern prioritizing decisions, or at a minimum specify constraints which must be met.
NOTE
An example of a constraint is: whatever other criteria may apply, no request should be made to wait for more than a specified period of time.
11.3 Guidelines on concurrency requirements on bindings
In a language-independent service specification, requirements on users are expressed as requirements on language bindings, through the service interface. This clause provides guidelines for handling concurrency issues that may arise in the specification of such requirements.
11.3.1 Guideline: Avoidance of concurrency requirements
A language-independent interface of a service specification should explicitly be neutral with respect to concurrency, i.e. it should place no requirements on whether an implementation of a language binding uses a serial or a parallel approach or any combination of the two.
NOTES
1. Languages vary greatly in their capability for handling parallelism. Requiring concurrency of a binding may create severe problems for implementing it efficiently, or even at all, or may force implementors to adopt solutions which do not conform to the language standard.
2. Some languages are very well equipped to handle parallelism. Requiring a serial form of implementation may place unnecessary constraints on implementors using that language; a far more efficient and natural form of binding may be possible using language features supporting parallelism, and should not be precluded.
3. This guideline does not imply that a particular language binding should not impose concurrency requirements on implementations of that binding; the semantics of certain language features may mean that, for an implementation to be correct, certain concurrency requirements have to be met.
11.3.2 Guideline: Specification of unavoidable concurrency requirements
Where a language-independent interface of a service specification cannot be neutral with respect to concurrency, e.g. through external constraints, the unavoidable concurrency requirements should be specified fully, but in as general a way as possible so as to place the fewest possible constraints on bindings. In particular, no explicit or implicit assumptions should be made about how a language may support parallelism.
12. Guidelines on the selection and specification of datatypes
(1) Probably without exception, all service specifications will make use of the concept of data, and any specification will need to define the data to which it applies. The commonest and clearest way of doing this is by means of datatypes: a data value which belongs to the relevant defined datatype is covered by the specification, while a data value which does not belong to the relevant defined datatype is not so covered (and in general an attempt to use such an incorrect value will constitute an error).
(2) This clause provides guidelines for the selection and use of datatypes in language-independent service specifications.
12.1 Guideline: Use of ISO/IEC 11404
The datatypes used in the language-independent service specification should be selected from those defined in ISO/IEC 11404, Language-independent datatypes, either by direct adoption, or using the methods it defines for generating further datatypes from those directly provided in the standard.
NOTE
ISO/IEC 11404 provides a wide variety of primitive datatypes suitable for direct adoption, and a variety of methods for generating further datatypes from these. These methods include various forms of aggregation (including Set, List, Array, Record, a