
A Feature-Oriented Alternative to Implementing
Reliability Connector Wrappers
J.H. Sowell and R.E.K. Stirewalt
Michigan State University, East Lansing, Michigan 48824 USA,
{sowellje,stire}cse.msu.edu
Abstract. Connectors and connector wrappers explicitly specify the
protocol of interaction among components and afford the reusable appli-
cation of extra-functional behaviors, such as reliability policies. Ideally,
these specifications can be used for more than just modeling and analysis.
We are investigating how to use them in the design and implementation
of the middleware substrate of a distributed system. This paper reports
our experience elaborating connectors and connector wrappers as in-
stantiations of a feature-oriented middleware framework called Theseus,
which supports the design of asynchronous distributed applications. The
results of this case study indicate that the relationship between specifi-
cation features and implementation-level features is not one-to-one and
that some specification features have complex, often subtle, manifesta-
tions in Theseus’ design. This work reports the lessons learned designing
these strategies and suggests techniques for designing middleware frame-
works and composition tools that more explicitly reify and expose the
features specified by connectors and connector wrappers.
1 Introduction
Increasingly, distributed computing systems are deployed in volatile environ-
ments in which network connectivity is sporadic and unreliable. In response, a
variety of reliability policies have been devised to shield users from the effects
of this volatility. For example, automatic retry detects when a service request
fails and automatically resends that request rather than propagating the excep-
tion to the client program. More sophisticated policies, such as failover, exploit
redundant servers: When a request to one server fails that request is automati-
cally forwarded to another rather than propagating the exception to the client
program. In each case, an unreliable service is promoted to one that is reliable
without altering the implementation of the unreliable service. Consequently, such
policies tend to be incorporated into the middleware layer by wrapping an un-
reliable middleware implementation with code that intercepts service requests
and performs the extra functionality.
To understand how to use wrappers to apply and compose reliability policies,
Spitznagel and Garlan [1] developed a technique based on a formal behavioral
model of architectural connection [2]. These connector wrappers impose policies

2
on an existing connector specification by extending and/or restricting its observ-
able behaviors. Moreover, each connector wrapper has an implementation coun-
terpart that can be applied to incorporate the policy into an existing middleware
implementation. These implementation wrappers compose with the flexibility of
their specification counterparts by treating the underlying middleware as a black
box. Unfortunately, the resulting implementations may incur redundancies and
inefficiencies that are unacceptable on the resource-constrained devices that are
most often exposed to volatile environments.
This paper describes an alternative implementation of connector wrappers
as reusable refinements rather than black-box wrappers. Reusable refinements
appeal to an algebraic model of software composition called AHEAD [3] and are
similar to ML functors [4] and mixin layers in C++ [5]. Refinements compose
functionally, just like wrappers; however refinement composition is more fine
grain and thus affords a tighter integration that enables the reuse and extension
of existing abstractions. Designers may thus customize a base middleware with
reliability strategies by applying refinements in a manner analogous to the ap-
plication of connector wrappers, and the resulting configurations will not exhibit
the redundancy and inefficiency introduced by implementation wrappers.
Our results exploit the fact that reliability strategies often employ the same
design abstractions that are used to implement basic middleware services. For
instance, many middleware systems use the asynchronous completion token pat-
tern [6] to demultiplex asynchronous operation requests and responses. This pat-
tern is also used to implement a strategy for warm failover [7] whereby clients
copy outgoing requests to a redundant backup server, which silently serves each
request in parallel with the primary. Were such a strategy implemented using
a wrapper, the wrapper would require logic for demultiplexing requests and re-
sponses with the backup server even though such logic exists in the underlying
middleware. Further, some reliability strategies may need to suppress behav-
iors, such as suppressing the responses sent by a server that is intended to play
the role of a silent backup. Wrappers suppress behavior by masking the observ-
able effects rather than forestalling the behavior itself. Using refinements, both
duplication of functionality and masking of behaviors can be avoided.
We believe that implementing reliability strategies as refinements will en-
able system architects to easily construct efficient middleware solutions subject
to a variety of reliability policies. To validate this claim, we implemented and
applied a set of reliability refinements to Theseus, which is an asynchronous
middleware implementation that we designed using the AHEAD model. In prior
work, we described three reliability refinements and showed that these exhibit
the compositional properties as their specification counterparts [8]. We have since
implemented other refinements, including one for warm failover that is useful for
comparing our approach with black-box wrappers. In the sequel, we describe the
design of Theseus and how refinements compose to produce new middleware that
incorporates various reliability policies. We then compare our refinement-based
implementation of warm failover to the wrapper-based design of [9].

