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:
- You 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,
you 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.
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
- You develop your adapter to meet your needs. You 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.
- Test and debug
- MobileFirst Platform CLI makes
it easy to test adapter code. It is also possible to use external
tools such as Swagger, Postman or cURL to test the adapter. For more
information, see Tools for testing and debugging adapters.
- Deploy to staging and production environments
- After development and testing have been completed, you deploy
the adapter to a running MobileFirst Server.
- 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 Configuring adapters.