and F(M
A
), to be associated to M
B
and M
A
respec-
tively. These two serializable types are related by the
corresponding embedding F(i) that allows to convert
any instance in F(M
B
) into F(M
A
). In order to con-
vert messages between categories, two serialization
transformations, s
1
and s
2
, transform the instances
of M
B
and M
A
to their respective serializable forms
in F(M
B
) and F(M
A
). Likewise, two deserialization
transformations, d
1
and d
2
, transform the instances
of F(M
B
) and F(M
A
) to their respective marshallable
forms in M
B
and M
A
.
In a diagram like this, what properties can we as-
sume? First, it is natural to specify that the composi-
tion of the serialization transformation with the dese-
rialization transformation produces the identity trans-
formation, modulo a natural equivalence over mar-
shallable types asserting that two objects are equiv-
alent if their serialization is equal. Second, the dia-
gram in Figure 4 may be commutative: all paths with
the same source and target define by composition the
same function, modulo the natural equivalence over
marshallable types.
Actually, these two assumptions are fundamental
to solve the subtyping issues previously described as
we will discuss in the next section.
5 DISCUSSION AND FUTURE
WORK
In both examples described in Figures 2 and 3, the
whole process is described by finding a path join-
ing M
B
to M
A
by crossing the category of serializ-
able types. Actually, the path that causes problems is:
M
B
→ F(M
B
) → F(M
A
) → M
A
. The trouble comes
from an erroneous conversion function from F(M
B
)
to F(M
A
), namely F(i) : F(M
B
) → F(M
A
). It is con-
sidered as equal to the identity function, which is a
violation of the commutativity property. With this
value, the composition of the different functions over
the path is not well-defined in some cases, which gen-
erates the errors observed. But with the commutativ-
ity assumption, the problem can be tackled. Indeed,
the conversion function can be easily computed:
F(i) = d
1
;i;s
2
.
It is obtained by composing the deserialization trans-
formation with the embedding function and finally the
serialization transformation.
Practically, F(i) corresponds to a projection and
possibly a renaming for the serializable structures.
For instance, assume that type A has one serializ-
able attribute x, while its subtype B has another se-
rializable attribute y. An instance of F(M
B
) could be
represented by the structure B(x(val
x
), y(val
y
)) (using
a parenthesis notation) while an instance of F(M
A
)
could be represented by the structure A(x(val
x
)).
Then the conversion function F(i) renames the mes-
sage root element from B to A and projects the couple
of values (x, y) into x. Finally, the conversion function
F(i) can be integrated in the framework for serializa-
tion and deserialization at reception on both client and
server sides, in a fully transparent way, which satisfies
the loose coupling principle: this solution does not re-
quire any extra adaptation on the client side when a
switch is done between compatible services.
Finally, it turns out that the diagram, when as-
sumed commutative, could become a well-founded
specification for serialization and deserialization. Its
implementation could lead to the definition of a new
data binding between marshallable types and serializ-
able types, preserving the subsumption property asso-
ciated to subtyping, and therefore improving interop-
erability.
REFERENCES
Carpineti, S. and Laneve, C. (2006). A basic contract lan-
guage for web services. In Programming Languages
and Systems, 15th European Symposium on Program-
ming (ESOP), volume 3924 of LNCS, pages 197–213.
Springer.
Kourtesis, D. and Paraskakis, I. (2009). Semantic Enter-
prise Application Integration for Business Processes:
Service-Oriented Frameworks, chapter IV. Business
Science Reference, Hersley.
L
¨
ammel, R. and Meijer, E. (2007). Revealing the x/o
impedance mismatch: changing lead into gold. In
Proceedings of the 2006 international conference on
Datatype-generic programming, SSDGP’06, pages
285–367, Berlin, Heidelberg. Springer-Verlag.
Lee, T. Y. L. and Cheung, D. W. (2010). Formal models
and algorithms for XML data interoperability. JCSE,
4(4):313–349.
Pierce, B. C. (1991). Basic Category Theory for Com-
puter Scientists (Foundations of Computing). The
MIT Press, 1 edition.
Seco, J. C. and Caires, L. (2000). A basic model of typed
components. In ECOOP, pages 108–128.
Srirama, S. N., Jarke, M., and Prinz, W. (2006). Mobile web
service provisioning. Advanced International Confer-
ence on Telecommunications / Internet and Web Ap-
plications and Services, International Conference on,
0:120.
Zaplata, S., Dreiling, V., and Lamersdorf, W. (2009). Re-
alizing mobile web services for dynamic applications.
In Godart, C., Gronau, N., Sharma, S., and Canals, G.,
editors, Proceedings of the 9th IFIP Conference on e-
Business, e-Services, and e-Society (I3E 2009), pages
240–254. Springer.
FromObject-orientedProgrammingtoService-orientedComputing-HowtoImproveInteroperabilitybyPreserving
Subtyping
173