Saturday, May 24, 2008

Technical Articles - 2 :Coupling

Coupling:
Interfacing of 2 systems is called as coupling. Coupling is of 2 types
1 Tight Coupling
2 Loose Coupling


Tight Coupling:
In Tight Coupling, Computers are connected to each other through strictures of Custom made interface. In Distributed environment, it is not wrong. How ever, if you want to make any change in the interface it is either costly or too difficult.
Lets consider our previous case (Notes <-> LEI <-> DB2).

The user also has a SAP application. If he wants that integrate with the above, the he need to develop or procure some other interface which connects both DB2 and SAP with Lotus notes.

To put it in simple words, In Tight Coupling Change is expensive and time consuming.
In the below figure, we have interface (in dark blue color) which connects with all the 3 system. The interface converts each request in such a way that other systems can understand it.




Before talking about Loose Coupling, we can discuss why change is difficult in tight coupling.
Let’s take a real time example:
Currently I’m living at Bangalore, India. The official language here is Kannada, which I don’t know. If I go to a barbershop, I need to explain the barber about my hair style, so that he can continue in the same pattern.

I don’t know Kannada, and the barber knew only Kannada. He cannot understand what I try to convey. So I need to have a translator with me who can translate Tamil, the language that I speak, into Kannada, so that the barber can understand. Or I should learn to speak Kannada.

When I’m in Karnataka, I can use this translator. Consider if I have move to some other part where the people speak Marathi. The entire process repeats. Either I have to learn Marathi or I need to have a translator.

The same thing applies to the software too. Every OS/Software has its own set of standards, which need not to be compatible with other OS/Software. More clearly 2 different softwares cannot directly communicate with each other.

Learning a new language is some thing like developing a custom interface and having a translator is like buying some software from the market.



Loose Coupling:
In loose coupling, we can add any number of computers to the given network with minor/no modification.
As I said previously, each system has its own standard. But the problem with the tight coupling made the manufactures to think in a different way. Each system may have different standards but for communication all of the use the same standard.
Let’s have a real time example here for a better understanding:
My mother tongue is Tamil. I’m at barber shop. The barber’s mother tongue is Kannada. How can we communicate each other? Both of us know English. I would explain my requirements in English and as he too knows English he can understand what I want. So I no need to Learn Kannada or need not have Translator.
Following the same, all applications can do all their work in their own standard, but when they need to communicate with some other system, all the applications will/should follow a common standard/protocal.