dp api

A few years ago, a lot of interest was generated around the idea of Service Oriented Architecture (SOA), when it came to IT infrastructure within organisations. The underlying premise behind SOA was that individual components or subsystems within an IT infrastructure could essentially be black boxes; exposing only the services necessary for the components to do their functions, while the details of implementation of those services are hidden from other components, and in fact, do not need to be known. SOA promised that it would simplify the deployment of IT systems, because they would not be so interdependent on each other (i.e. as long as the service ‘contract’ was honored, it didn’t matter what the implementation details were).

The concept of a service oriented architecture (SOA)

The concepts behind SOA are not new. Procedural and object-oriented programmers would be instantly familiar with the notion of separating the interface (declaration) of a procedure or function from its implementation (code). In particular, software platforms (software on which other software is designed for and run on, e.g. operating systems) – including the Joomla! CMS – provide a series of services and system calls for the programs that run on top of them. Taken together, these services and calls are collectively called an Application Programming Interface (API).

The role of an API

As with SOA, the value of an API – of all APIs – is that it provides a standardized way of communicating between application and platform that, in theory at least, does not change between successive versions of the platform. Joomla’s APIs, for example, stay the same within the same major version release (version 3.1 APIs would be the same as that of 3.5). One of the most famous APIs, the Win32 API, has been around since 1993. Applications that were correctly written for the Win32 API back in 1993 would still run properly on Windows 8.1 in 2014, more than 21 years after it had been introduced. In those 21 years, the underlying platform (Windows) has changed almost beyond all recognition – but because the API was still fully honoured and supported, the application does not need to care about how the platform implemented the Win32 API, only that it did so correctly.

In the days of Web 2.0, which is all about software-as-a-service, and cloud architectures, APIs play an even more dominant role. All Web services (e.g. Twitter, Dropbox, Google Maps) that allow third-party software to have access to them do so through public APIs, which both traditional and Web programmers can then use in their own applications to work with these cloud services. The Android OS exposes an API for programmers’ convenience, as does iOS. CMSes like Joomla also expose APIs so that extension developers (including Digital Peak) can extend the functionality of the CMSes in a fully-compatible way with all other extensions. In the case of our extensions, we even work with multiple APIs (Joomla’s and Google’s, mostly).

The point of APIs is that as long as the interface/‘contract’ is honored, how it’s implemented is not an issue. This is both a strength and a weakness; while an API is supported by the Web service which created it, programmers don’t have to worry about whether their application will work or not. If you instead relied on some undocumented idiosyncrasy of the Web service to make your application work faster or ‘better’, then if the Web service changed the way it worked, your application may fail miserably. Unfortunately, the weakness of an API is that if the API itself is updated, changed or dropped, then existing applications that rely on the API will no longer work, and new versions written to support the new API. This is why, when Google kills support for v1 of its Google Calendar API, our now-deprecated and soon-to-be obsolete GCalendar will also stop working.

API at Digital Peak

So how do Digital Peak’s extensions work with APIs? Well, our extensions communicate with the rest of Joomla through Joomla’s APIs. This way, we can request and present data in exactly the same way as every other extension (basically we use the MVC layer of Joomla). We are able to request and present data from web services like Google, Facebook, MS Exchange by using their public APIs. In fact, given that (for example) DPCalendar allows so many other plugins to be used, we’re working with a vast number of APIs. All of this work happens on the Joomla server behind the scenes, as our extensions initiate sessions with the various other Web services involved. None of it is actually taking place on the website visitor’s browser, which only displays the information Joomla delivers to it after all the hard work is done. That's why all of our plugins support a caching mechanism to temporary store the data of the external services on your Joomla site to speed up your page load.

Cookies make it easier for us to provide you with our services. With the usage of our services you permit us to use cookies.
More information Ok Decline