Announcement Announcement Module
No announcement yet.
interface versioning and HttpInvokerServiceExporter Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • interface versioning and HttpInvokerServiceExporter

    I have a server interface, call it IMyService and I have clients that go against that interface using HttpInvokerProxyFactoryBean and HttpInvokerServiceExporter (on the server side). I need to add some methods to it to create a newer version of that interface. This doesn't seem like a new problem, is there a best practice I should be applying here for dealing with changes to an interface, is HttpInvokerServiceExporter the right RMI framework to use here?

    Q: Can existing clients use the new server interface with no changes (assuming i'm not changing any method signatures, just adding new ones)?

    I'm tempted to try something like have IMyService extend a base interface: IMyVersionedService which would allow new clients
    public interface IMyVersionedService {
      int getServiceVersion();
    Each time I change the interface, I subclass the previous version of the interface (again assuming only additive changes).
    public IMyServiceV2 extends IMyService;
    public IMyServiceV3 extends IMyServiceV2;
    Then in the client code, I could adapt the HttpInvokerProxyFactoryBean to give me the proper version of the interface sub-interface. But I feel like this is re-inventing the wheel, probably poorly.

    Q: Is there any a spring concept or class that does this type of thing (detecting the proper version of the server interface)? I know that by default HttpInvokerService doesn't export all service interfaces, only the ones it is configured to export (for security/exposure reasons).