Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 8

PAPER PRESENTATION

ON

DESIGN PATTERNS FOR DEVELOPMENT OF DYNAMIC


DISTRIBUTED AUTOMATION SYSTEMS

modern systems is about 70% of overall


cost of the system [1]. Obviously, cost
ABSTRACT reductions as well as design formalization
are important issues during development
Object-oriented analysis and design of
of industrial control systems.
automation and control systems is
discussed from the formalizing of the
development process viewpoint. The
presented results are based on a design
example of software part of a context-
The key idea of this paper is to present
aware automation system operating in a
the ways of improving quality of a design
dynamic environment.
procedure and increasing reusability of
industrial control system components by
means of applying design patterns for
INTRODUCTION
development of a system software
architecture, i.e. removing of ad-hoc from
Nowadays, development of automation
development procedure. The presentation
control systems is performed by applying
is based on an example of development of
of very specific ad-hoc solutions according
components of a context-aware [2] system
to particular needs of an enterprise. As a
in dynamic environment. This type of
result, it is difficult to reuse components of
systems is taken as an example, because
an existing system in new ones, increase
many modern control systems are
scalability, reconfigure due to ad-hoc
distributed computing systems [3] that
development process. The cost of software
operate in dynamic, nonstationary
part that contains all the functionality of
environments. Mobile entities with “A pattern is a named problem/solution
wireless data connection capabilities are pair that can be applied in new contexts,
components of such systems. As a with advice on how to apply it in novel
particular example, we may have a system situations and discussions of its trade-offs”
with a number of mobile vehicles that are [4]. Practically, a pattern is an idiomatic,
performing an activity in a technological stable and proven solution to a certain
process within an enterprise. They are typical problem. One of the most
adapting their behavior according to a important features of a pattern is that it can
current context of environment. There are be reused in a many different fields many
many types of contexts [2], but in our case times. The patterns provide formalization
we are considering such context and remove an ad-hoc from the
information as position of the mobile development process. It is much more
entity inside a building, its identity, and desirable to use design patterns that are
availability of different services around an proven solutions than to make the design
entity (client). of the system from scratch and “invent the
wheel” every time. Several patterns are
There are challenges in dynamic presented below.
distributed systems such as heterogeneity,
scalability etc. that are addressed in [3]. • Information Expert
Dynamics and mobility provides other In complex software systems there can be
challenges such as unexpected quite a lot of different responsibilities that
disconnections of a client or a server in the actually are derived from requirement
systems, due to low reliability of wireless specification. The responsibilities must be
channels in comparison to wired ones; distributed between possibly hundreds of
dynamic reconfiguration etc. An objects. The main idea of the Information
introduction to design patterns is in Expert pattern is to assign responsibility to
Section 2. An example of applying design such an object that has enough information
patterns for developing of a dynamic to fulfill the requirements of the
distributed system is presented in Section responsibility. In other words “the objects
3 of the paper. do things related to the information they
have” [4]. The information in the systems
usually is spread across many objects. In
DESIGN PATTERNS
order to fulfill the responsibility
requirements objects need to collaborate. overloaded with responsibilities from
Sometimes the design that is obtained different domains. To prevent these
from this pattern is not really desirable problems the High Cohesion design
because of tight coupling and overloading pattern is proposed. “In terms of object
of the objects with responsibilities. There design, cohesion is a measure of how
should be additional criteria to evaluate the strongly related and focused the
design quality. The Low Coupling and responsibilities of an element are” [4].
High Cohesion patterns are such criteria. High Cohesion and Low Coupling are
They are also presented below. ideas that a designer has to keep in mind
during all of the work to evaluate the
• Low coupling design solutions.
In the object-oriented systems the most
important concepts are reusability, low
dependency, and low change influence. • Indirection
The design of the system must satisfy There are many situations in the object
these principles. The Low Coupling design where we do not want to make a
GRASP pattern offers to assign direct coupling between two objects. The
responsibility in such a way that coupling Low Coupling and the High Cohesion
between objects remains low. “Coupling principles usually motivate it. The
is a measure of how strongly one element Indirection GRASP pattern [4] suggests
is connected to, has knowledge of, or relies assigning some responsibilities to an
on other elements” [4]. As it was intermediate object that will provide
mentioned earlier the Low Coupling decoupling and mediation between those
pattern is an evaluating principle that is two. The Indirections pattern intends to
used by a designer to choose the design raise the reusability of the objects.
decision.
• Factory object
• High cohesion Let us assume that we have many objects
A serious problem of object design is to of the same type in our system. A few
keep the complexities of objects problems arise in such a case. First, who
manageable. Otherwise we get objects that creates these objects, and second, who is
are hard to maintain, and not convenient to going to manage them in the system? Also,
reuse. In practice, objects can be quite the creating logic can be very complex.
According to the Factory Object pattern components have to be wrapped by a new
[5] there should be a “factory” that is interface.
responsible for creating and managing of
all of these objects. The idea of this design • Façade
principle is supported by High Cohesion The Façade Design pattern [5] is inherited
and Low Coupling patterns. Factory from Protected Variations pattern. An idea
Object pattern has a few advantages: a task of the pattern is to create a façade for the
of creation is assigned to cohesive object; subsystem. This façade hides all the
a potential complexity of the creation is implementation details of the subsystem. It
hidden inside a factory; there are is responsible for handling all external
possibilities to provide centralized inputs from other subsystems of user of the
management of objects in the memory. system. Practically the façade object does
not perform any actions but rather
• Protected variations redirects the calls to the appropriate
Every system consists of the set of components of the subsystem to execute
components or subsystems. These the operation. This pattern removes
components must have a stable interface undesired direct coupling with other
that is used to communicate and component of the system.
collaborate with other components. In such
systems the stability of interfaces is very • Layer
important, since even minor changes can The following problems may emerge
cause an undesired influence to other parts during the development: high coupling of
of the system. The Protected Variations many parts of the system; the user
pattern [4] is one of the GRASP patterns interface level logic interfering with the
provided by Craig Larman. It presents an domain application logic; coupling
approach to solving the problem of between low-level technical services and
instability of the component’s interface in the domain application logic; difficulties in
the system. The solution consists of two splitting overall work between different
parts: to investigate the components of a developers of the system; mixture of
system, and identify the components with different areas of concern. These problems
possibility of instability; then a designer of are very common. The Layer Pattern
a system has to create a stable interface provides the solution: “Organize the large-
around these unstable objects. In this case scale logical structure of a system into
discrete layers of distinct, related Overall structure of the systems is
responsibilities, with a clean, cohesive decomposed to a number of components:
separation of concerns such that the Positioning Service – responsible for
“lower” layers are low-level and general providing coordinates of a mobile client
services, and the higher layers are more inside a building; Activating Service – for
application specific. Collaboration and activating different devices that are close
coupling is from higher layer to lower to the client; Map Service – for providing
layers; lower-to-higher layer coupling is context map data to the mobile client
avoided.” [4]. Nowadays, this approach is according to coordinates; Registry Service
widely applied in developing of computer- – responsible for keeping references and
based systems. It dramatically increases other data about other value-added
maintainability and scalability of the services; Clearing System – responsible
system. for control of access and logging of device
(services) activation. The structure is
DESIGN OF THE presented in Figure 1.
CONTEXT-AWARE
DISTRIBUTED
AUTOMATION SYSTEM

