I want to integrate Appway with another system, e.g. a core banking system. How do I make the integration robust towards change while keeping complexity to a minimum?
Let's assume we are building an online banking system that allows customers to deposit money into their account from another bank. To perform this, our application has to be integrated with the back-end financial system that manages fund transfers.
The easiest way to connect the two systems is through TCP/IP. To keep things simple, let's assume that the remote function that deposits money into a person's account takes only the person's name and the dollar amount as parameters.
The following script implements that function. It opens a socket and sends the amount and account name to the target bank:
// get the target host by name
Host host=DNS.getHostByName("www.thebank.com");
// retrieve the IP address
Address adr=host.getAddress(9090);
// open a socket for TCP communication
Socket socket= new Socket(Socket.STREAM, PortocolType.TCP);
socket.connect(adr);
// amount
int amount=1000;
// account
String account="Moe Szyslak";
// send amount and name
socket.send(Integer.getBytes(amount));
socket.send(String.getBytes(account));
// terminate transmition
socket.close();
The minimalistic integration scenario above is fast and cheap, but it results in a very tightly coupled system because the two participating peers make a lot of assumptions about each other:
- Platform technology — internal representation of number and objects
- Location — hardcoded host address
- Time — all components have to be available at the same time
- Data format — the list of parameters and their types must match
Assumptions are problematic. The location of the peer system, for example, is fixed in the code. What if the call to www.thebank.com fails, or we want to send the message to more than one peer? A change of scenario would also need a change in the code.
Another example of a potential issue in the scenario above is the message format. TCP/IP is a very basic communication protocol which relies on byte streams. It doesn't deal with internal memory representation of numbers. Many 32-bit systems send 4 bytes for an integer; a 64-bit system would be urged to read 8 bytes to reconstruct the same integer. PC systems store numbers in little-endian format while others use big-endian.
The value 1000(DEC)=11'1110'1000(BIN) can be interpreted using 32-bit little-endian as 2^3+2^5+2^6+2^7+2^8+2^9 = 1000. A 32-bit big-endian system would reconstruct this to 2^31+2^30+2^29+2^28+2^27+2^25 = 4,194,304,000, a very big number. A 64-bit big-endian system would make Moe Szyslak richer than C. Montgomery Burns!
In sum, the fewer the number of assumptions, the looser the coupling between the systems and the more robust the integration is.
To make the integration loosely coupled, we must get rid of assumptions:
- Use a platform-independent, self-describing data format, for example XML.
- Use a messaging infrastructure that provides a logic address for each peer. Thus, the peers don't need to know each other.
- If the messaging infrastructure queues messages that have not been received, the communication will be time-independent.
Removing the dependencies between the systems makes the overall solution more tolerant to change: This is the key benefit of loose coupling. The main drawback, on the other hand, is the additional complexity: it is not a 10-line script anymore.
This is where Appway's Integration Link engine comes in. This infrastructure makes exchanging data between systems as simple as the example code above, while reducing the number of assumptions we have to make for the communication. We reach a high degree of loose coupling without complex scripting.
An example of an Integration Link handling money transfer is show in the next screenshot.

- The Money-Transfer link receives the transfer messages from Appway.
- The next step converts the received message to XML (the format required by the transfer service).
- The XML structure is transmitted to the target system using a secure REST call.
- The response's format is XML; the final step in the link converts the XML document back to an Appway Data Entity.
For more information, see the documentation on Integration Links.