Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #33789
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2016-02-12 01:16 -0800 |
| Message-ID | <d0bb6e79-0125-4075-880a-5f4988370fee@googlegroups.com> (permalink) |
| Subject | To deprecate or not |
| From | mike <mikaelpetterson@hotmail.com> |
Hi,
I have an interface call it InterfaceTop that looks like this:
public InterfaceTop {
public String getValue(String arg1);
}
Then we have two sub interfaces call them InterfaceSub1 and InterfaceSub2.
They both extend IntefaceTop.
Now we discovered that the method in Inteface top produces erroneous output in
in implementation of InterfaceSub1. We need an additional parameter to get value:
public String getValue(String arg1, String arg2);
As I see it we have two alternatives:
1.Add 'public String getValue(String arg1, String arg2);' in InterfaceTop and @deprecate public String getValue(String arg1);
A consequence of this will be that I need to replace methods in implemetation. using InterfaceSub2. And handle a null or empty String for arg2. But we still have a common interface.
2. Add 'public String getValue(String arg1, String arg2);' to InterfaceSub1.
I still need to implement both methods in implementation. Maybe let the "faulty" method throw UnsupportedOperationException.
What is your view on this?
br,
//mike
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
To deprecate or not mike <mikaelpetterson@hotmail.com> - 2016-02-12 01:16 -0800
Re: To deprecate or not Eric Douglas <e.d.programmer@gmail.com> - 2016-02-12 05:59 -0800
Re: To deprecate or not Arne Vajhøj <arne@vajhoej.dk> - 2016-02-13 11:02 -0500
Re: To deprecate or not Eric Douglas <e.d.programmer@gmail.com> - 2016-02-15 05:12 -0800
Re: To deprecate or not Arne Vajhøj <arne@vajhoej.dk> - 2016-02-15 11:42 -0500
Re: To deprecate or not Arne Vajhøj <arne@vajhoej.dk> - 2016-02-13 11:34 -0500
Re: To deprecate or not Andreas Leitgeb <avl@logic.at> - 2016-02-15 00:53 +0000
csiph-web