Microservices Expo Authors: Elizabeth White, Liz McMillan, Mehdi Daoudi, Pat Romanski, Flint Brenton

Related Topics: Microservices Expo, Machine Learning

Microservices Expo: Article

Corporate Mashups: Composite Applications Simplified Through AJAX and SOA

Real-World AJAX Book Preview: Corporate Mashups: Composite Applications Simplified Through AJAX and SOA

This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs for the special pre-order price, click here for more information. Aimed at everyone from enterprise developers to self-taught scripters, Real-World AJAX: Secrets of the Masters is the perfect book for anyone who wants to start developing AJAX applications.

Corporate Mashups: Composite Applications Simplified Through AJAX and SOA

In this chapter we'll look at rapidly implementing an AJAX Rich Internet Application that leverages various XML and SOAP Web Services while using the visual tools and application objects from TIBCO Software's AJAX toolkit: TIBCO General Interface. Download TIBCO General Interface at www.tibco.com/mk/gi.

What's Old Is New Again
Corporate mashups? The idea of putting information stored in various application systems on a single screen for the end user isn't new. When Yahoo! first popularized the Web portal, people suddenly had the experience of seeing information from different places on one screen and businesses quickly caught on to the portal concept.

Not surprisingly, providing composite views of data is often central to business operations. More than ever composite views of information are core to securities trading, shipping and logistics, telecommunications, customer service call centers, and other industries' primary operational activities. Of course providing this capability has been technically challenging to achieve atop previous generations of application architectures that were largely monolithic systems generally incompatible with one another. And so the integration software market came into being - an entire industry segment dedicated to getting the heterogeneous landscape of business information technology systems to work together.

Then as now the leading strategy for breaking down the barriers between systems has been "decoupling" - separating the production and consumption of information in systems intermediated by an independent information exchange protocol. This idea is perhaps the simplest definition of a service-oriented architecture (SOA). The key to the success of such systems is the extent to which producers and consumers can communicate using the independent information exchange protocol and be connected on a network.

Various technical approaches such as EDI, CORBA, real-time and queue-based messaging have been promoted over the years as popular ways of integrating systems. Interestingly it was in part a vision of composite views of stock exchange data that led to the creation of TIBCO Software's messaging technology in the 1980s as a way to get real-time information from disparate systems into composite view applications on securities traders' desktops.

While messaging remains at the core of enterprise integration implementations today, the global adoption of HTTP via the Web has led to XML and SOAP as prime standards for SOA implementations as well. Today XML, RSS, SOAP, and other forms of HTTP-based services, combined with the AJAX capabilities of the Web browser, provide a way to create a new generation of rich Internet applications that "mash up" information into a new lighter-weight and lower-cost class of composite applications.

Where Is This AJAX/SOA Approach Applicable? One of the things that AJAX affords is the ability, at least in part, to manage state on the client. This is advantageous since many Web services are implemented as stateless. The RSS feed you request doesn't remember what it gave you last time. An XML or SOAP service typically gets a request message and provides a response. Since these services aren't going to maintain state for you, you can now do it at the client. So implementing simple workflows at the client is feasible. Creating dashboards where portions of the screen update asynchronously is possible. Providing 360-degree views of customer information from multiple services becomes an easier task even so far as to merge data from one service with data from another service at the client.

Managing 100% of the end-user state on the client wouldn't be appropriate if you have long-running workflows, typical of Business Process Management systems, or sophisticated business logic that requires access to session and state. There's already plenty of infrastructure out there for that in Business Process Management (BPM) suites, rules engines, and Web application server products.

In cases where managing some state on the client makes sense, you can achieve remarkably highvalue solutions in just a little time mashing up Web services into AJAX rich Internet applications.

Let's take a look at how.

Anatomy of a Typical System
Figure 13.1 shows a typical implementation of a system with an AJAX application running in an HTML page served by a Web server asynchronously communicating back to that server when certain client-side events happen. The view in the browser is updated by JavaScript commands that manipulate DOM and CSS. JavaScript event bindings to DOM and CSS capture mouse and keyboard events invoking other JavaScript commands.

In the browser, the XMLHTTPRequest (XHR) object, which puts the "asynchronous" in the AJAX acronym, restricts communications to the sub-domain from which the HTML page it contains was served. Therefore, to the extent that various Web services reside in the same sub-domain as the Web server, no special server configuration is necessary.

