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


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

Re: Reuse naming *Provider in other classes

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Andreas Leitgeb <avl@logic.at>
Newsgroups comp.lang.java.programmer
Subject Re: Reuse naming *Provider in other classes
Date Fri, 10 Mar 2017 12:37:32 -0000 (UTC)
Organization A noiseless patient Spider
Lines 25
Message-ID <slrnoc57ll.sk7.avl@logic.at> (permalink)
References <c5d8020b-2092-45c0-b0ad-377923357d6a@googlegroups.com>
Reply-To avl@logic.at
Injection-Date Fri, 10 Mar 2017 12:37:32 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="6efabe14fa30c2091fb69613eb1117dc"; logging-data="11064"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18e7i3B0Me4/pStLaICIW1j"
User-Agent slrn/1.0.2 (Linux)
Cancel-Lock sha1:Ecek+1vPFCsfF7kvBJAoHyLaevg=
Xref csiph.com comp.lang.java.programmer:36396

Show key headers only | View raw


mike <mikaelpetterson@hotmail.com> wrote:
> We have XXProvider,YYYProvider interfaces in our application.
> They all extend the same interface called Provider that extends
> interface A.
> Now we have another interface B that provides functionality
> but it cannot extend class A.
> These are the option I can come up with:
> 1. Still call it BProvider but not extend Provider
> 2. Use other naming, BSupplier 

Option 3:
Let Provider *not* implement A, and add an AProvider with the same
methods as your current Provider extending A and the new Provider.
Let XX- and YYProvider extend AProvider.

Option 4:
If too much code depends on Provider extending A, then create a 
BaseProvider interface that doesn't extend A and includes all non-A
dependent stuff of Provider, and let Provider extend BaseProvider,
A and have any A-specific methods. BProvider then extends BaseProvider 
and B. The documentation then would explain, that Provider is really
an AProvider, but ... "hysterical raisins".

Of course without seeing real code, any suggestions may or may not fit.

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


Thread

Reuse naming *Provider in other classes mike <mikaelpetterson@hotmail.com> - 2017-03-10 04:24 -0800
  Re: Reuse naming *Provider in other classes Andreas Leitgeb <avl@logic.at> - 2017-03-10 12:37 +0000
    Re: Reuse naming *Provider in other classes mike <mikaelpetterson@hotmail.com> - 2017-03-10 05:29 -0800
  Re:Reuse naming *Provider in other classes omegajunior <omegajunior@protonmail.com> - 2017-04-03 23:21 -0400
    Re: Reuse naming *Provider in other classes lewbloch@gmail.com - 2017-04-06 02:44 -0700

csiph-web