August 8, 2013

pro and Cons of Loosely couple architecture

In our company,My manager always trying to make application loosely coupled architecture.
Let see the Pro and cons of this
Loose Coupling allows you to make changes in one area of the application without affecting the others. 
It definitely makes your applications more flexible, more adept at change, and easier to maintain (since you don't have to worry about a change in one area of the application breaking another).
  • Scalability - allow you to expand out a database access layer
  • Maintainability - just change the code in one place
  • more developer can work.Each one can take bunch of code.
Service Oriented Architecture (SOA) is loosely coupled architecture.

Cons
  • It's more work at the beginning, and if you don't do it well, you may never see the benefits of it.
  • Defining API is quite difficult and requires very experienced developers. It's easy to do initially, but its hard on the long run.
  • Generalization of loose coupling can in fact lead to loose typing everywhere. Instead of using clearly defined meaningful objects, you may observe an increase in the usage of 'object' parameters or return type, of generic types added to every class or interface. The bad effect of this is the average developer will probably add wild cast operations everywhere, assuming types on both sides of the so-called loosely coupled systems.
  • Some loose coupling techniques are based on the generalization of interfaces definition, with an intent to avoid direct dependency. 
  • Loose coupling somehow bypasses one of the most powerful tool ever created: the compiler (C# or others). And that's the whole purpose of it actually, but it definitely has some drawbacks because all the ground work the compiler was doing (type checking, etc...) will need to be done elsewhere (tests), and that will have a cost.
  • Many out-of-the-box tools will probably not work any more. You will not be able to use things such as Visual Studio "Go To Definition" or "Find All References".Documentation is too important in this type of architecture.

No comments: