Newer Version Available
Introducing Mash-Ups and Web Services
If we revisit the requirements of our Recruiting app, we'll see that we still need to implement an interactive map that shows the locations of the candidates that have applied for a particular position. Clearly no such functionality is available by default in the platform, and we certainly don't have time to build our own mapping engine. Is this type of functionality even possible?
Of course it's possible! Because the Lightning platform runs on the Web, we can leverage the power of other websites to implement features that would never be available just through our platform alone. This means that with a little code, we can mash up our own recruiting data with an interactive map website, such as Google Maps, and place this functionality in our own app.
To implement a mash-up, we'll first need to understand a little about the technology that makes it possible: Web services. A Web service is the mechanism by which two applications that run on different platforms, that were written in different languages, and that are geographically remote from each other, can exchange data using the Internet. Web services makes data exchange between two such applications as straightforward as two processes exchanging data on a single computer.
The way that data is exchanged between two Web services is similar to the way data is exchanged between a Web browser like Microsoft Internet Explorer and a Web server. Just as a Web browser uses a common network protocol (HTTP over TCP/IP) to download HTML files hosted on a Web server, a Web service can also use this same network protocol to download data from another Web service. The key difference is the actual data that is sent and received—Web services use XML instead of HTML.
The online world has a vast array of Web services, many of which are free. For our Candidate Map feature, we'll utilize the Google Maps service, which let you easily embed interactive maps in your apps. If we can find a way to pass candidate addresses from our app to the Google Maps service, Google will take care of all the mapping functionality, saving us from worrying about how our app will render an interactive map. We'll just need to figure out how to pull that rendered map into our app.