I'm currently studying ZeroC ICE, and I don't understand a thing : what is the real difference between an interface and a class ? I know that an interface can not have attributes and only operations, but I don't understand why we should use interfaces instead of classes when we only use operations. On the Ice's documentation, there is this explanation : https://doc.zeroc.com/display/Ice36/Architectural+Implications+of+Classes#ArchitecturalImplicationsofClasses-ClasseswithOperations (see Classes with operations).
"But, keep in mind that, once you use classes with operations, you are, in effect, using client-side native code and, therefore, you can no longer enjoy the implementation transparencies that are provided by interfaces".
Which implementation transparencies ? Could someone explain me ?
Thank you.
Interfaces are never instantiated on the client side.
Classes are often return values and need to be instantiated on the client side, which requires an available implementation on the client side. Therefore, you need to rely on the correct implementation on the client side.
If you use classes only as interfaces, then there is no difference afaik.