Java Interface != Web Service
Alef makes an excellent point in his latest blog post. Basically, his argument comes down to this:
Most web tier frameworks (Struts, Spring MVC, etc.) provide a loose coupling between the web tier and the business and data tier1. When using these frameworks, you are focusing on the UI-side of things: reading HTTP parameters, providing a response view, etc. During the course of all this, you will probably use a business object or two, but the business layer will be ignorant of your web layer, and will have a different architecture altogether.
A Web Service also provides an interface: not for a user, but for another application. This being the case, why should a web service be any different than a web tier? In other words, why expose a business layer as web service, thus tightly coupling the two? It doesn’t make any sense to me. I think that - similar to a web tier - a web service should act as a gateway for you business layer, and should focus on the ins and outs of web service logic.
I guess it all comes down to making Web Services first class citizens of your application architecture.
1 - Recently, frameworks like Ruby on Rails have provided a much tightly-coupled approach. In my opinion, these frameworks are quite suitable for common CRUD functionality, but lack the power and clean architecture of the more conventional frameworks.
Permalink Comments off