Re: Disadvantages of Dependency Inversion?



Patrick May <pjm@xxxxxxx> wrote:
Mark Nicholls <Nicholls.Mark@xxxxxxxxx> writes:

1) Is DIP is wrong?? I donot need to bother DIP if i am
programming to interface???

As I say it's not completely clear what DIP is... so I would say
completely ignore it... the crux is (to paraphrase part of Steve
Perrymans post)... the uncontraversial bit is...

1. Reference a component in terms of its public interface(s) not
it's classes.

2. If 1 is not currently possible, define interfaces that users of
can reference, and implement them within the component.

As far as where you put those interfaces... I would suggest if in
doubt put them in their own component... if you can't be bothered
doing that... put them in the component that implements them.

It depends on how many implementations and how many clients there
are. If there is a single client but multiple implementations, it
makes sense to put the interface in the same set of components as
the client, so that the client package doesn't depend on the
implementation packages.

And if there are multiple clients for the same interface, then they
likely depend on each other in some way and should be in the same
component as well.

Mark's concerns about cyclic dependencies is unfounded. However, I also
agree that there is no harm in putting interfaces in their own component.

The client owns the interface.
.



Relevant Pages

  • Re: Disadvantages of Dependency Inversion?
    ... It depends on how many implementations and how many clients there ... If there is a single client but multiple implementations, ... so that the client package doesn't depend on the ... As a general rule I'd agree with you that the interfaces should ...
    (comp.object)
  • Re: soapsuds
    ... We can then compile the client using this code which allows us to ... of this stops you from implementing your own remoting framework. ... server or be sure that the v1 clients will work with the v2 server. ... Are you going to have all new v2 interfaces in the ...
    (microsoft.public.dotnet.framework.remoting)
  • Exception with interface as parameter of a remoted object method
    ... aderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAp ... contains all the classes that implement the interfaces i've talked above ... that implements the IClienteManager interface ... And on client side i work only with interfaces. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Webservices, Interfaces and Polymorphism in proxy classes.
    ... I completely agree that WS are not strictly OOP but the code on ... possible to tell .NET to generate interfaces. ... implementation based on the client. ... With web services, the only interface you REALLY have is the WSDL contract ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Design question on Interfaces
    ... Does anyone have an example of a standard implementation of interfaces ... implementations for each client. ...
    (comp.lang.java.programmer)