<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>cient adapters</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Christian Gierds?</string-name>
          <email>gierds@informatik.hu-berlin.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Humboldt-Universitat zu Berlin, Institut fur Informatik</institution>
          ,
          <addr-line>10099 Berlin</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>When adapting services in a SOA environment, not only the validity of the adapter may be of importance, but also non-functional properties like the costs of the adapter. We introduce an approach for nding cost-e cient adapters based on the operating guideline, which characterizes all valid adapters for the given services.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        In the context of Service-Oriented Architectures (SOA) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] composition of
actually incompatible services, which have a well-de ned interface in order to o er
a special functionality, is highly demanded. A service of one organization may
not have been designed to work together with a service of a di erent
organization. But before changing one or even both of these services, an appropriate
adapter may help to overcome the incompatibility. A (behavioral) adapter then
acts between the two di erent services and controls their communication in such
a way, that a certain set of functional properties like deadlock freedom or
weaktermination is satis ed.
      </p>
      <p>Especially in corporate environments costs like time, memory or money are
relevant factors for components. So if a company decides to use an adapter, it
may want that the overall runtime of the adapter stays below a certain limit in
order to guarantee some real-time constraints or the costs for using third parties
should be minimized. Besides this demand, the adapter still needs to be valid {
the original goal to resolve incompatibilities must be maintained.</p>
      <p>Our approach focuses on the minimization of the most expensive run of an
adapter, meaning that for every other valid adapter the most expensive run is
at least as expensive as for the calculated adapter.</p>
      <p>The paper is structured as follows: In Sect. 3 we will describe the approach
which covers both the validity and the cost optimization of adapters. Before it,
we will introduce the basic formalisms in Sect. 2, namely open nets and operating
guidelines. In the last section, we will summarize the obtained results and give
an outlook on extensions of this approach.</p>
    </sec>
    <sec id="sec-2">
      <title>Adapting services</title>
      <p>An adapter is an artifact acting as mediator between services. This is necessary if
the adapted services are incompatible regarding their interface or their behavior.
? Supported by German Research Foundation (DFG) under grant RE 834/18-1
(a) Provider
(b) Adapter</p>
      <p>D
F</p>
      <p>B</p>
      <p>E
(d) Cost-e cient
adapter
(c) Requester
The adapter then should overcome these incompatibilities and guarantee a well
behaved interaction of the services.</p>
      <p>
        There are di erent approaches for adapters like [2{6] and recently also [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ],
to which we will refer. They mainly di er in the way, how elementary actions of
an adapter are described and derived, and how the actual adapter is calculated.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] a two-step approach is presented. First, for two given services P and R
a rewriter part E (part of the nal adapter) connects to the interfaces of P and
R, provides transitions to manipulate messages based on a set of simple rules,
and creates an interface for triggering these transitions. In the second step, a
controller part C for the composition of P E R is calculated such that certain
properties like deadlock freedom etc. are ensured (see [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]). The suggested cost
optimization in this paper is executed on C.
      </p>
      <p>Open nets The used adapter approach is based on open nets, an extension of
Petri nets, where distinguished places act as interface.</p>
      <p>De nition 1. The tuple (P; I; O; T; F; m0; ) is called an open net i
{ (P; T; F; m0) is a Petri net with a set of places P , a set of transitions T , a
ow relation F P T [ T P and an initial marking m0 : P ! N,
{ I and O are disjoint sets of input I P and output O P places, I \O = ;,
and
{ is a set of nal markings.</p>
      <p>Two open nets can be composed ( ) by merging equally named input and
output places. The ring rule is equivalent to the one of regular Petri nets. A
marking is not called a deadlock if it is included in the set of nal markings.</p>
      <p>The nets depicted in Fig. 1 are open nets. The places on the dashed border
form the interface, all places belonging to the initial marking contain a black
(!D +#!6E1+ !F) (!B +#!4E9+ !F)
!D !F !B !E !B !F
(!E#+54!F)
(!D# +30!E)
!F !D !E !B
#!E23
(!B#+18!E)
!D !E
# 39
!F
!E !F !D
# 8
ifnal</p>
      <p>!B
!B
!D
(!A + !B + !C#+0!D + !E + !F)
!F !E
!C</p>
      <p>!A
(!A + !B +#!C1+ !D + !E) (!A + !B +#!C33+ !D + !F)
!D !E !B !E !D !C !F !A !F !C
(!D# +46!F) (!B#+34!F) (!A + !B#+2!C + !D)
!F !B !E !F !B !D
#!D15 #!B3</p>
      <p>(!A#+26!E)
!C !E !A !F
# 11
!A
(!A +#!5E7+ !F)
!E</p>
      <p>(!C +#!6E3+ !F)
!A !F !A !E !C
(!A# +42!F) (!C# +32!E) (!C# +48!F) (!E#+60!F)
!E !A !C !F !A !C !F !E
#!C17 #!E29 #!4F5
!A !C !E !F
# 14
ifnal
token and places belonging to a nal marking are shown with a two line border.
If the nets in Fig. 1 are composed as implied by the gures' alignment, the
composition will be deadlock free.</p>
      <p>
        Adapters The open nets P and R represented in Figs. 1(a) and 1(c) are not
compatible, since the number of exchanged messages does not t. Based on
certain message transformation rules provided with the two services an adapter
like Fig. 1(b) might be build based on the considerations in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>
        In our example let A-F be such rules that transform messages. Instead of
executing these rules arbitrarily, we provide an interface such that these rules
can be triggered by an controller. This controller will ensure certain properties
like deadlock freedom, if wanted (see [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]). In the following, message exchange
will be called an event.
      </p>
      <p>Figure 2 shows such a controller. The graph, called Operating Guideline, is a
labeled transition system, where each edge label represents an event, namely the
sending or receiving of a message. Furthermore each node n has an annotation
over the labels of the edges leaving n. A satisfying assignment corresponds
to a valid combination of edges, that have to be included in an controller, such
that the controller is valid. In this paper we assume the operating guideline to
be acyclic.</p>
      <p>
        The controller part C can be transformed to an open net using the approach
in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], such that C and E can be composed to form a valid adapter E C.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Cost optimization</title>
      <p>Looking at the possible adapters for P and R, besides some control structures
we can mainly distinguish each single adapter by the transformation rules it
can execute. It is legitimate to assume, that these transformation rules generate
the costs in a corporate environment. In the simplest case, time is consumed to
apply such a rule. In a more distributed scenario, such a transformation might
be done by an external service provider, which will result in a fee which must
be paid.</p>
      <p>
        Just eliminating expensive transitions in the adapter is not an solution for
nding cost-e cient adapters. When changing the adapter, we have to ensure
that the correctness criterion like deadlock free communication is maintained.
Therefore approaches like [
        <xref ref-type="bibr" rid="ref10 ref9">9, 10</xref>
        ] are not usable in this scenario, since we do not
want to just calculate the cost for a service, but based on cost estimation build
a service, in this case an adapter.
      </p>
      <p>The operating guideline calculated during the adapter synthesis contains all
information about legal adapters. Therefore an cost optimization should be done
on this structure. There are two points we have to take care of, namely i) the most
expensive run of the adapter shall be minimized and ii) the resulting structure
must still be a valid adapter (thus, P A R still must be deadlock free).</p>
      <p>If we look at any given adapter A, it is still possible that A has di erent
execution traces, i.e. sequence of events, depending on internal decisions in the
services P and R.</p>
      <p>The costs for one run of the adapter, a trace of events, is simply the sum of
each applied message transformation. Thereby the cost function is a mapping of
every transformation rule r 2 R to a natural number: c : R 7! N.
De nition 2. The costs of a trace t is the sum of its contained events: c(t) =
k
P c(ri) for t = (r1; : : : ; rk).
i=1</p>
      <p>We will focus on the question, which is the worst case, meaning, which are
the highest costs we have to anticipate regarding the possible traces of A.
De nition 3. The costs of an adapter A is the maximum costs over all traces
k
of A: c(A) = max P c(t).</p>
      <p>t2traces(A) i=1</p>
      <p>Based on Def. 3 our optimization goal is to nd an adapter, whose costs are
at most as expensive as for any other valid adapter.</p>
      <p>De nition 4. An adapter A is cost-e cient if for any other adapter A0 yields
c(A) c(A0).</p>
      <p>The controller introduced in the previous section contains all information
necessary for nding cost-e cient adapters. The annotations provide details about
which other controllers are valid, and since every application of an
transformation rule is communicated, it also contains all execution traces as a branching
structure.</p>
      <p>In order to nd an cost-e cient adapter we will annotated each edge with
a set of traces as follows. Given these edge annotations, we will compute an
assignment for each node's annotation.</p>
      <p>The costs incurred by using an edge is the maximum (the worst case) costs
of the traces that are possible via this edge.</p>
      <p>De nition 5. The costs of an edge e is the maximum cost of its assigned traces:
c(e) = max c(t).</p>
      <p>t2traces(e)</p>
      <p>Given a satisfying assignment for the annotation of a node n, states
which edges leaving n have to be included in a controller in order to be valid.
The node's costs regarding then is the maximum over the edges' costs (again,
the worst case).</p>
      <p>De nition 6. The costs for a node n and an assignment n is the maximum
cost of the edges e leaving n, which corresponding literal is set to true in n:
c n (n) = max c(e).</p>
      <p>n(e)=true</p>
      <p>Since every satisfying assignment yields in a valid adapter, we choose an
assignment, which results in the minimal costs for a node.</p>
      <p>De nition 7. The costs for a node n is the minimum costs over all assignments
n satisfying n's annotation : c(n) = min c n (n).</p>
      <p>( n)=true
The assignment n, which minimizes c(n) is called the minimal n.</p>
      <p>Given the previous de nitions the following algorithm will calculate a
coste cient adapter.</p>
      <p>Algorithm Let P and R be two open nets, E a partial adapter, and C the
operating guideline for P E R. Then an cost-e cient adapter can be found
as follows:</p>
      <p>Initially all edges have no traces assigned, and all nodes have in nite costs,
except for the leaf nodes (without successor), which have costs 0 (resulting
from Def. 7). Then, as long as there are nodes with in nite costs, pick such
a node n, so that each successor n0 of n has nite costs c(n0) &lt; 1. Assign
for each edge e = (n; n0) the set of traces according to the minimal n0 of
n0: traces(e) = flabel (e) + t0 j t0 2 traces(e0); n0 (e0) = trueg (meaning: each new
trace starts with label (e) followed by the events in the traces of e0). Afterwards
the costs c(n) can be calculated.</p>
      <p>The costs for resulting adapter A = E C are the costs of C's root node.</p>
      <p>Since we assume the operating guideline to be nite and acyclic, it can be
easily seen, that the suggested algorithm will terminate, and all nodes will have
nite costs. Furthermore we gain a valid controller (implied by the found minimal
assignments), which minimizes the costs.</p>
      <p>Theorem 1. The provided algorithm nishes with a controller C such that A =
E C is a cost-e cient adapter for P and R.</p>
      <p>
        Proof. (Sketch.) This result yields mainly due to Def. 7. The adapter A is valid,
since for each node n of the controller, the minimal n satis es n's annotation
(see [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] for details). Assume A0 is another valid adapter with less costs c(A0) &lt;
c(A). Since both A and A0 are derived from C there exists a node n included in
both adapters, but di ering in the minimal n, meaning cA0 (n) &lt; cA(n), which
contradicts Def. 7. Therefore the found adapter is valid and cost-e cient.
      </p>
    </sec>
    <sec id="sec-4">
      <title>Summary</title>
      <p>We have seen an approach which calculates a cost-e cient adapter based on
an annotated graph which acts as controller for the application of the message
transformation rules. By nding optimal assignments to the nodes' annotations
we obtain a smaller, but valid adapter, where expensive runs can be excluded.</p>
      <p>The time for nding such an adapter is exponential in the number of
applicable message transformation rules in the worst case, since for every node all
satisfying assignments must be checked. Nevertheless in most cases the approach
should yield the result in a reasonable time, since the annotations are normally
short and therefore quickly to be checked. In order to show its feasibility, this
algorithm shall be implemented and checked with real-world examples.</p>
      <p>As extension of this approach probabilities for the occurrence of events shall
be introduced, so that the average costs of an adapter can be calculated. This
extension would also allow to lift the optimization to cyclic controllers. Although
cyclic adapters are nite, the have however in nite traces and therefore in nite
costs.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Papazoglou</surname>
            ,
            <given-names>M.P.</given-names>
          </string-name>
          : Web Services:
          <article-title>Principles and Technology</article-title>
          . Pearson - Prentice
          <string-name>
            <surname>Hall</surname>
          </string-name>
          ,
          <source>Essex (July</source>
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Brogi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Canal</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pimentel</surname>
          </string-name>
          , E.:
          <article-title>On the semantics of software adaptation</article-title>
          .
          <source>Science of Computer Programming</source>
          <volume>61</volume>
          (
          <year>2006</year>
          )
          <volume>136</volume>
          {
          <fpage>151</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Benatallah</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Casati</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grigori</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Motahari</given-names>
            <surname>Nezhad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.R.</given-names>
            ,
            <surname>Toumani</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.</surname>
          </string-name>
          :
          <article-title>Developing Adapters for Web Services Integration</article-title>
          .
          <source>In: Proc. CAiSE</source>
          . Volume
          <volume>3520</volume>
          of LNCS. (
          <year>2005</year>
          )
          <volume>415</volume>
          {
          <fpage>429</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Bracciali</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brogi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Canal</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>A formal approach to component adaptation</article-title>
          .
          <source>Journal of Systems and Software</source>
          <volume>74</volume>
          (
          <issue>1</issue>
          ) (
          <year>2005</year>
          )
          <volume>45</volume>
          {
          <fpage>54</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Brogi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Canal</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pimentel</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vallecillo</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Formalizing Web Service Choreographies</article-title>
          .
          <source>Electr. Notes Theor. Comput. Sci</source>
          .
          <volume>105</volume>
          (
          <year>2004</year>
          )
          <volume>73</volume>
          {
          <fpage>94</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Dumas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Spork</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Adapt or Perish: Algebra and Visual Notation for Service Interface Adaptation</article-title>
          .
          <source>In: Proc. BPM</source>
          . Volume
          <volume>4102</volume>
          of LNCS., Springer (
          <year>2006</year>
          )
          <volume>65</volume>
          {
          <fpage>80</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Gierds</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mooij</surname>
            ,
            <given-names>A.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Specifying and generating behavioral service adapter based on transformation rules</article-title>
          .
          <source>Preprint CS-02-08</source>
          , Universitat Rostock, Rostock, Germany (
          <year>August 2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Massuthe</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reisig</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schmidt</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>An Operating Guideline Approach to the SOA</article-title>
          .
          <source>Annals of Mathematics, Computing &amp; Teleinformatics</source>
          <volume>1</volume>
          (
          <issue>3</issue>
          ) (
          <year>2005</year>
          )
          <volume>35</volume>
          {
          <fpage>43</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Hee</surname>
            ,
            <given-names>K.M.</given-names>
          </string-name>
          <year>v</year>
          .,
          <string-name>
            <surname>Sidorova</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stahl</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verbeek</surname>
            ,
            <given-names>H.M.W.:</given-names>
          </string-name>
          <article-title>A price of service in a compositional SOA framework</article-title>
          .
          <source>Computer Science Report</source>
          <volume>07</volume>
          /16, Technische Universiteit Eindhoven, The Netherlands (jul
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. vom Brocke, J.,
          <string-name>
            <surname>Lindner</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          :
          <article-title>Service portfolio measurement: a framework for evaluating the nancial consequences of out-tasking decisions</article-title>
          .
          <source>In: ICSOC</source>
          . (
          <year>2004</year>
          )
          <volume>203</volume>
          {
          <fpage>211</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Schmidt</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Controllability of Open Work ow Nets</article-title>
          .
          <source>In: Enterprise Modelling and Information Systems Architectures</source>
          . Volume P-
          <volume>75</volume>
          <source>of LNI</source>
          . (
          <year>2005</year>
          )
          <volume>236</volume>
          {
          <fpage>249</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Badouel</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Darondeau</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Theory of Regions</article-title>
          .
          <source>In: Lectures on Petri Nets I: Basic Models</source>
          . Volume
          <volume>1491</volume>
          of LNCS., Springer-Verlag (
          <year>1996</year>
          )
          <volume>529</volume>
          {
          <fpage>586</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>