Anti Pattern: Wrong Protocol
The choice of the right communication protocol strongly depends on the overall system architecture as well as the underlying requirements. If you are working in a heterogeneous environment where mainframe, Java and .NET components have to interact with each other there is nearly no way around SOAP today. In a pure Java environment the usage of RMI over JRMP is still the best performing and most scalable solution which you can get with out-of-the-box programming support.In many SOA implementations, however, SOA is synonymously used for a Web-Service-based implementation. So there are more and more cases where plain Java applications are using SOAP as an RPC protocol although there are no advantages in following this approach. Measurementshave shown that the overhead of SOAP compared to RMI-JRMP is significant. Performance degradation by a factor of ten and significantly higher CPU and memory consumption occur quite often.
Besides the described standard protocols a number other XML-based and binary protocols are used in applications. Hessian is a well-performing alterative. Additionally there exist implementations for other programming languages.In case Spring is used to export POJOs for remote invocation it is relatively easy to switch between different protocols without having to change the implementation.Spring supports RMI, HTTP, Hession, Burlap, JAX-RPC, JAX-WS and JMS.
|