|
Ice Proxy Design
Hi,
In the process of coming up to speed on Ice (and some CORBA), I've run into a couple of issues about which I'm hoping to get a little clarification.
First, I was a little surprised that Ice (and apparently CORBA too) doesn't seem to apply the Proxy pattern as it's usually described (by the GoF, for example). Specifically, why doesn't the Slice compiler generate a common base from which the proxy and servant classes are both derived? I assumed (perhaps naively) that the ability to write client code which remains unaware of whether it's dispatching to a proxy or a real subject (i.e, servant) would be important.
Second, I was pleased to read early in the Ice Book that the Slice 'nonmutating' keyword facilitates use of the C++ 'const' keyword for the corresponding class member functions generated by the Slice compiler. But AFAICT, this translation is only applied for the servant class interface and not for the proxy. If I'm right about that, this means client-side APIs that depend on proxy interfaces must either avoid 'const' altogether or use const_cast everywhere. That seems like an unfortunate liability.
Thanks,
Greg
|