- Cross-platform support middleware
-
A Cross-Platform Support Middleware (CPSM) is a software abstraction layer that guarantees the existence, and correct implementation, of a set of services on top a set of platforms.[1]
Contents
Formal Model
Formally, a CPSM can be represented by the following model:
- Let S be the set of provided services, and sm the M + 1 elements of that set, with .
- Let P be the set of supported platforms, and pn the N elements of that set, with .
- The special service s0 denotes the set of trivially cross-platform services provided (e.g. programming language, buffered I/O, etc.).
- Thus, a CPSM can be defined as:
A = CPSM(S,P)
The formal model may be extended to account for the abstract and concrete (native) interfaces of the services provided:
- Let be the concrete (native) interface for service sm in platform pn.
- Let Id(S,P) be the set concrete (native) interfaces (i.e. ).
- Let im be the abstract interface for service sm, provided by the CPSM regardless of the underlying platform.
- Let I(S) be the set abstract interfaces (i.e. im).
Formally, the strong condition for the existence of a CPSM can be expressed as:
Trivial CPSM
There are two trivial cases of a CPSM: the single-platform CPSM and the inherently compatible CPSM.
A single-platform CPSM is compatible with one, and only one platform. Formally, | P | = 1, or, equivalently, P = {p1}. In broad terms, an operating system might be considered a single-platform CPSM.
An inherently compatible CPSM is an abstraction layer that only provides services trivially compatible in every compatible platform. Formally, | S | = 1, or, equivalently, S = {s0}.
Non-trivial CPSM
A non-trivial CPSM must verify two conditions:
- The compatible platform set must contain at least two platforms.
- The provided services set must contain at least one non-trivial service.
Formally:
- | P | > 1
- | S | > 1
Abstraction method
The abstraction method in the CPSM development is the method used to compile the concrete source code for a given platform without compromising the abstract interfaces provided. The most commonly used abstraction methods in CPSM development are: conditional compilation and directory separation of sources.
The first method consists in embedding preprocessor instructions in the source code to conditionally select the source subtree compatible with a given platform.
The second method takes advantage of the filesystem organization to divide the source code in different folders, one for each incompatible platform. Thus delegating the selection problem to the build system.
Some distributions like MSYS and cygwin may help build the cross-platform code in a unix-like environment even on Microsoft Windows. Both distributions provide a decent version of GNU Make that can direct the build process in a cross-platform fashion.
See also
- Adaptive Communication Environment
- Netscape Portable Runtime
- Simple DirectMedia Layer
- wxWidgets
- Boost C++ Libraries
- GTK+
References
- ^ Zavolinsky, Patricio. "Abstracción en el desarrollo de software independiente de la plataforma: Análisis del proceso de desarrollo de Cross-Platform Support Middlewares (spanish)". Universidad de Buenos Aires, Argentina. http://materias.fi.uba.ar/7500/zavolinsky-tesisdegradoingenieriainformatica.pdf. Retrieved 2008-09-25.
Categories:
Wikimedia Foundation. 2010.