Ref to RegServ
4
Mobile Client 3 Naming Service
Request

1
Ref to the ServRequest
Registration
5

Registry Service Clearing System


6

2
Registration
Device n

Positioning Activating Activate


Map Service
Service Service
Device 1

Figure 1. The structure of the system


the Registry Service, but not hundreds of
same type objects for each client.
DESIGN OF THE
POSITIONING SERVICE By using this pattern and some
features of CORBA technology, we can
The Positioning Service’s aim is to partially solve the problem of unexpected
provide a local physical coordinates of the disconnections. A mobile client can
mobile entity in a building. From the suddenly loose the connection to the
architectural point of view, the service is server. The status of the object that is
implemented by applying client-server dedicated for the client has to remain in
memory, because client should not lose the
results of the interactions with the server in
architecture. Service is implemented as case of disconnection. The factory object
a CORBA Server. The Positioning Service design pattern provides an idea for
is responsible for handling requests from a realization a dedicated object and the
number of mobile clients. The amount of implementation of the object with CORBA
clients can grow very fast. A special middleware provides statefullness to the
design approach has to be used to provide object. This approach does not allow
scalability and maintainability for the performing any actions off-line, but the
system. The Factory Object pattern is client can just reconnect to the server with
applied in the prototype application. The the same identification name and continue
Factory Object design pattern is a working with the server functionality from
paradigm where one factory object is the status that was before the
creating other objects dynamically on disconnection.
demand. When the factory object is
created and registered in the naming
directory it can handle requests for POSITIONING
creating and managing other objects of the
TECHNIQUES
same type. The CORBA server needs to
An important issue of the
keep only several objects in memory at the
Positioning Service is how to receive
same time. The client can ask server
physical coordinates of the mobile client.
(factory object) to load specified object on
There are many techniques to obtain
demand or to create a new object. Only the
coordinates inside and outside a building.
Factory Positioning Object is registered in
Positioning techniques are [6]: Outdoor Service as for the Positioning Service in
GPS system; Outdoor GSM; Indoor GPS; order to solve the scalability problem.
Infrared based; RFID tags and Smart Additionally, according to Low Coupling
Cards; Bluetooth [7], Capacitive sensors and High Cohesion design patterns the
[8], Ultra sound sensors. Due to the client-dedicated object is designed as
aspects of availability and maturity of the Façade object. It does not execute the
technologies we decided to make software interface methods but rather redirects the
emulation of the positioning system before requests to the object for device activation
the actual indoor positioning system will and to the Clearing System for obtaining
be available. the information about devices and
checking the ability of the client to activate
The services software is designed it. This approach increases reusability of
in such a way that it does not dependent on the software components of the Activating
a particular position location technology. Service.
The Protected Variations pattern is applied DESIGN OF THE REGISTRY
for providing possibilities to plug-in SERVICE
There may be a server side dynamics
different positioning location techniques
in a mobile environment if services are
without affecting the rest of the service
launched on mobile entities. Due to
parts.
server’s movement, availability of them