When Web services reside in a remote domain or other sub-domain, those services must be proxied through the sub-domain from which the AJAX application was served. Since the Web server provides a gateway to services, it's also an opportune point at which to implement authentication and security policies.

Some AJAX implementations use iFrames or JavaScript Object Notation (JSON) to access information beyond the sub-domain directly from the browser. From a security point-of-view, such multisecurity domain access forces authentication policies to become distributed and so may represent more implementation challenges. Of course if you're not authenticating or securing services, then these methods may be easier. However, in business applications the security of information is more critical than in "mashup" solutions, like Google Maps and all the various overlays that combine public information. In business some information has to remain private, even compartmentalized to various groups of users. Accordingly, a central place for administering these policies becomes useful over time when creating corporate mashups. While a Web server can provide the basics, we've already seen multiple successful uses of AJAX and SOA where a more robust portal infrastructure provides the middle tier for application provisioning, personalization, and access control to both the AJAX applications and Web services. But that discussion would be grounds for a whole other chapter...so let's keep on moving towards our baseline implementation.

Use Case: 360-Degree Customer View
Figure 13.2 shows the application we'll build: a 360-degree view of a customer in a personal banking scenario. In this case a financial advisor needs rapid access to a broad range of current and historic customer information to provide service.

The primary use case consists of these basic steps:

  1. The user finds a customer through a modal dialog configured to talk to an HTTP GET-based service that returns customer information in a basic XML document.
  2. When a customer is selected, the customerID is broadcast to the GUI, data, and communication objects in the AJAX application.
  3. Objects subscribing to the customerSelected event subject receive the customerID triggering asynchronous calls to various services, some of them SOAP-based, others RSS and miscellaneous XML.
  4. As data from the services arrives, it is transformed into a Common Data Format (CDF is explained below) and put into the client-side data cache. Each time this happens a "success" event for that service call is broadcast.
  5. Objects subscribed to the success event for that call, handle it by repainting their onscreen view, using the new information in the data cache.
Implementation Strategy
We'll implement this case using TIBCO General Interface (GI), which provides multiple features that help implement more robust AJAX/SOA applications faster. With TIBCO General Interface, speed to implementation is achieved by minimizing the amount of coding required. First is through an extensible set of out-of-the-box components that are ready to use so you don't have to create them from scratch in DHTML and JavaScrip; second is through visual tools that let you simply configure many aspects of your application, leaving only the client-side interaction logic of the task to writing code. We'll use the following visual utilities in TIBCO General Interface (GI) in our implementation:
  • Visual WYSIWYG Layout Tools: With GI you don't create GUIs by coding DHTML tags. Instead you instance and configure JavaScript objects that know how to render the rich GUI controls for you. While you can instance these objects programmatically via the JavaScript APIs to GI's objects, TIBCO General Interface Builder provides a WYSIWYG drag-and-drop GUI construction capability. These components can be saved in XML files for later reuse in other projects and can include data, logic, and service bindings to make them "AJAX-lets" unto themselves.
  • Client-Side Data Objects and Data Cache: GI features a data cache on the client. This inmemory cache runs in the context of the current HTML page. You can store one or more XML data objects in this cache and make that data available to other GUI components and application functions. GI GUI components all implement rendering routines that expect data in what GI calls the Common Data Format (CDF). CDF is simply an open schema for describing any data. Since many of GI's components implement interfaces to CDF, a single CDF document can drive multiple views of that data, streamlining client-side scripting and supporting mashup-type implementations. To get data in and out of the CDF format, you can use the programmatic APIs of GI's CDF class object or use the visual service binding tools.
  • Visual Service Binding Tools: GI features drag-and-drop binding to XML- and SOAP-based services in its XML Mapper Utility. So if you're connecting to RSS, SOAP, or other XML services, you can eliminate significant coding here as well. The Mapper lets you transform client-side data in GUI components or data objects to and from the message formats required by the various services you're using. The XML Mapper Utility also enables single-click generation of pre-bound form elements from your XML message schemas. Once the bindings are defined in the visual tool, an execution script is generated for you to paste in your application logic, then modify to script the behaviors you want.
  • Client-Side Publish and Subscribe: Besides bindings for GUI events such as drag-and-drop, mouse actions, and key presses, GI implements a client-side publish-and-subscribe notification system. Similar to server-based message buses, GI's "pub/sub" capability lets an object be published to all the other objects that subscribe to the subject property of the published object. By implementing this technique, a component can broadcast a "customerSelected" event subject, passing the customerID to one or more subscribing objects, each of which can implement their own handler for that event and its data.
