Professional Documents
Culture Documents
199
family is such that introducing abstractions that would designed and implemented completely. When different
allow treating variant programs uniformly would not fi,mctionality is needed, the implementation of the frost
simplify the design but would only unnecessarily constrain variant is modified where necessary to match the new
the implementation. This happens when products in a requirements, either by using conditional compilation or by
family exhibit ad hoc variation of features. creating new variant program files. The fwst variant serves
as a prototype that always is modified fwst in case of
For example, a company that starts to produce GSM mobile
improvements bug f~es. The changes are then
or
phones should pay attention to other TDMA standards such
propagated manually to other variants in the family.
as DECT, PDC (used in Japan), and IS-54 TDMA (in
USA). If the developers can structure the software so that In this case, all variants in the product family have the
the standard-specific parts are separate from the standard- same documented design. In general, we use the term
independent parts, and can introduce protocol abstractions implementation configuration when there is only one
to treat uniformly the standard-specific parts, then much design for all products in the family that does not reflect the
effort can be saved later when the company starts to differences between products. Such a design maybe
variant
produce phones for the other TDMA standards. relatively simple. However, when variance constitutes a
major source of complexity in product development, a
However, a company that was producing mobile telephones
design that does not reflect the variance does not serve the
for analog standards (AMPS or NMT) before the
main pwpose of design: it does not manage complexity. As
emergence of digital mobile communication could not have
the number of products in the family grows, managing
predicted the effect of digital standards on the structure of
variation through configuration of implementation becomes
the software. This is an example of ad hoc variation on
very complex.
large scale. Ad hoc variation is often present on a freer
scale as well. For example, application-specific integrated Implementation configuration is often done using source
circuits (ASICS) of similar fimctionality may have very code conjlguration management. This requires that
different interfaces. If the members of the product family variance is mapped to different variants of the source files.
use different ASICS, the software must adapt to this However, when variance is on a smaller scale than files,
variability. this leads to a mismatch between the granularity of
variance and the granularity of configuration management
Attempts to deal with ad hoc variation of features using
as we will show in an example.
abstractions that allow treating variants uniformly lead to
unnecessarily complex designs and inefficient Source file preprocessing achieves freer granularity of
implementations. On the other hand, program text variance. Most programmingg systems today contain
cor@uration avoids artificially abstracting unstructured or preprocessing facilities that allow conditional compilation
unpredictable variation but fails to utilize design as a tool and macro definitions, When software implementation is
for managing complexity. In this paper we argue that ad shared by several products that require non-trivial variation
hoc feature variation in a product family is best addressed of features, configuring the implementation to match the
by configuring designs. This is similar to program text features accounts for much of the implementation
cotilguration but is applied to software designs. complexity. The mapping between the elements of product
variability onto the elements of software implementation
In the remainder of the paper, we will fmt discuss the
variability may be very complex. This leads to two types of
methods that are used to manage variance in product
problems:
families, with examples. We start with the most common
method, implementation configuration, which relies on a 1. Product contlgumtion for delivery requires thorough
single design and deals with variance on the knowledge of the implementation.
implementation level. We will then cover customization
2. Information is replicated and non-local dependencies
and modularization, which both attempt to model variance.
exist in the implementation.
The shortcomings of these methods to manage certain types
of variance motivates the need for another mechanism to We demonstrate some of the problems associated with
manage variance that cannot easily be modeled. Finally we using implementation configuration for achieving feature
present our ideas for a solution based on configuring variation and code reuse in the second example of this
desi~s. section.
IMPLEMENTATION CONFIGT-JR4TION Configuration at the tile level
Program text manipulation through conditional compilation The fmt example is about implementing tie
and source code configuration management is the most communication protocols that a telephone switch must
common way to achieve sharing and reuse of software support. The protocols are usually standardized but in
between different products. Product families are often many cases there are national or customer specific
created so that one variant in the product family is fust variations. For instance, the message parameters (fields)
200
can have slightly different semantics. The implementation Finally, since preprocessing does not follow the semantics
of the protocol must receive different messages and of the programming language, the compiler parameters
intexpret the contents of the fields in the messages. It must cannot be tested independently of each other.
also check that the values in the fields are valid. The
‘ROCEDURE pack_ setup (
protocol implementation works also in the opposite IN/OUT ccsr_data sr internal_data,
direction: it must pack information to the fields in the IN/OUT opt~art op~ional>art,
;
messages and send them outside of the switching center. }ECLARE
if (sub)
The variance in the messages fields could be managed by facility_info facility_used_info,
implementing message unpacking and packing with two endif
if (uUs)
procedures for each field me. Each pacldunpack utu_segments utu_segments,
procedure pair might occupy a single source file. The endif
variance in a field can be managed by making variants send_facility bool;
IEGIN
from the source file that contains the pacldunpack ..
procedures for that field. Thus the source files can be if (m7)
else
managed by a conventional version control system. TASK memset (
@facility_info,
The representation of different types of values in the o,
message fields can be quite complicated. Often there are SIZEOF(facility_used_info)
);
many semantic constraints on the allowable values that the TASK memset (
implementation must check. The packing and unpacking @facility_info.subaddress_a,
procedures can be as much as 500 lines of code together. OXFF,
SIZEOF ( subadcixess
)
This approach would work well when the procedures are );
TASK memset (
very different from each other. However often the unit of @facility_info.subaddress_b,
variance is much smaller than a source file containing tsvo OXFF.
SIZEOF(subaddress)
procedures. Thus there would be a severe mismatch in the ):
granularity of variance management and the actual endif
if (tran)
variance.
CALL pack_transit (optJart) ;
else
Configuration by preprocessing ,endif
The example in Figure 1 is adapted from a real product. It CALL pack_lowlayer_comp (optflart)
shows part of a program to fill the fields in the ‘setup’ CALL
Jack highlayer comp (opt_part);
message of the Signaling System 7 protocol (see [6]), the if Tuus) –
trunk line signaling that the switching centers use to DECISION ccsr_data.cl .utu_exist;
(T):
communicate with each other. There are ten national CALL pack_utu (
variants of the SS7 signaling protocol that the switch must opt_part,
utu_segments
handle. In this example some of the SS7 fimctionality that
);
is present in some variants is made optional by using ENDDECISION;
conditional compilation. Ielse
Iendif
The pro -g RETURN;
l~~ge in this ex~Ple IS UI :NDPROCEDURE pack_setup;
executable variant of SDL, the IEEE standard System
Deftition Language (see [3]), The procedural parts of the Figure 1: Configuration of source code by preprocessing
language are similar to Ada, Pascal or Modula-2.
Nevertheless, there is an important use for this kind of low
There are three compiler flags for different optional level management of variability: software products that
properties of SS7 signaling and one flag that is used to must be able to compile and link in many different
adapt the procedure to different system environments (m7 ). programming environments. These products must be for
The flags are sub for subaddressing in the network, uus example aware of defects and restrictions in certain
for user-to-user signaling and t ran for transit facility. compilers and environments. This kind of variance is really
Note how the uus flag is used in many places. variance at the program text level, which is exactly what
This kind of conjuration makes it very hard to recognize pre-processing is designed to do.
and understand the different dependencies in the program. CUSTOMIZATION AND MODULARIZATION
The code becomes difticult to read and this complicates Managing family variance by customization means that all
desktop tests and code reviews. In unit testing, the module variants are supported by one “universal” product that may
must be compiled with all possible compiler flag be a&pted by the maker or by the customer to behave as
combinations to make sure that it behaves as specified.
201
any specific variant. Hence customization enables one to have to select among them. A telephone call may be
change product capabilities, supported features, and modes characterized by a number of attributes that are used to
of operation. All possible components must be present in select a possible route, such as whether the call is a voice or
the delivered produce but the active set of components is a data call, and the type of signaling required by the calling
selected by customization procedures. The relationships party.
between the various components are fued and thus the
The switch maintains an array of destination records to
design is static. There is one design and one
implement call routing fimctionality. The destination
implementation that is customized to achieve variation in
records list operator-selected routes to the destination. Each
its features and capabilities.
route may be characterized by a number of attributes, such
Customization is often used because software engineers are as congestion, availability, and bandwidth.
trained to design a single product rather than a family of
The attributes of the call and the attributes of the routes are
products. Also most design methods only address the
used to make the routing decision. For example, for calls
design of a single product. In some ways managing family with a minimum bandwidth requirement, such as data calls,
variance by customization also makes the maintenance of
the routes will be rated based on the their bandwidth
the family simpler, as there is only one design, one
attribute. Also, since satellite links are slow, a voice call
implementation, and one package to ship to the customers.
must be routed so that it uses at most one satellite link.
This also offers the best possibilities for reuse of common
fi,mctionality in different variants as these are localized to In a telephone network, the range of variation in the
the same product. However, in practice the design and capabilities of call routing subsystem is relatively well
implementation of the customizable product can be known. A customizable product implements all possible
significantly more complex and costly than that of variants and provides the user a customization interface to
individual variants. Customizable software incurs “soflware select the active subset. For example, there could be four
manufacturing costs” by increasing required hardware different route selection algorithms that the operator can
resources. select from. Each destination record would indicate which
algorithm is used with this destination. The operator uses a
When variance in the application domain is predictable, it
management interface to customize the routing subsystem
can also be modeled on the design level [9]. The reuse
by changing the information in the destination records.
aspect of family development can be addressed by
designing reusable components and domain specific
cd Selector
frameworks. While each variant has its own design, many
components in their designs can be shared between C#lalmMtes
Designing and developing a family architecture and generic Let us consider the diagram in Figure 2. It provides
components that may be shared by different products m a customization of the selection algorithm: all algorithms are
ftily is a complex task. Furthermore, such product always present and the operator can select any of them to
implementations often require more run-time resources be specified in a destination record.
than simpler implementations of variant products.
The classes are Call, Router, Selector subclasses for
Example of customization and modularization different selection policies and a Destination record class.
Let us consider an example based on the number analysis The class Selector is a generalization of the classes Choose
and route selection that a telephone switch must perform. fmt and Choose randomly. This is indicated by the arrow
When a telephone user attempts to make a call, he or she with a hollow head. The other arrows indicate navigability:
dials digits that the telephone switch analyzes to determine an object at the other end of the arrow knows about the
the destination of the call. Since some destinations maybe object being pointed at and can thus use it to provide
reached through several alternative routes, the switch will
202
services. (We used the Unified Modeling Language [2] handled by the designs, the complexity of the
notation.) implementation led to serious problems in controlling the
evolution of these product families. Also, the level of reuse
A router object will look at a destination record table to
in these systems was very low which lead to high
fmd out the appropriate selector object for this destination.
development and maintenance costs.
Then it will ask the selector object to get a possible route
for the call and destination pair. The selector object will use In some cases the situation could be improved by modular
the attributes of the call and the attributes of the routes designs and customizable parts, using the common
from the destination record table. Different selectors mechanisms of indirection, deferred binding,
implement different selection policies and use different parametrization, higher order abstractions. This would
and
attributes to do that. improve reuse and simpli~ implementation. However, the
cost of design would grow and, in many cases,
A design of a customizable call routing system would
implementation would be less efficient. Often this is not
include all the different attributes needed to cover the
acceptable.
variability. Many components in the system depend on the
attributes. The different selector objects all use the When feature variation between variant products is not
attributes differently. To add a selection policy that uses a systematic and cannot be predicted, or when
new attribute, the call or destination record class will have implementation must be optimized to minimize the use of
to be changed. There is no way to extend the behavior of hardware resources, a different approach is needed.
the selectors incrementally because there are no
We investigate a technique based on overlay designs. The
abstractions on the attributes.
idea may be illustrated with a metaphor of overhead
A customizable system has been designed to manage transparencies that may be stacked to create a composite
certain variance using an adaptation mechanism, but it does image. Suppose you want to use a number of slides that are
not manage all the variance in the application domain. In similar in most parts and only differ in details. One way is
the example, the customizable feature is the route selection to create the fwst slide completely and then copy and
policy, and it would be difficult to make any other changes. modi~ its contents. This is fme as long as no changes need
to be made later in the shared part of the slides. This is
To make the example more modular, we model the
rarely the case. A better approach would be to create the
variance in the call and destination attributes. We can
shared part on one (master) transparency and use additional
create new classes for call attributes and route attributes,
overlay transparencies to show the variations.
and parametrize the selector destination records and call
objects by attribute types. This makes the call class into a The main idea of overlay design is to have a specific design
second-order concept, a parametrized class. To do that, we for each variant without having to consider family
needed to abstract the notion of a call attribute. If we did variation. The designs of variant products are compared for
not already have such a concept, creating the second-order common and different parts. The common part is separated
class would have been much harder. as a shared overlay and the different parts are kept as
variant overlays. A complete design for a variant product is
Creating abstractions allowed us to localize all predictable
thus a simple combination of several overlays. This way we
variation in the example to design elements. Using
achieve design reuse without introducing unnecessary
customization to implement attribute variation would have
complexity associated with reconciling and abstracting
led to a very large and slow implementation, while using
differences between variants. Also the implementation is
source configuration would have left the variability to the
kept efficient because there is no need to implement
implementation. Modular design models all known
generic mechanisms. This is illustrated in Figure 3.
variation; customization models only the variation which is
visible in the product. At the same time, modularization
complicated the design by creating new high-level
abstractions. In many real-life cases the variance is ad hoc
and there are no models for it. In those cases
modulariz.ation is either impossible or at least more
difficult.
DESIGN CONFIGURATION
In several ftilies of soflsvare-intensive
products that we
have studied source-code configuration was the main
method to achieve variation of features. This was not
adequate in a number of cases where support for variation
was a major source of complexity. Since variation was not
Figure 3: Keeping design simple and implementation eficient
203
Design overlays call set-up part of the protocols, and we have dropped time-
In the following example, we consider the design of a outs from them.
telephone switch implementing different call control
Creating Design Overlays
protocols. Call control connects the telephone calls going
We now present the design diagrams of the three call
through the switch. It incorporates variance that has
control protocols (Figure 4). Then we proceed to identi~
traditionally been very hard to manage, and consequently
the shared parts of the designs and generate design overlays
the different designs and implementations of call control
to illustrate the common and variant parts of the designs.
protocol have been separately developed and maintained.
The following are the three steps to create design overlays.
In the example we will consider the ISDN, GSM, and ATM
The fwst is mapping the design elements in the different
call control protocols (see [4], [5] and [1]). ISDN is
designs by identifying the common elements in the
relatively complicated because it allows the user to either
diagrams and renaming them consistently. This task
dial the whole number before sending it to the switch or to
requires some domain expertise because corresponding
dial the number digit by digit. The GSM protocol, in turn,
states and messages have dissimilar names in different
is complicated because it cannot trust the communication
protocols.
medium to be reliable. ‘l%e ATM protocol is the simplest
one because the dialers are assumed to be computers or at The second step is separation of the common elements
least rather intelligent telephones. ftom the original designs on a separate overlay. This yields
a kind of template for the designs of variant protocols. The
We use SDL state transition diagrams to depict the
variant parts in each protocol then make variant overlays.
protocols, as it is a standard design notation for
These are like instantiation parameters or cotilgurations for
telecommunication software. In the diagrams, the user
the design template.
(caller) is imagined to be on the left-hand side and the
connection network on the right-hand side. The protocols
are somewhat simplified: the diagrams will show only the
lam
204
—
I I I
I
,’=-”) ‘— I
—
—,
I !’—’ ‘ ‘4
‘-7--’
I_
Figure 5: ATM. GSM and ISDN Call Setup overlays mapping, separation and layout,
The third step is laying out the overlays so that the shared
overlay can accommodate any of the variant overlays. This
way we achieve the visual effect of stacked overhead
transparencies.
A variant design is produced by applying the corresponding
contlguration to the design template.
205
instantiation of the generic state diagram if the parameter Design overlays provide sharing in the designs of a product
slots of that path are empty. family. How can we achieve sharing also at the
design overlays
implementation level? Since the individual
There are several restrictions on the SDL fragments that
are neither complete nor generic designs, they cannot
can be used as instantiation parameters. For example: they
usually have sensible implementations.
must not contain any of the states of the template; they
must not begin with the reception of a message that is
already received at the same state in the template.
Etate Null
Note that a designer never needs to manipulate (or even ixlplat setup_ml@elst
output setup
see) the design template or contlgurations of design nertetatal call_initiEted
fragments. This is an example of a representation to be andatate Null
maintained by a tool supporting design contlguration. A state Call_initi.ated
input Call~zooaading
designer only works with complete designs of specific output Proceeding_indication
variants. A support tool might also automatically maintain nextstate Outgoiag_cal&Jr~
the restrictions of the design overlays. Naturally, variant input SETUP_ACKNOIW3!3fiSMENT
output More_infornation_indication
designs include the information on which parts of the nextstate Overlap sending
design are currently shared with other variants in the endetete Call_initiated
state Overlap_sending
filmily.
input CallJzooeeding
output !?roceedingdindication
nextstate Outgotig_cs&lyoewacMng
input Info_request
i
—.
c5 -) (C2) output INFOS14ATION
nextstate Overlqp_sending
endstate Overlap_sending
MN-x.
CU.WROC (NO
\
,
Stata outgoing_Ml~
input Connect
c
output Setup_confirm
nextetate Actiwa
\
1,
\,
MM.CUWECTK+4
PENONQ
1 hWCC-ALERT.lND t
/
input ALERTING
output Alerting indication
m
/’
nextstate Call del~vered
end state Outgo~ng_eall~roceecWvg
state Call_delivered
MNCC EST CW !
input Connect
output Setup_confirm
nextetata Active
endstate Call_delivered
atate Active
ends tate Active
206
input, which receives an event;output, which causes can create packages. By selecting different module
an eventand nexts t at e, which causesa statetransfer. instantiation and connecting them different y, one can
create a product family. However, this assumes that the
state Uull
input setup_raqlaaat parametrized modules and the parameters are chosen so
output MNCC-ll@t-REQ that the modules exhibit sufficient variation. This is not
nextstate MM-CO*ECTION-PENDING reasonable when the variance is ad hoc, as the number of
endatate Null
state MM-CONNECTION-PENDING parameters would grow too large. Configurable designs do
input MNCC.EST.CNF not assume that the variance can be parametrized.
ou~t Setaap
nextstate CaU_@itiated More abstractly, parametrized progr amming and related
endstate M4-CONl$ECTION-PENDING approaches deal with the high-level organization of
8** ceLl_iniUk4tad
input Call>rooaading software implementation. They attempt to explain how
output IWCC.CALL. PROC.IND module implementations are different in members of a
next8tate Outgohg_call~roceading
product family, while the approach of con@uring designs
input DI (ALERT)
output 13NCC.ALERT.IND tries to show how variants are different on the design level.
nextstate CALL-DELIVERED Parametrized programming enables one to modify the
input Connoct
output MNCC.SETUP.CNF
implementations in different products automatically, as
Ilextetate Aotive there is a direct link between implementation and modules.
endetata Call_initiatad Also, conformance checking could be automated. Since
state Outgoing-oall~rooe9ding
input connect
sotlsvare design is a description of implementation and not
output klNCC.SETUP.CNF a specification, it is possible to represent on the design
wt*tata Active level variation that is not intelligible in the implementation.
input DI(PROGRESS)
output MNCC.PROGRESS.IND This helps the system designers to understand the variance,
naxtstate Outgoing_call~xocaeding even if the changes to implementation still must be done
input D1(ALERT)
output NNCC.ALERT.lND
manually.
nextstate CALL-DELIVERED
endstate Outgoing_callJroceeding
Product-line architectures have lead to great savings with
state CALL-DELIVERED product families (see, for example, [IO] and [1 l]). The main
input Connect factor has been reusing components over a range of
output MNCC.SETUP.CNF
naxtstate Aotive
products, supported by a strong architecture that enables
endstate CALL-DELIVERED this. Configurable designs can be used even when variance
#tete Active cannot be explicitly modeled. Thus they can be used in a
andatate Active
product line for components that show some ad hoc
Figure 9: GSM implementation variance.
207
Design overlays is a simple and intuitive approach to the Cost in One-half the Time. In CrossTalk - The
design configuration that offers a way to manage families Journal of Defense Sofhvare Engineering, August 1996.
of designs for sharing and reuse of parts without increasing
11 Brownsword, L., Clements, P., and Olsson, P.
complexity unnecessarily. The implementations of
Successful Product Line Enginee~g: A Case Study.
complete designs of different variants that are generated or
Presented at Softiare Technology Conference, Salt
managed by combining overlay designs can be efficient as
Lake City, April 1996,
there is no overhead of generic mechanisms in the
implementation. 12. Batory, D., Tracz, W., Shafer, S., and Coglianese, L.
Representation Issues in Creating an Avionics Domain-
In practice, designers will need to utilize all available
Specific Software Architecture Domain Model. In
techniques of implementation conjuration, customization,
Proceedings of NAECON’94, May 24-27, 1994,
modularization and design configuration to achieve reuse
Dayton, Ohio pp 874-881,
with different types of variation in the same product family.
13, Goguen, J. Parameterized Progr arnming and Softsvare
Our plans for fiture include trying out design overlays with
Architecture, in Proceedings, Fourth International
other types of design diagrams. We will also investigate
Conference on Sofhvare Reuse, IEEE Computer
implementation strategies for product families managed by
Society, pages 2-11, April 1996 (keynote address).
design configuration and try to integrate several
mechanisms for achieving reuse and variation in a family.
Eventually, we plan to build tools to support management
of overlay designs and corresponding implementations.
ACKNOWLEDGMENTS
The authors wish to thank Juha Kuusela, Jianli Xu and
Alessandro Maccari for their valuable comments. The call
routing example is based on an unpublished paper by Philip
Ginzboorg.
REFERENCES
1. ATM User-Network Interface Specification Version
3.1. ATM Forurq September, 1994.
2. Booth, G., Rumbaugh, J., and Jacobson, I.. The Unified
Modeling Language for Object-Oriented Development.
Documentation Set 0.9 Addendq 2 July, 1996.
208
PANEL SESSIONS