Out of the blue today felt like messing around with Dynamic Proxies
… I mean out of nowhere !!!.
Since I wanted to use it I had to find a place where it would do some good. Found the perfect candidate in our team’s own home grown remoting architecture. It was kinda OK already with nice little refactorings going on now and then, still there was a lot of redundant code. By the way it was a [rich client]-[HTTP server] type comm. I wanted it to work RMI style
. So how about this :
1. Client calls on a Interface wrapped by a dynamic proxy
2. This is intercepted by the Handler which does it’s own decent marshalling of argument etc.
3. Send the request to the request processor
4. Unmarshalls the response from the server and returns it to the client.
The old architecture was also similar(guess who wrote it
) except that the marshalling was done on a per class basis so there were a lot of classes doing almost the same work. This should prevent such code. Also this method makes coding to interfaces mandatory
. I haven’t implemented this in my current project as it’s almost complete and any code change will probably cause my death under suspicious circumstances
, but maybe in the next 1 or the one after that …..
—
Neat links :
Started off with this kinda ok article
Should have read this neat 1 first