Friday, October 16, 2015

A framework for generating Payment(SWIFT) messages

It was late 2007, world was on the brink of credit crisis. I was a lead architect on a project for a large American bank on a consulting assignment. The project required generating and consuming SWIFT messages and I was thinking hard on how to make it easy for my team to exchange SWIFT messages as part of the system that was being developed. After searching around I could not find a good software or a framework that would do the job and so I set out to design one myself. I soon realized that composing SWIFT messages element by element was going to be hard as it required the developers to understand the rules and grammar of SWIFT. If I were to ask my developers to learn SWIFT and then work on the module of the system that would be responsible for exchanging SWIFT messages, I know I would be on a suicidal mission. Most of the developers in my team were novices, let alone understanding SWIFT they didn't even know enough programming. You know how the offshoring companies work, its all a game of labor cost arbitrage. To maintain profitability they hire extremely junior developers and make the seniors train them on the job. So this was going to be a big problem for me. Anyway I kept on thinking.

Breakthrough
I met my Business Analyst and understood the level of complexity of SWIFT messages. He made his analysis and came back to me showing sample messages. While going through the messages, I realized that the messages were mostly of a fixed format with minor variation. I asked him if he could give me all possible variation of the messages that the system was ever going to need. He agreed after I promised helping him putting together the messages. During our work I realized that the messages were like fixed templates and only element values were different. And I knew I had the solution right in-front of me. If we used pre-defined message templates for each possible scenario and then added values to those messages based on the situation at hand at run-time to create a message instance from a pre-defined template it would work like a champ. And it did. Here's the presentation that I made to my seniors after immense success of the project.










The slide below is animated, unfortunately you can't see it in action as the slide is presented here as an image. If you are really interested drop me an email and I shall share the slide that captures the message transformation as animation.




The slide below is also animated, again you can't see it in action as the slide is presented here as an image. Please drop me an email if you want to see it in action.

 Same goes for the slide below, original was a animated slide.