Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39204

How to handle methods in a common interface that supports different versions of a message format

Newsgroups comp.lang.java.programmer
Date 2019-12-05 23:55 -0800
Message-ID <2adff0bf-b579-4a12-87bc-70e1fe90a829@googlegroups.com> (permalink)
Subject How to handle methods in a common interface that supports different versions of a message format
From mike <mikaelpetterson@hotmail.com>

Show all headers | View raw


Hi,

I would need some advice in the following issue:


public interface Netconf {


void methodA();

void methodB();


}

The issue I have is that methodA() only supports NETCONF message 1.0 and methodB() only supports NETCONF message 1.1

1. Is it better to have separate interfaces like: Netconf and Netconf_1.1 ( better naming?)
2. If we use one interface, Netconf, and in the implementation we have a property for netconfVersion should I just throw exception if methodA() is called and we have set netconfVersion 1.1?

Any other considerations I need to do when supporting multiple versions of a message like NETCONF?

br,

//mike

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

How to handle methods in a common interface that supports different versions of a message format mike <mikaelpetterson@hotmail.com> - 2019-12-05 23:55 -0800
  How to handle methods in a common interface that supports different versions of a message format javaXp <n.sharir@gmail.com> - 2019-12-06 04:27 -0800
  Re: How to handle methods in a common interface that supports different versions of a message format Arne Vajhøj <arne@vajhoej.dk> - 2019-12-06 21:49 -0500
    Re: How to handle methods in a common interface that supports different versions of a message format mike <mikaelpetterson@hotmail.com> - 2019-12-08 23:51 -0800
      Re: How to handle methods in a common interface that supports different versions of a message format Arne Vajhøj <arne@vajhoej.dk> - 2019-12-09 21:24 -0500
      Re: How to handle methods in a common interface that supports different versions of a message format Andreas Leitgeb <avl@logic.at> - 2019-12-10 16:41 +0000

csiph-web