Menu

#21 Explicit implementation partial fix

open
nobody
None
5
2011-05-31
2011-05-31
No

Here is an other attempt to fix the problem with explicit implementation of interfaces. I finally kept the marshalling call, only repository id is built based on serialialization of target type. To make it work I had to look for methods on implemented interface in addition to the type itself in ArgumentsSerializer.DetermineTypeMapping method. Then I had to fix somehow ServerTypeType and ServerTypeName in GiopServerRequest.ResolveCalledMethod to match the method declared type.

This fix is only a partial one however because one of the reason to use explicit implementation of interfaces in .Net is to be able to implement 2 interfaces having the same method. But in this case the method name used to indicate what method should be called is not enough to know exactly what interface method should be called. This is why I kept a test ignored for the moment.

To make it run I will still need the the first patch that was marshalling the argument as an interface. Tests that are failing because of it in Direct folder are rather suspect, calling a method for an instance of interface I1 and checking that it is also an implementation of I2 is just a test of an implementation detail and not a real use case. It might be a use case however so I think I will propose a patch to make this behavior configurable.

For info the patch reflects all modification I have on my side, I am tired of trying to extract pieces of it and I think all modifications are relevant.

Regards

Discussion

  • Francois Dumont

    Francois Dumont - 2011-06-01

    I have just uploaded a new version of the patch with the new configuration feature to change how marshaling of argument instance is done. I preferred to use as default the version that marshal arguments as an instance of the interface and not as its concrete type because it sounds more to me like a real use case. I use the introduced config entry SerializerFactoryConfig.ObjSerializationUseConcreteType in Direct test fixture on server side to make it pass.

     
  • Francois Dumont

    Francois Dumont - 2011-06-01
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.