Getting Started
To get started you'll need to have two things in place: a locally running copy of TIBCO General Interface and the starter code for this project.

TIBCO General Interface Professional Edition is free for development, testing, and public deployment and features a dual-licensing program for smaller private or enterprise-grade use. You can download it from http://developers.tibco.com

The starter code for this project can be downloaded at http://developer.tibco.com. Search for Real-World AJAX: Secrets of the Masters. The code and installation instructions are available. Once you've downloaded and installed TIBCO General Interface and the starter code, you should see the following:

The project is comprised of a series of files as shown in Figure 13.4

We've already built out the various GUI components and screen layouts for you. The GUI component file appCancas.xml provides the primary layout and references the other GUI component files, enabling you to create your applications in reusable modules. Modularizing applications results in faster loading and rendering times in the way that Microsoft Word loads some of its DLL functionality upfront, then more DLLs later when you need them. The GUI components in the c360 project were modeled by dragging-and-dropping items from the Component Library onto the canvas of a component file, arranging the components hierarchically, and configuring them using either drag-and-drop sizing or the Properties palette.

The JavaScript files consist of logic.js, which contains the client-side interaction logic for the project.

The Mapping Rules have two "mapping" files that define the bindings between the various components of the client application and the various services with which they communicate.

The XML documents in the Project Files contain dummy data for the portions of the project that are simply mocked up at this time.

This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs, click here to order.

More Stories By Kevin Hakman

Kevin Hakman is Director of Evangelism for Aptana, Inc., makers of the popular Aptana Studio web development suite. As early as 2001 Kevin was pioneering AJAX web applications via General Interface, a full AJAX development and GUI toolkit which he co-founded, and later sold to TIBCO Software in 2004. Kevin is a contributor to AJAXWorld Magazine, and has spoken at numerous AJAX industry events.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

