Service-oriented architecture can dramatically help IT and others produce mobile applications to serve the life sciences industries and all others; we explore the role played by UI templates, service repsonse objects, loose coupling, and other app development tactics.
The Work Ahead in Intelligent Automation: Coping with Complexity in a Post-Pa...
Key Performance Considerations When Designing Mobile Applications Using SOA
1. • Cognizant 20-20 Insights
Key Performance Considerations When
Designing Mobile Applications Using SOA
A service-oriented architecture can enable IT to consistently create and
implement high-performance mobile apps that meet the just-in-time
business needs of professionals in life sciences, healthcare and beyond.
Executive Summary information is disseminated. From print media
to the Internet to mobile, ways of reaching
Access to enterprise information is increasing-
consumers are continuously evolving. The first
ly through mobile channels. Existing informa-
shift from print media to the Internet created
tion assets are typically being exposed as Web
all sorts of emotions — cynicism, optimism and
services to enable rapid development of mobile
guarded hope. That the Internet has permeated
applications. Due to the unique nature of mobile
every aspect of human existence is hyperbole
devices, however, performance requirements
no longer. Even in common experience, one can
need to be taken into account.
notice that newspapers, product brochures and
This white paper discusses key principles that talk shows de facto end with a reference to a Web
can help IT organizations create mobile apps that site for more detailed information.
can overcome performance challenges. It details
The force of change was so dramatic that those
the association of a service response object with
who failed to move or reluctantly embraced
a UI template, configurable way of contracts
change ended up as anachronisms and consigned
maintenance, gateway services as single service
to obscurity.
invocation and loose coupling. An application
built using these principles is discussed with One can see the same parallels experienced in the
specific reference to how physicians’ needs for shift from the Internet to mobile devices. Where
information access can be fulfilled in a timely earlier the onus was on the user to seek and
fashion. The paper concludes with the possibili- locate the information on the Web using search
ties of application of the suggested principles in engines, today’s models predetermine what users
other circumstances. want and create readily consumable information
capsules. The ascendancy of such new modes is
As the Information World Turns
fueled by the emergence of the mobile Internet.
When Confucius said: “They must often change The mobile Internet has empowered on-the-go
who would be constant in happiness or wisdom” users with access to the same level of informa-
he must have been anticipating today’s world tion that is available to a more stationary home
of real-time information ubiquity. Consider how Internet user, transcending the limitations of time
cognizant 20-20 insights | october 2012
2. and location. The widespread reach coupled with While these mechanisms are valid and help build
compactness of the mobile devices has made a more comprehensive understanding of medical
them attractive and utilitarian. That these devices science developments, oftentimes physicians
are usually always on helps ensure immediate dis- need to have immediate access to real-time infor-
tribution of information. mation. Conceivably, such situations occur at the
point of care where, as an example, the suitability
In a pioneering work on mobile information of a particular drug for the visiting patient may
access,1 the authors argue with great foresight need to be determined.
that mobile phones will emerge as the preferred
and primary platform for information access. On the other hand, pharmaceuticals companies
The need to be extremely context-aware and realize that multichannel engagement with
understand the intent of the user is predictive physicians is essential. They know that enabling
to success in the mobile world. An interesting physicians to maximize patient interaction is the
blog from Harvard Business key to success. Developments in medical science
Pharmaceuticals Review 2 delineates the therefore must be converted to a stimulating
companies are innovative, transforma- dialogue with patients. The mutual success of
tional possibilities in health patient-physician interaction typically yields
increasingly looking care leveraging mobility the best possible outcome for both parties.
at creating a means to trends. Cognizant of this, pharmaceuticals companies
arm physicians with all From here, we will share
are increasingly looking at creating a means to
arm physicians with all necessary information,
necessary information, some of our learning in available on demand, to help determine the most
available on demand, architectural principles appropriate treatment options for the ultimate
that we have successfully
to help determine applied to realize high-
benefit of the patient.
the most appropriate performance mobile appli- Manhattan Research4 suggests that more than
treatment options cations. We first talk about 72% of U.S. physicians have smart phones; of
physicians and their infor- that, 80% agree that their devices are essential to
for the ultimate mation needs and how the their practice. This finding is of crucial importance
benefit of the patient. mobile channels are playing as it attests to the new means of working for
a greater role; we then physicians. The adoption of mobile devices by the
discuss the key architectural principles that can medical community for professional purposes is
be applied for high performance, and walk through set to only expand with time.
an implementation scenario. We conclude with a
discussion of how the architectural principles can Recognizing the prevalence and increased market
be applied in other situations as well. acceptance of mobile-based applications, in July
2011 the Federal Drug Administration (FDA)
Physicians and the World of released a draft guideline5 on mobile medical
Information: Changing Contours applications. The FDA recently approved Mobile
MIM, an application that lets physician view for
More than ever before, physicians face the
diagnostic purposes CT, MRI and PET images.
daunting task of staying informed about develop-
Similar mobile application developments6 are
ments in medicine. The rapid rate of the informa-
emerging elsewhere, as well.
tion explosion, coupled with an increasingly aware
and assertive patient community demanding the With more and more physicians using mobile
latest and the best, is further challenging them to devices, system architects face the challenge of
stay abreast of new developments. making information available for effective use in
these devices. The devices are constrained in real
This information is diverse and it ranges from
estate and have much lower processing power
drug databases to side effects to dosage
compared with desktop and laptop computers.
guidelines to the latest news about the adverse
The architectural principles must reflect the
effects of a drug.3 The timeliness of information
understanding of these natural limitations yet
and the ability to access the same is of paramount
not compromise on performance or usability. In
importance. Traditional knowledge-gathering
the next section we will focus on the architectural
mechanisms such as literature review, informa-
principles that are very effective for creating a
tion from pharmaceuticals companies, subscrip-
high-performing, accessible device that delivers a
tions to information banks and discussions with
wide array of information to mobile users.
colleagues are tedious and time-consuming.
cognizant 20-20 insights 2
3. Principles of Performance precious resources in the device and will be detri-
mental to performance. Gateway services provide
The five principles described below are influenced
a uniform way of constructing the service request
by the following well-established, primitive archi-
irrespective of whatever the client is looking for;
tectural considerations:
be it for medical calculators or label informa-
• Clear separation of concerns. tion, the originating request is always made to
• Grouping of reusable components. the gateway services. The URI of the service is
always the same and takes the following form:
• Drive configuration at all levels. https://<site>/GatewayService.svc. The template
• Establish contracts between layers and name will be appended to the service call and that
anticipate changes.
serves to indicate the kind of information in which
Principle 1: Predefine UI Templates and the client is interested.
Associated Response Types
Gateway service also handles another important
It is possible to create predefined UI templates part of the job: All service invocations from the
for some of the most commonly sought after middle layer are handled by the gateway services.
information. For instance, one can have a list-type This helps the client insulate itself from the
display while showing medical news; for media concern of whether the sources are inside or
information, one can display a list of images. If outside the firewall. Figure 2 depicts the core
the responses from the enterprise information function of gateway services.
systems are formatted in an appropriate way for
predefined methods of rendering (templates), Since the handling of all services is centralized to
the display in the client devices can be made gateway services, this helps in scalability as one
fast. This also offers an elegant way to manage can provision necessary hardware depending on
changes. The idea of predefining the display and the load.
contracting with a suitable response structure is
at the heart of this architectural principle. Principle 3: Configurator — Configurable
Contracts Maintenance
Figure 1 describes some of the UI templates and The “Configurator” is a bridging mechanism
the contracted response structures. between the variety of information sources and
the client (device). There could be different types
Principle 2: Gateway Services – Single Service
of information that a physician may be looking for,
Invocation
so the mode of presentation and the information
When the mobile client requests data, it will be sources will be different. Much like Web services
ideal if the client is not burdened with having to abstract the underlying information sources and
know the service name and make the necessary exposes these services in one uniform construct,
request construction. Such an act will consume the Configurator provides the necessary abstrac-
Interface Options
UI Template Response Type Description
For applications which are required to display a list of items
List Template List Response (in a table view), data will be formatted as list response and
will be sent to the client.
For any action like adding a new app, removing an app or
adding an article to my selection, data will be formatted
Actions Template Actions Response
into actions response and the status of the action (success/
failure) will be sent to the client.
For any grouping based on category (such as alphabets),
Indexed List Category List data will be formatted in such a manner where items to a
Template Response particular group will be added under that category and will
be sent to the mobile client.
Media template will display the list of images. The response
Media Template List Response will contain the image details in a list format and the images
will be bound to the media template.
Figure 1
cognizant 20-20 insights 3
4. Gateway Services
External Services
SharePoint
Services
FAST Search
Services
Client
......
......
Gateway Services
Media
Services
Figure 2
tion and a consistency in structure. At the core at runtime to determine the service to be invoked.
of the Configurator is the mapping between the Since the services are maintained in a configu-
applications, templates and services. Figure 3 rable XML file, it provides the dynamism to change
illustrates the core concept. the actual service implementations.
In implementation, Configurator is an XML com- For example, to point to different sources for
ponent with two major sections: “medical news,” all that the administrator needs
to do is to change the URL of the service.
• Application: To act as the bridge between the
client and service. Principle 4: Loose Coupling at All Levels
• Services:To act as the bridge between the Brittleness in architecture can be removed by
service and its actual implementation. having a clear segregation of functionality with
In the application section of the Configurator, the a layered approach.7 This will help isolate the
mapping between the application and the type of changes in specific areas without impacting
template necessary for appropriately rendering the whole system. This will help retain the basic
the application will be determined. Each applica- fabric and yet afford easy ways to make changes
tion will have a template predetermined. The appli- as required. This principle has been put to very
cation section will also map the template to the efficient use in our architecture by using the
service. This mapping acts as the bridge between following patterns:
this section (application) and the services section
of the Configurator. In the service name section
• Service locator: Pattern to locate the service
and delegates to the next layer with greater
of the Configurator file, the mapping between the context.
service name and the actual service implementa-
tion URL is maintained. This mapping will be read • Service provider: Possibility to decouple the
service implementation from service interface.
Anatomy of Configurator
Backend Service
Devices Apps Names Services Names Implementations
Figure 3
cognizant 20-20 insights 4
5. • End-point channel: Ability to do service invo- • JSON parser.
cations with minimal programming efforts (and
• Pagination controller.
thus reduce runtime costs).
• Log recorder.
Service locator: An implementation based on
generics, service locator is a design pattern that JSON Parser
allows decoupling clients of services (described This is primarily used to construct the response.
by a public interface) from the concrete class When the enterprise information system returns
implementing those services. The constructor of a list of news headlines, the JSON parser converts
the class registers all the available services in a the object into JSON format and passes it on to
dictionary. A generic method returns a reference the device. JSON parser is also used to read the
to the correct implementation fetching it from incoming request details from a mobile device
the dictionary. The clients do not know the actual through a gateway service.
classes implementing the service. They only have
to interact with the service locator to obtain an Pagination Controller
implementation. Pagination information is defined in the configu-
ration file using the number of items per page
Service provider: This contains the actual imple- attribute. Based on the value defined in this
mentation of the service separated from the attribute, service delivery layer will ensure that
service interface. Through this decoupling, the only the requested number of items is sent to
service implementation can be evolved without the device by applying filter logic. For subsequent
directly impacting service consumers. This can pages, the device will send the request with the
increase the amount of refactoring opportunities page number so that appropriate items can be
and the range of potential consumer programs retrieved.
and corresponding reuse.
Log Recorder
End-point channel: Service host is configured
This component will be used across all the appli-
by creating an end point specifying an address,
cations to capture the status of the incoming
binding and contract. We can merge an address
requests from mobile clients and also to log the
and a binding with a contract in a channel
status of the requests made by service delivery
factory to create a channel. Having an address
layer to other external data sources.
(https://<site>/GatewayService.svc), a binding
(BasicHttpBinding) and a Contract (IListMan-
Principles in Action:
ager), we can create the channel:
A Scenario Walkthrough
BasicHttpBinding basicHttpBinding = Consider an application that bundles all
new BasicHttpBinding(); necessary physician information together. Let us
further consider a situation where the physician
EndpointAddress url = new
is interested in “medical news.” The request
EndpointAddress(“https://<site>/Gate-
object will be created from the mobile client with
wayService.svc”);
the template, app name, device type and device
IListManager channelClient = new Cha model information as shown in Figure 4.
nnelFactory<IListManager>(basicHttpB
inding, url).CreateChannel(); The entry from the figure shows that for medical
news application, the UI template to use is the
Using ChannelFactory, we can generate the proxy “List” template. The gateway service request that
based on the interface definition and the con- is invoked by the mobile device takes the form:
figuration. This avoids the need to generate a
https://<site>/GatewayService.svc/
separate proxy class. This also allows one to code
ListTemplate
against the service interface.
This call is handed to the gateway service. The
Principle 5: Foundation Service Components “Gateway Service” will locate the right service
Foundation service components are used across using the configurator. From the snippet of config-
the application to support common functionality. urator shown in Figure 5, the service invocation is:
Having this, separately, helps to improve main-
“http://<SiteName>/SearchService.
tainability and reusability for all system-related
svc/GetData”
changes. The main components in the solution are:
cognizant 20-20 insights 5
6. Sample Request Object for ‘Medical News’
{
“UserId”:“MobileUser1”,
“ApplicationName”:“Medical News”,
“ApplicationId”:“4”,
“TemplateName”:“ListTemplate”,
“CountryId”:“IN”,
“LanguageId”:“EN”,
“Params”:
[
{“Name”:“ItemsPerPage”,”Value”:”5”},
{“Name”:“PageNumber”,“Value”:“3”},
{“Name”:“SortBy”,“Value”:“MostRecentlyAdded”}
],
“DeviceType”:”Nokia”,
“DeviceModel”:”8359”
}
Figure 4
From the gateway services, using the principle of • Retrieves the service name and service value
loose coupling, the services are invoked through based on the app name and template name.
the service locator and service provider. This
enables changing the implementations easily
• Consumes external services http://<SiteName>/
SearchService.svc/GetData.
without making invasive changes. When the
response is received, using the foundational • Gets the response in XML or JSON format.
services of JSON parser, the response is restruc- • Required data is framed and sent in JSON
tured to the format determined by the response Format.
object for the UI template.
• Response data to mobile device in JSON format.
The overall architecture with the flow and a
The flow sequence can be summarized as below:
sample UI is depicted in Figure 6.
• Mobiledevice consumes https://<site>/Gate- Client ->Gateway Service ->Service
wayservice.svc/lListTemplate. Locator ->Service Provider ->Service
->Gateway Services ->Client
• Gets the reference of implementation from
service locator. As can be evidenced, the architectural approach
• Invokes the actual implementation of the is highly extensible as there is a clear separation
interface. of concern between pure rendering of the UI
Configurator File Snippet
<?xml version="1.0" encoding="utf-8"?>
<ServiceMapping>
<Pagination NoOfItemsPerPage="20" />
<VersionInfo No="2" />
<MobilityServices>
<Service name="SearchService" value="http://<SiteName>/SearchService.svc/GetData" />
</MobilityServices>
<Applications>
<Application AppName="Medical News" TemplateName="GeneralListTemplate"
Service="SearchService" ServiceType="List" Order="1" />
</Applications>
</ServiceMapping>
Figure 5
cognizant 20-20 insights 6
7. Runtime View
Device Request (Input from Mobile Devices): App Name, App Id, Template Name, etc
Gets the reference
https://<site>/ of General
Gatewayservice.svc/ List Manager
GeneralListTemplate
Service Locator Consumes external
services
http://<SiteName>/
Mobile Devices SearchService.svc/ External Services
GetData exposed over
Response data to Gateway Services Service Provider
Invokes General Internet/Intranet
mobile device in
JSON format List Manager.
Get Response() Retrieves the service name
and service value based on the
App Name and Template name
<?xml version="1.0" encoding="utf-8"?>
<ServiceMapping
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Pagination NoOfItemsPerPage="20" />
<VersionInfo No="2" />
<MobilityServices>
<Service name="SearchService"
value="http://<SiteName>/SearchService.svc/GetData" />
</MobilityServices>
<Applications>
<Application AppName="Medical TV"
TemplateName="GeneralListTemplate"
Service="SearchService" ServiceType="List" Order="1" />
</Applications>
</ServiceMapping>
Figure 6
and the data elements inside the UI. Consider a information sources. The separate rendering of
scenario where a new information source needs UI and data elements within the UI is a powerfully
to be added — for example, “medical videos.” innovative idea that can be put to use in transac-
Assume further that the Web service to get the tional applications as well. Similarly, the level of
medical videos is made available. One can simply configuration-based changes that this architec-
associate the medical video information source ture permits can be used where a need exists to
with an appropriate service, UI template and the point to different information sources, depending
response type in the configurator and it will be on the level of user role.
available in the mobile client without any devel-
opment efforts. We intend to further our work in the area of build-
ing extensible mobile enabling layers that can effi-
Conclusion ciently make available the enterprise information
to mobile devices.
The architectural principles discussed above offer
a great deal of flexibility in adding new informa-
tion sources. The salient benefits of this architec- User Interface
ture are:
• Device Agnostism: Decoupled from device
and can work with any type of device.
• Decoupled: All layers are detached.
• Configurable: The display type or service can
be changed by invoking simple settings in con-
figuration file.
• Extensible: New data sources can be added
with ease.
• Performance: Delivers high performance as
layers are designed to do specific tasks.
Multinational requirements can also be handled
with ease using this approach by specifying the
language and country in the device request;
a service mapping in the configurator can be
created for language/country.
The architecture can be used in enabling any type
of mobile application from existing enterprise Figure 7
cognizant 20-20 insights 7