Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb 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: References: 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 mike 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.