3
2 Background
By way of background, we first introduce the use of wrappers to enhance relia-
bility in distributed systems and the connector-wrapper formalism, which mod-
els the behavior of these wrappers. Wrappers and connector wrappers exhibit
a useful structural correspondence between implementation and specification;
however wrappers also incur redundancies and inefficiencies that are unaccept-
able to resource-constrained devices. We contend that reliability enhancements
can be implemented so as to exhibit the same correspondence with connector
wrappers but without incurring the redundancies and inefficiencies of wrapper-
based implementations. The key is to implement the enhancements as reusable
refinements under the AHEAD model of composition, which supports the def-
inition of modules whose implementation abstractions are left open for further
refinement by other modules under composition. This section concludes with a
brief introduction to the AHEAD model.
2.1 Reliability-enhancing Wrappers
Software architects often wish to augment communication among the compo-
nents in a distributed system to incorporate extra functionality, such as logging,
encryption, and even strategies for enhancing reliability in the face of network
failures. Augmentation is accomplished by intercepting messages that cross the
boundary between client components and the communication or middleware
layer. Once intercepted, these messages are then either dropped, transformed
and then forwarded to their original destination, or routed to another destina-
tion. Interception has proved useful for adding reliability to a variety of system
calls (C.f., [10, 11]). The technique is now supported directly in modern middle-
ware systems (C.f., CORBA’s portable interceptor interface [12,13]).
1
This paper is concerned with reliability enhancements that are implemented
using wrappers, which serve to both mediate client access to a service as well as
augment that service with extra-functionality, as with interception. To preserve
the original interface, these wrappers are implemented based on the proxy pat-
tern [15]
2
. As an example, consider the addition of logging and data encryption
to messages sent by client components to a remote server component. Suppose
the class MiddlewareStub represents the type of the client-side stub object, such
as might be generated from an IDL specification of the server component. The
additional functionality is implemented by a hierarchy of wrapper objects that
conform to the class model in Figure 1. Commensurate with the wrapper pat-
tern, each class implements a common interface, which in this example is called
1
A powerful model of interception is captured by the composition-filters object model,
which allows designers to deploy filters that intercept and drop, modify, or reroute
messages among arbitrary objects in a system [14].
2
Readers familiar with GoF design patterns will notice wrapper is a synonym for the
adapter and not the proxy pattern; we use the term wrapper for consistency with
Spitznagel’s wrappers, which also implement the proxy pattern[9].

