Limitations of Overloading operations

in Help Center
Hi there,
Howdy. I'm a newbie to ICE. I'd like to know how to overcome the limitations of overloading operations?
I'm implementing a VISITOR pattern and all the method names happen to have the same name. What are the suggested alternatives avaliable to me.
Thanks,
Venkat
Howdy. I'm a newbie to ICE. I'd like to know how to overcome the limitations of overloading operations?
I'm implementing a VISITOR pattern and all the method names happen to have the same name. What are the suggested alternatives avaliable to me.
Thanks,
Venkat
0
Comments
Slice does not allow you to overload operations. For example, the following is illegal:
But overloading really is only syntactic sugar -- you can achieve the same things as:
Cheers,
Michi.
Thanks for the quick response.
I know its only syntactic sugar but it makes it a little easier when the class hierarchy keeps growing and I need to call only one method on the visitor by passing the current instance.
There are 2 flavors:
Here, I can eliminate coding the same thing by introducing a base implementation.
Thanks again,
Venkat
Cheers,
Michi.
On a related topic, I've been struggling with the architectural implications of Classes With Operations.
Say, with the example, I've a tree of Shape objects and I pass around this tree to various servers, which could interpret it in different ways. Also, add to the fact that each node has some behavior for the Visitor pattern. I'm now struck with providing client-side native code.
Can I just define Shape interface, its container and the Visitor interface in Slice and provide implementations in my choice of PL.
What’s the best/suggested way to solve this kind of a problem?
Any thoughts are appreciated.
Thanks,
Venkat