DESIGN OF THE ACTIVATING has to be controlled, in order to avoid a


case when a client is trying to connect to a
SERVICE
server that is no longer accessible.
The Activating Service is a Application of Leasing design pattern for
component of the system that provides the the Registry Service solves this problem.
possibility to activate different devices and “The leasing pattern simplifies resource
services inside a building. The system has management by specifying how resource
to make authentication and authorization users can get access to a resource from a
of a mobile client. The Clearing System is resource provider for a pre-defined period
responsible to check the ability of the of time” [8]. The idea is that all services
client to perform any actions with devices. after registration in the Registry Service
The service architecture is of a client- obtain a leasing period of their availability.
server type. The same Factory Object That period has to be prolonged
pattern is applied for the Activating constantly; otherwise the Registry Service
removes a record about the service from its
database. As a result, clients would not
obtain a reference to non-existing services.

CONCLUSIONS
Design of automation and control
systems is discussed from the formalizing
of the development process point of view.
The presented results are based on an
example of designing of software part of a
context-aware system operating in a
dynamic environment. Solutions to many
challenges of dynamic distributed systems
are presented. Usefulness of the applied
approach is proved during the
development of the prototype system. The
future work is related to applying
emergent information technologies and
design principles for improving quality of
control and automation systems.

You might also like