@MicroservicesExpo Stories
Enterprises are moving to the cloud faster than most of us in security expected. CIOs are going from 0 to 100 in cloud adoption and leaving security teams in the dust. Once cloud is part of an enterprise stack, it’s unclear who has responsibility for the protection of applications, services, and data. When cloud breaches occur, whether active compromise or a publicly accessible database, the blame must fall on both service providers and users. In his session at 21st Cloud Expo, Ben Johnson, C...
Most of the time there is a lot of work involved to move to the cloud, and most of that isn't really related to AWS or Azure or Google Cloud. Before we talk about public cloud vendors and DevOps tools, there are usually several technical and non-technical challenges that are connected to it and that every company needs to solve to move to the cloud. In his session at 21st Cloud Expo, Stefano Bellasio, CEO and founder of Cloud Academy Inc., will discuss what the tools, disciplines, and cultural...
21st International Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Me...
With the rise of DevOps, containers are at the brink of becoming a pervasive technology in Enterprise IT to accelerate application delivery for the business. When it comes to adopting containers in the enterprise, security is the highest adoption barrier. Is your organization ready to address the security risks with containers for your DevOps environment? In his session at @DevOpsSummit at 21st Cloud Expo, Chris Van Tuin, Chief Technologist, NA West at Red Hat, will discuss: The top security r...
‘Trend’ is a pretty common business term, but its definition tends to vary by industry. In performance monitoring, trend, or trend shift, is a key metric that is used to indicate change. Change is inevitable. Today’s websites must frequently update and change to keep up with competition and attract new users, but such changes can have a negative impact on the user experience if not managed properly. The dynamic nature of the Internet makes it necessary to constantly monitor different metrics. O...
Agile has finally jumped the technology shark, expanding outside the software world. Enterprises are now increasingly adopting Agile practices across their organizations in order to successfully navigate the disruptive waters that threaten to drown them. In our quest for establishing change as a core competency in our organizations, this business-centric notion of Agile is an essential component of Agile Digital Transformation. In the years since the publication of the Agile Manifesto, the conn...
The nature of the technology business is forward-thinking. It focuses on the future and what’s coming next. Innovations and creativity in our world of software development strive to improve the status quo and increase customer satisfaction through speed and increased connectivity. Yet, while it's exciting to see enterprises embrace new ways of thinking and advance their processes with cutting edge technology, it rarely happens rapidly or even simultaneously across all industries.
Many organizations are now looking to DevOps maturity models to gauge their DevOps adoption and compare their maturity to their peers. However, as enterprise organizations rush to adopt DevOps, moving past experimentation to embrace it at scale, they are in danger of falling into the trap that they have fallen into time and time again. Unfortunately, we've seen this movie before, and we know how it ends: badly.
These days, APIs have become an integral part of the digital transformation journey for all enterprises. Every digital innovation story is connected to APIs . But have you ever pondered over to know what are the source of these APIs? Let me explain - APIs sources can be varied, internal or external, solving different purposes, but mostly categorized into the following two categories. Data lakes is a term used to represent disconnected but relevant data that are used by various business units wit...
There is a huge demand for responsive, real-time mobile and web experiences, but current architectural patterns do not easily accommodate applications that respond to events in real time. Common solutions using message queues or HTTP long-polling quickly lead to resiliency, scalability and development velocity challenges. In his session at 21st Cloud Expo, Ryland Degnan, a Senior Software Engineer on the Netflix Edge Platform team, will discuss how by leveraging a reactive stream-based protocol,...
Today most companies are adopting or evaluating container technology - Docker in particular - to speed up application deployment, drive down cost, ease management and make application delivery more flexible overall. As with most new architectures, this dream takes significant work to become a reality. Even when you do get your application componentized enough and packaged properly, there are still challenges for DevOps teams to making the shift to continuous delivery and achieving that reducti...
Many organizations adopt DevOps to reduce cycle times and deliver software faster; some take on DevOps to drive higher quality and better end-user experience; others look to DevOps for a clearer line-of-sight to customers to drive better business impacts. In truth, these three foundations go together. In this power panel at @DevOpsSummit 21st Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, industry experts will discuss how leading organizations build application success from all...
The last two years has seen discussions about cloud computing evolve from the public / private / hybrid split to the reality that most enterprises will be creating a complex, multi-cloud strategy. Companies are wary of committing all of their resources to a single cloud, and instead are choosing to spread the risk – and the benefits – of cloud computing across multiple providers and internal infrastructures, as they follow their business needs. Will this approach be successful? How large is the ...
You know you need the cloud, but you’re hesitant to simply dump everything at Amazon since you know that not all workloads are suitable for cloud. You know that you want the kind of ease of use and scalability that you get with public cloud, but your applications are architected in a way that makes the public cloud a non-starter. You’re looking at private cloud solutions based on hyperconverged infrastructure, but you’re concerned with the limits inherent in those technologies.
"NetApp's vision is how we help organizations manage data - delivering the right data in the right place, in the right time, to the people who need it, and doing it agnostic to what the platform is," explained Josh Atwell, Developer Advocate for NetApp, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
The “Digital Era” is forcing us to engage with new methods to build, operate and maintain applications. This transformation also implies an evolution to more and more intelligent applications to better engage with the customers, while creating significant market differentiators. In both cases, the cloud has become a key enabler to embrace this digital revolution. So, moving to the cloud is no longer the question; the new questions are HOW and WHEN. To make this equation even more complex, most ...
One of the biggest challenges with adopting a DevOps mentality is: new applications are easily adapted to cloud-native, microservice-based, or containerized architectures - they can be built for them - but old applications need complex refactoring. On the other hand, these new technologies can require relearning or adapting new, oftentimes more complex, methodologies and tools to be ready for production. In his general session at @DevOpsSummit at 20th Cloud Expo, Chris Brown, Solutions Marketi...
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
Today companies are looking to achieve cloud-first digital agility to reduce time-to-market, optimize utilization of resources, and rapidly deliver disruptive business solutions. However, leveraging the benefits of cloud deployments can be complicated for companies with extensive legacy computing environments. In his session at 21st Cloud Expo, Craig Sproule, founder and CEO of Metavine, will outline the challenges enterprises face in migrating legacy solutions to the cloud. He will also prese...
DevOps at Cloud Expo – being held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real r...