4
MiddlewareStubIface, and the two wrappers implement their methods by del-
egation. Software architects typically use wrappers to augment middleware with
LoggingTransformation EncryptionTransformation
<<wrapper>> <<wrapper>>
MiddlewareStub
MiddlewareStubIface
<<interface>>
Fig. 1. Adding functionality using wrappers.
new functionality, to suppress existing behaviors, or to mask faults.
While easy to implement, wrappers (and interception techniques generally)
suffer from two problems. First, components of the original system (that being
wrapped) may be “orphaned” when their behaviors are suppressed in favor of
behaviors introduced via interception and wrapping. Such orphans, even though
no longer actively contributing to the behavior of the system, remain in place
and continue to consume resources, both computational and spatial. Second, the
extra functionality may incur redundancies and inefficiencies that are unaccept-
able on the resource-constrained devices that are most often exposed to volatile
environments. In the case of wrappers, these redundancies owe to the treatment
of the service being wrapped as a black box whose internal resources (i.e., those
that might be reasonably reused by the extra functionality) are not accessible
to the wrapper. Interception-based techniques suffer a similar problem.
To overcome this obstacle requires the ability to reconfigure a base system
when augmenting it with extra functionality. The earliest work in this regard
uses static recomposition based on object-oriented frameworks, the most notable
of these being Schmidt’s ACE framework [16]. More recent work has investigated
the development of software modules that, when composed with a base system,
are able to reconfigure that system. Such compositions must be able to refine
existing components, including those hidden behind an opaque API, to support
extra-functional behaviors or replace them with components that do support
the desired behaviors. More recent work (C.f., [17, 18]) applies dynamic recom-
position to introduce reliability enhancements. In these cases, reflection and/or
meta-object protocols are used to reconfigure the original application to use the
components that best fit the environment at hand. Further still, such techniques
have also been combined with class loading technologies, in particular the JBoss
extensible middleware platform, to completely add and/or remove components
from a running system [19].
2.2 Connector Wrappers
The term connector refers to a mechanism for composing architectural compo-
nents [20]. Connectors abstract communication mechanisms and protocols, such

5
as procedure calls, remote procedure calls, pipes in a pipe-and-filter system, and
many of the communication services that are generally referred to as “middle-
ware”. More abstractly, a connector represents a pattern of interaction among
a set of components, called the roles of the connector. Allen and Garlan de-
veloped a formal model of connectors as stylized CSP specifications, thereby
enabling an architect to rigorously specify an architecture as the composition of
components and connectors and use formal analysis tools to reason about the
resulting behavior [2].
To facilitate reasoning in the presence of wrappers, Spitznagel and Garlan
developed a theory of connector wrappers, which are stylized CSP specifications
designed to compose with a connector specification to yield a new connector,
whose behaviors are an extension or restriction of the original [1]. Connector
wrappers are useful for specifying different strategies for implementing reliabil-
ity policies, such as retry and failover, in isolation without regard to the details of
a particular connector. The basic idea is to introduce (via parallel composition)
additional processes that synchronize with messages at the component–connector
interface to precisely model the behavior of the aforementioned wrapper mod-
ules. Because connector wrappers faithfully model the structure and behavior of
wrappers, an architect may specify a new connector as the composition of one
or more connector wrappers with some connector and then semi-automatically
generate a conforming implementation. Spitznagel’s system provides generation
tools that implement this capability.
Unfortunately, connector wrappers cannot yet utilize reconfiguration-based
mechanisms, which generally do not adhere to an algebraic model of composition.
The next section describes a model of composition that is algebraic in nature
and that supports fine-grained recomposition of the base system, allowing for
both reuse of abstractions and the avoidance of orphaned components.
2.3 AHEAD
AHEAD is an algebraic model of software composition in which complex, feature-
rich programs are synthesized from base programs by applying reusable refine-
ments [21]. Here, a base program is a collection of classes, and a refinement is a
collection of classes and/or class fragments, which can be applied to extend an
existing program with new functionality by using and/or refining the classes de-
fined by that program. AHEAD treats base programs and refinements as layers.
A base program is a stand-alone layer or constant (i.e., the layer contains no
class fragments) and a refinement is a parameterized layer (i.e., layer that must
“plug in” to another, subordinate layer).
The composition of AHEAD refinements and simple programs is depicted
visually using diagrams such as Figure 2(a). This figure illustrates the refine-
ment of a base program (const). Here, the inner-most boxes are classes or class
fragments. The solid rectangles demarcate refinements. The dotted lines from
one class to another indicate the refinement of a class with the code and data
in a class fragment; for example, b
const
is refined by b
f1
. Because const is the
bottom-most layer, it contains only classes and not class fragments.