Professional Documents
Culture Documents
AbstractA widely used approach to develop a Ser- resources (e.g., memory) until they nish the message
vice Provider (SP) in the Service Oriented Architec- exchanging. To overcome these problems the MOM is
ture (SOA), called contract-rst, consists of designing proposed. The MOM introduces asynchronous, loosely-
service contracts that will be used to generate the SP
source code. The goal of a service contract is expressing coupled, reliable, scalable, and secure communication be-
the features (e.g., services and capabilities) of the tween the SC and the SP.
required SP. The two most known traditional service A DP is an appropriate and proven design solution for a
contracts in the literature are: WSDL and WADL. specic problem in a certain context. Dierent SOA DPs
We identify that these service contracts suer from have been presented in the book of Erl [2]. In the practice,
several problems, such as they only allow expressing
a limited set of features. In order to overcome such it is frequent to use a compound DP to solve specic
problems, we propose a Feature Model (FM), named problems. A compound DP is a coarse-grained DP, who
F MSP , that can be considered as a service contract is composed of a set of ner-grained DPs [2].
for SP. The features of F MSP are designed to generate A widely used approach to develop a SP, called
valid, customized and fully functional SPs. A key point contract-rst [1], consists of designing service contracts
in our F MSP is that it relies on SOA Design Patterns
(DPs) to dene its features. The constraints expressed that include the features of the required SP. Afterwards,
between the DPs in our F MSP allow to easily developing these service contracts will be used to generate the source
valid compound DPs in the SP. Because DPs are proven code of the corresponding SP. The service contracts [2] are
solutions, then our F MSP will generate proven SPs as documents including meta information which often used to
well. We evaluate our F MSP through a practical case describe the features of the SP. The two most used SOA
study. The results show that the advantage of our F MSP
compared with the traditional service contracts is, it traditional service contracts in SOA are: WSDL for SOAP
permits to automatically generates valid, customized, and WADL for REST.
fully functional and based-DP SPs in a short time. Erl considers the contract-rst approach as a best
Index TermsService oriented architecture, service practice and classies the service contract as one of the
provider, software product line, feature model, design fundamental design principles in SOA [1]. By studying
pattern.
the traditional service contracts WSDL and WADL, we
identify that they suer from several problems, as fol-
I. Introduction
lows. First, the traditional service contracts are
The Service Oriented Architecture (SOA) is an archi- dependent of specic communication technologies.
tectural model that represents a widely used distributed For example, the WSDL only expresses the features of
computing platform [1]. It uses services as the essential SOAP and WADL only denes the features of REST.
means through which Service Providers (SPs) and Service The problem is that SP developers require to use dierent
Consumers (SCs) can communicate. In this paper, we syntaxes even to describe the same features (e.g., input
focus on the development of SPs. A SP can be developed and output data information). This can lead to misin-
with dierent features. We suppose that features can be terpretation and diculty to understand these contracts.
any types of functionalities like services, capabilities, com- Second, some communication technologies (e.g.,
munication technologies (e.g., SOAP, REST and MOM MOM) do not oer service contracts. In this case,
Middleware oriented Messaging), functional and non using the rst-contract approach to develop SPs cannot be
functional requirements, and Design Patterns (DPs). possible. Third, developing many separated service
The SOAP and REST rely on a synchronous communi- contracts can be needed to identify the dierent
cation for message exchanging. A synchronous communi- features oered by the SP. This decreases the gover-
cation can inhibit performance and compromise reliability nance of the SP and makes it dicult for SP developers to
as next. It needs that SP and SC must be available during identify these features. Fourth, they allow expressing a
the message exchanging. It imposes processing overhead limited set of features. For example, they do not express
because the SP and SC must wait and continue to consume the SOA DPs and compound DPs [2]. This prevents to
706
Service contract
[1,n]
Address Service
[1,n]
Service name Capability
OName IName
REST SOAP MOM State Stateful
OType IType messaging DP service DP
OData class IData class Get Put
name name 1.1 1.2 Reliable Atomic service Asynchronous Event driven
Post Delete
messaging DP transaction DP queue DP messaging DP
State Temporary
repository DP memory
Persistent delivery Acknowledgement Durable
Propositional constraints:
(MOM Output) (Atomic service transaction DP Acknowledgement)
Fig. 1: Feature model F MSP (readers of the electronic version can zoom in)
This makes dicult to know the existing valid compound only applied for the outgoing messages from the SP to the
DPs. SC [2].
Our F MSP permits to model the constraints between It is important to dene the features Acknowledgement
these eight DPs and their possible compositions, accord- and Atomic service transaction DP as mutually exclu-
ingly (see Fig. 1). This allows to facilitate nding and sive [2], [11]. We also dene the following propositional
developing these SOA DPs and their compositions. It constraint which it is required by MOM [11]: (MOM
also permits to separate the development of compound Output) (Atomic service transaction DP Acknowl-
DPs from that of the business logic of the SP. In other edgement).
words, it helps the SP developer to focus on developing By using the FAMILIAR tool [12], we identify, from the
the business logic of his/her SP. The compound DPs constraints between the eight DPs presented in F MSP ,
that he/she wants to use will be automatically generated that there are 108 valid compound DPs from 28 (256)
from the F MSP . Furthermore, our F MSP can be used possible ones.
as a documentation to learn the existing dependencies IV. Evaluation
and constraints between the DPs and compound DPs. In
In this section, we explore the use of our F MSP (see
order to concretely generate a SP, the SP developer only
Fig. 1) for developing valid, customized and fully func-
needs to derive an AMSP (e.g., see Fig. 3) from F MSP
tional SP. In this context, we consider the case study
(see Fig. 1) that includes the required SP features (e.g.,
of Emergency Response and Crisis Management Systems
the required compound DP). The constraints presented in
(ERCMS) [6] which is illustrated in Fig. 2. The ERCMS
F MSP ensure that all its possible AMSP are valid.
is a structured group of participants who communicating
through services to achieve a common mission (e.g. save
B. Design patterns constraints in F MSP
human lives and ght against huge res). Many partici-
We discuss here the constraints between the eight DPs pants are involved: a supervisor, managers, coordinators
expressed in F MSP . and investigators. All of these participants are SPs which
The feature Output in F MSP represents the two way can oer dierent features (see Table I).
communication between the SP and SC. If this feature The supervisor monitors the works of managers. Each
is omitted when deriving an AMSP , then then the result manager sends automatically and periodically its work
type of the capability is void and the communication type report to the supervisor. It also broadcasts the places of
is considered as in way, i.e., from the SC to SP. Otherwise, incidence to the coordinators. In this regard, a manager
the communication type is two way. should implement a MOM and congure it to support
The features Atomic service transaction DP, Reliable the Event-driven messaging DP in the oered capabilities
messaging DP, State messaging DP and Event driven for broadcasting. Also, it should make sure to store the
messaging DP require the selection of the feature Output. messages in a database for the coordinators if the latter
Thus, we dene requires constraints from them to the disconnect. We need also to implement a the Atomic
feature Output. The reason is that these features can be service transaction DP between these participants. An
707
TABLE I: Descriptions of the features of F MSP (see authentication process is also required for the coordinators
Fig. 1) to communicate with the managers. The objective of the
Feature name Description
coordinator consists in taking tasks and orders from the
managers and diusing them to its investigators. Each
Service contract Root feature
Address Address of the SP coordinator should implement a MOM which is congured
Service [1, n] Services of the SP as an asynchronous queue feature to send tasks to the ap-
Service name Service name propriate investigators. Also, it is necessary that each task
Capability [1, n] Capabilities of the SP
Capability name Capability name should be acknowledged (i.e., via ACK messages) by the
Input [0, n] Input data of a given capability manager as soon as the investigator gets it. Furthermore,
IName Input name of a given capability we must ensure that all the messages sent from the coor-
IType Input type of a given capability
IData class name Input data class name of a given capability dinators to the investigators (and vice-versa) are persisted
(e.g., Java class) to a database so they are not lost if these participants fail.
Output [0, n] Output data of a given capability Some capabilities of the managers require authentication
OName Output name of a given capability
OType Output type of a given capability and some others do not. The investigators must be SPs
OData class name Output data class name of a given capability to keep the coordinators updated about their situations.
Communication Communication technologies of capabilities Therefore, they implement capabilities using SOAP and
technology
REST REST communication technology REST which can be invoked without authentication.
Get HTTP get method for REST As illustrated in the introduction, the traditional ser-
Post HTTP post method for REST vice contracts (WSDL and WADL) suer from several
Put HTTP put method for REST
Delete HTTP delete method for REST problems in order to develop SPs, such as: they support
SOAP SOAP communication technology a limited features of SP and do not consider SOA DPs
1.1 SOAP version 1.1 [2] and compound DPs. Thus, these traditional service
1.2 SOAP version 1.2
MOM Middleware oriented messaging communica- contracts cannot implement the variability of the SPs of
tion technology the participants of the case study ERCMS (see Fig. 2). In
Event driven mes- Automatically sending the response messages order to overcome these problems, we propose deriving for
saging DP of the SP, when ready, to the corresponding
subscribers (i.e., SCs) in an asynchronous each SP an AMSP from our F MSP (see Fig. 1). We note
communication that our F MSP permits to implement all the variability
Durable It allows the publisher (i.e., the SP) to store of the case study ERCMS.
messages for the subscriber (i.e., SC) if the
latter disconnects. Upon reconnecting, the We present in Fig. 3 an example of a derived AMSP
subscriber will receive all these messages from our F MSP . This AMSP contains 30 SP features. The
from the SP address of this SP is http://localhost:8080/SP. This SP
Asynchronous Deploying an intermediary MOM allowing
queue DP SPs and SCs to asynchronously communicate includes a single service, named User, which is composed
and to independently process messages by of a single capability, named login. The signature of this
remaining temporally decoupled capability has a single input data, named id, with a
State messaging Delegating the storage of state data to the
DP outgoing messages of SP instead to its inter- String type and included in the class Session (e.g., Java
nal memory. class). It also has a single output data, named ok, with a
Direct authentica- Requiring that SCs provide authentication Boolean type and included in the class Session. The goal
tion DP credentials (username and password) to in-
voke capabilities. of this capability is to enable a user to login to his/her
Atomic service Treating a group of exchanging messages be- account.
transaction DP tween the SP and SC as a single work unit. This capability implements a compound DP that is
The latter is wrapped in a transaction with
a rollback feature that resets all actions and composed of the eight DPs discussed in Table I (e.g., Event
changes if exchanging messages fail driven messaging DP). In fact, the constraints presented
Reliable messaging Adding a reliability mechanism between the in F MSP only allows to derive valid compound DPs from
DP SP and SC to ensure message delivery. In this
context, we rely on acknowledging messages these eight DPs (see Fig 1). For example, if the feature
and on persisting messages in a data store State repository DP is selected, then the feature Stateful
Persistent delivery Persists the received messages so they are service DP must be selected because the former feature is
not lost if the MOM fails. Therefore, we
ensure that the messages are delivered to the the child of the latter feature.
receiver (i.e., SC). We developed a tool [13], [14], that allows to generate
Acknowledgement Acknowledges the senders SP about the re- the source code of the corresponding SPs of a given
ceived messages
State repository Deferring storing state data from a tempo- AMSP derived from F MSP (see Fig. 1). Our tool is based
DP rary memory to a state repository essentially on Java EE technologies and the FAMILIAR
Temporary Storing and managing the state data in a [12] tool. We propose that the generated SP is based on
memory temporary memory
Service state It gathers techniques that handle the state the Enterprise Service Bus (ESB) Switchyard 2 [15].
data of capabilities in the SP From the AMSP which is illustrated in Fig. 3, our
Stateful service DP Managing and storing state data by inten- tool succeed to automatically generate a valid and fully
tionally stateful utility services
functional SP that is composed of approximately 400 Java
708
Supervisor
Managers
Plane Walker
coordinator Robot Fireman coordinator
coordinator coordinator
Service contract
Address Service
IName OName
IType OType REST SOAP MOM State Stateful
messaging DP service DP
IData class OData class
name name
Get Atomic service
1.2 Reliable Asynchronous Event driven
messaging DP transaction DP queue DP messaging DP
State repository
DP
Persistent delivery
Fig. 3: Application model AMSP (readers of the electronic version can zoom in)
line code and ve XMLs. The latter permit to congure expert engineer can require approximately 30 minutes to
SOAP and MOM technologies and to congure the ESB develop this SP and needs many manual interventions.
Switchyard 2. The time required to generate this SP is In order to validate the correctness of our F MSP ,
several seconds. Using the traditional service contracts, an including the correctness of the possible 108 compound
709
DPS, we generate all the possible SPs from all the possible DPs and their existing constraints. This allows to easily
AMs of F MSP . The results show that the generated SPs generate the possible valid compound DPs between these
are completely valid and no errors have appeared. DPs. From our F MSP , we have identied that there are
108 valid compound DPs from 28 (256) possible ones.
V. Related work We have demonstrated through a practical case study
Wada et al. [8] propose a model-driven development and based on a developed tool, that our F MSP only
framework to model several constraints and dependencies generates valid, customized and fully functional SPs in
between non-functional aspects of the SP. In this context, several seconds.
the authors elaborate an FM that expresses the variability For future research, we plan to extend our F MSP by
of these aspects. Their FM can be used to extend our other features, including other DPs, in order to generate
F MSP (see Fig. 1) in order to express more the variability more complete and complex SPs.
of non-functional aspects of SP. In contrast, our F MSP
References
permits to generate fully functional SPs and consider DPs
and compound DPs. [1] T. Erl, SOA Principles of Service Design. Prentice Hall, 2007.
[2] , SOA Design Patterns. Prentice Hall, 2009.
Ed-douibi et al. [9] propose a based-MDE approach, [3] K. Czarnecki, S. Helsen, and E. Ulrich, Staged conguration
called EMF-REST, that takes EMF data models as input through specialization and multilevel conguration of feature
to generate their corresponding REST services. In our models, Software Process: Improvement and Practice, vol. 10,
no. 2, pp. 143169, 2005.
work, we propose F MSP to model the features of REST. [4] K. Pohl, G. Bckle, and F. Van Der Linden, Software Product
Their approach supports generating more REST features Line Engineering. Springer, 2005.
(e.g., security features) than ours. In contrast, our F MSP [5] C. Parra and D. Joya, SPLIT: an automated approach for en-
terprise product line adoption through SOA, Internet Services
permits to generate services with dierent communication and Information Security, vol. 5, no. 1, 2015.
technologies (SOAP, REST and MOM) and consider SOA [6] A. Kamoun, M. Hadj Kacem, and A. Hadj Kacem, Feature
DPs and compound DPs. model for modeling compound SOA design patterns, in Pro-
ceedings of the 11th ACS/IEEE International Conference on
The approach proposed by Kajsa and Nvrat [16] uses Computer Systems and Applications (AICCSA2014), Doha,
SPL techniques to handle variability in DPs. The goal is Qatar, Nov. 2014, pp. 381388.
to support the instantiation and the evolution which occur [7] M. Fantinato, D. M. B. Felgar, and D. I. Maria, WS-contract
establishment with QOS: an approach based on feature mod-
to the DPs. This work helps to generate the source code eling, Cooperative Information Systems, vol. 17, no. 03, pp.
of a specic DP in the desired location in the code via 373407, 2008.
annotations and FMs. The advantage of our F MSP is that [8] H. Wada, J. Suzuki, and K. Oba, A feature modeling support
for non-functional constraints in service oriented architecture,
it allows to generate the source code of DPs and also of in Proceedings of the 4th IEEE International Conference on
compound DPs. Services Computing (SCC2007), Salt Lake City, Utah, USA,
Street Fant et al. [17] introduce a pattern-based model- Jul. 2007, pp. 187195.
[9] H. Ed-douibi, J. L. C. Izquierdo, A. Gmez, M. Tisi, and
ing approach for SPL engineering using extended UML J. Cabot, EMF-REST: generation of RESTful APIs from mod-
models. The authors elaborate a FM that gathers the els, in Proceedings of the 31st Annual ACM Symposium on
components of a set of variable distributed real-time and Applied Computing (SAC2016), Pisa, Italy, 2016, pp. 1446
1453.
embedded architectural DPs. They elaborate a collabora- [10] K. C. Kang and H. Lee, Systems and Software Variability
tion diagram, a interaction diagram, a component diagram Management: Concepts, Tools and Experiences. Springer,
and a state machine diagram for each DP to identify its 2013, ch. 2: Variability Modeling, pp. 2542.
[11] P. Giacomelli, HornetQ Messaging Developers Guide. Packt
variability and to specify its behavior. Then, they create a Publishing, 2012.
mapping between their FM and these diagrams. Therefore, [12] M. Acher, P. Collet, P. Lahire, and R. B. France, FAMILIAR: a
it would be possible to generate specic UML diagrams for domain-specic language for large scale management of feature
models, Science of Computer Programming, vol. 78, no. 6, pp.
each application. In our work, we focus on generating valid 657681, 2013.
code of the SP DPs rather than generating their designs. [13] MSPL4SOA tool, https://mspl4soa.github.io.
[14] A. Kamoun, M. Hadj Kacem, and A. Hadj Kacem, Multi-
VI. Conclusion ple software product lines for software oriented architecture,
in Proceedings of the 25th IEEE International Conference on
The service contract is one of the fundamental design Enabling Technologies: Infrastructure for Collaborative Enter-
principles in the Service Oriented Architecture (SOA) to prises (WETICE2016), Paris, France, Jun. 2016, pp. 5661.
[15] Switchyard tool, http://switchyard.jboss.org.
develop a Service Provider (SP). We have identied that [16] P. Kajsa and P. Nvrat, Design pattern support based on the
traditional service contracts (WSDL and WADL) suer source code annotations and feature models, in Proceedings of
from several problems like, they work only for specic the 38th International Conference on Current Trends in The-
ory and Practice of Computer Science on SOFtware SEMinar
communication technologies (SOAP and REST). In order (SOFSEM2012), pindlerv Mln, Czech Republic, Jan. 2012,
to solve such problems, we have introduced, in this paper, pp. 467478.
a Feature Model (FM), named F MSP , that can be consid- [17] H. Gomaa, J. Street Fant, and R. G Pettit IV, A pattern-
based modeling approach for software product line engineering,
ered as a generic service contract that permits to generate in Proceedings of the 46th Hawaii International Conference on
valid, customized and fully functional SPs. An important System Sciences (HICSS2013), Maui, Hawaii, USA, Jan 2013,
advantage of our F MSP is that it integrates eight SOA pp. 49854994.
710