There is no reason in theory why communication with our quote server should not be implemented directly by an EJB using Java sockets. This technique is specifically allowed for in the EJB Specification [EJB2.0 24.2.1]. If the designer encapsulates the communication inside a dedicated class or EJB, the code will not be particularly objectionable.
In practice, the EJB can execute code something like this:
Socket s = new Socket (’someserver’, somePort); //... read and write socket s.close();
The container has to support this, because method calls between EJBs can be network calls.
The problems with this strategy should be fairly obvious.
The developer has to do all the work: The Socket ...