[JdeRobot] ICE interfaces versioning problem and getimageformat confusion

Oscar Garcia oscar.robotica at linaresdigital.com
Mon Apr 13 15:51:36 CEST 2015


Hi to all,

I'm thinking about a safe way of implement a camera client and a camera 
server that could be compatible with both, old style Image interface and 
new style one and get into a end road. It is not possible to achieve it 
with current slice definition..

Looking arround the problem I found this:

https://doc.zeroc.com/display/Ice/The+Versioning+Problem

There is two ways to make applications backwards compatible: facets and 
addition.

Right now I think that facets are not necessary, but I think that 
implement addition compatibility is a good idea, but it requires 
modification of actual Image interface because slice doesn't support 
overloaded operations.

The old operation "getImageData" doesn't have any parameter and now 
"getImageData" accepts image format as parameter.

If slice would support overloading then we would maintain both operations:


         ["amd"] idempotent ImageData getImageData(string format)
           throws DataNotExistException, HardwareFailedException;
         ["amd"] idempotent ImageData getImageData()
           throws DataNotExistException, HardwareFailedException;


But it doesn't support overloading operations, so I would refactor the 
actual slice to:

         ["amd"] idempotent ImageData getImageDataWithFormat(string format)
           throws DataNotExistException, HardwareFailedException;
         ["amd"] idempotent ImageData getImageData()
           throws DataNotExistException, HardwareFailedException;



So old and new clients and servers still being compatible:

* A new server could serve new operation "with format" X and old 
operation with predefined format).
* A new client could ask for available formats (getImageFormat) and if 
slice throws an not existent operation (OperationNotExistException ) 
then assume that server only supports one format: 
https://doc.zeroc.com/display/Ice36/Ice-OperationNotExistException

Another change could be rename "getImageFormat" to "getImageFormats", 
"enumImageFormats", ect. Maybe "getImageFormat" could be misinterpreted 
as something like "tell me about current image format used in server" or 
something similar, and not "list image formats supported by server".

Opinions, ideas, suggestions are welcome.

I could code and send a pull request with all the necessary changes in 
slice definitions and current client/server implementations.

Best regards,
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://gsyc.escet.urjc.es/pipermail/jde-developers/attachments/20150413/4295ee2a/attachment.htm 


More information about the Jde-developers mailing list