For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Adapters overview
Adapters contain the server-side code of applications that are deployed on and serviced by IBM MobileFirstâ„¢ Platform Foundation.
MobileFirst adapters are deployed to a runtime in the IBM MobileFirst Platform Server and are used to securely connect client applications to enterprise back-end systems and cloud services. Adapters deliver data and perform any necessary server-side logic on this data.
Adapters support DevOps needs:
- We can "hot deploy" adapters, meaning deploy, undeploy, and redeploy them at run time. This capability lends great flexibility to the MobileFirst server-side development process.
- An adapter can have user-defined properties that can be configured by administration personnel, without redeploying the adapter. This feature lets you customize adapter behavior for different environments, for example development, testing, and production.
Adapters provide other benefits:
Universality Adapters support multiple integration technologies and back-end information systems. Read-only and transactional capabilities Adapters support read-only and transactional access modes to back-end systems. Rapid development and testing Use tools such as Apache Maven and MobileFirst Platform CLI. Adapters use simple XML syntax and are easily configured with the JavaScript API or Javaâ„¢ API. Security Adapters use an OAuth-based security framework that enables you to protect enterprise resources. There are built-in annotations that let you quickly define the scope for authorization permissions of the resources. Transparency Data that is retrieved from back-end applications is exposed in a uniform manner, regardless of the adapter type. Application developers can access data uniformly, regardless of its source, format, and protocol.
Figure 1. MobileFirst adapters
![]()
Adapters as Maven projects
Apache Maven is a popular tool for building and managing Java-based projects. Starting with IBM MobileFirst Platform Foundation V8.0.0, we can create, build, deploy, and configure a MobileFirst adapter as a Maven project.
For more information, see Adapters as Apache Maven projects.
Adapters and third-party dependencies
Every adapter has its own isolated sandbox, in which all its classes are running without knowing about or interrupting the sandboxes of other adapters. It is possible to include third-party libraries that are required by the adapter code by defining them as Maven dependencies in the adapter project pom.xml file. For more information, see Third-party Maven dependencies.
Note: There are certain limitations in the use of third-party dependencies in adapters. For more information, see Adapters and third-party dependencies.
Development Language
Adapters can be developed in either in JavaScript or in Java. The source code of the adapter in both cases has access to a rich server API, which enables it to perform operations on the server side, such as calling other adapters, getting the user identity, and more. For more information, see MobileFirst Java adapters and MobileFirst JavaScript adapters.
Lifecycle
The adapter lifecycle comprises four stages:
- Develop
- Develop an adapter.
We can start by downloading a sample adapter from the Download Center in the IBM MobileFirst Platform Operations Console, then develop it further using an IDE that supports Maven, such as Eclipse or IntelliJ.
- For more information about developing adapters...
- Test and debug
- MobileFirst Platform CLI can test adapter code. We can also use external tools such as Swagger, Postman or cURL to test the adapter. See Tools for testing and debugging adapters.
- Deploy to staging and production environments
- We can use the IBM MobileFirst Platform Operations Console to deploy the adapter. See: Deploy Java adapters and Deploy JavaScript adapters.
- We can also automate the build and deploy process by using Apache Maven or Apache Ant deployer tasks.
- Configure
- After developers have implemented the properties to be used in the adapter, administration staff can configure it on-the-fly, without having to redeploy it. For more information, see Configure adapters.
Parent topic: Develop the server side of a MobileFirst application