I find that whenever I create a layer/tier, I have to translate between one layer to the other, does that mean it is a tightly coupled system? If I was to change a business logic, remove a field in the database, etc, I would have to change ALL layers from the database layer to the client front end?
E.g. A web service that exposes a “data contract” object, and converts it to some “business objects” in the middle layer, then converts it to the appropriate “ORM object” in the data layer. And the client calling the web service, converts the datacontract to some model objects, etc…
Since there are so many translations in between, how can web services be designed to be loosely coupled? Just getting my head around it, if someone can share his/her opinions it would be great.
Thanks
Translation or mapping is orthogonal, although somewhat related, to loose coupling.
In other words, loose coupling is related to the concept of programming to interfaces – not to mapping.
If layers in an application communicate with each other through concrete types, it’s tightly coupled. In such a case, layering doesn’t provide much value, and you might as well have built a monolithic application.
On the other hand, if a layer communicates with other layers through interfaces the layers will be loosely coupled, but mapping is often still required.