Re: Disadvantages of Dependency Inversion?



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.

As a general rule I'd agree with you that the interfaces should
be packaged separately from both clients and implementations.

Regards,

Patrick

------------------------------------------------------------------------
S P Engineering, Inc. | Large scale, mission-critical, distributed OO
| systems design and implementation.
pjm@xxxxxxx | (C++, Java, Common Lisp, Jini, middleware, SOA)
.



Relevant Pages

  • Re: Disadvantages of Dependency Inversion?
    ... It depends on how many implementations and how many clients ... If there is a single client but multiple ... If the interface is packaged with the trade matching system, ... to the trade matching package. ...
    (comp.object)
  • Re: Disadvantages of Dependency Inversion?
    ... As far as where you put those interfaces... ... 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 ...
    (comp.object)
  • Design question on Interfaces
    ... Does anyone have an example of a standard implementation of interfaces ... implementations for each client. ...
    (comp.lang.java.programmer)
  • RE: Returning interfaces from web-services and remoting servers?
    ... interfaces and interface implementations. ... The web service is just a way to pass data ... > interfaces to the client. ...
    (microsoft.public.dotnet.framework)
  • Re: dip Notions 2 Major Errors
    ... Again though, if the interfaces are in their own package, you can alter ... client, add new client, alter implementation, add implementation (though you ... instantiation behaviour, which we must keep. ... not available it wont work. ...
    (comp.object)