Re: Separation of API and implementation



"Gabriel Claramunt" <gabclar@xxxxxxxxxxxxxxx> wrote:

I'm missing something or an Abstract Factory could help?
As long as you use the factory, you can ensure that your implementation of X
will use your implementation of Y.

An abstract factory can help, as long as it keeps track of which Xs are
from package A and which ones are from package B so it knows how to
distribute the Ys.

The basic problem is with the OPs interface:

interface X {
void foo(Y y);
}

The interface above is a lie, because it says that every X can handle
any Y, but that just isn't true.
.



Relevant Pages

  • Re: MVPs: static methods in interfaces. (REDEFINED)
    ... this static method is public and therfore should be publicly known ... >> code to define a behavior (the interface) and another body of code to ... >> Abstract Factory pattern describes. ... >> programmer helping programmers. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Separation of API and implementation
    ... I'm missing something or an Abstract Factory could help? ... I have an API defined in one plugin, ... interface X { ... implementation of Y, say YImpl. ...
    (comp.object)
  • Re: Making a generic Parameter class
    ... I've used the adapter and abstract factory patterns before. ... What I need to know is if there is already a generic implementation class ... for the IdbParameter interface that I can use? ... If you have a database (that is not ...
    (microsoft.public.dotnet.general)
  • Re: Understanding Abstract Factory Pattern
    ... software design patterns. ... Pattern ... had implemented that interface for Oracle, ... The abstract factory pattern would give you a central factory to call ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Separate Compilation in Programming Languages
    ... within one package body. ... all, separate or otherwise. ... OK, so you like having textually separate spec and body, ... Clients of an interface do not depend ...
    (comp.lang.ada)