Re: Disadvantages of Dependency Inversion?
- From: "Daniel T." <daniel_t@xxxxxxxxxxxxx>
- Date: Fri, 15 Jun 2007 16:35:09 GMT
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.
.
- Follow-Ups:
- Re: Disadvantages of Dependency Inversion?
- From: Mark Nicholls
- Re: Disadvantages of Dependency Inversion?
- References:
- Disadvantages of Dependency Inversion?
- From: sweetchuck74
- Re: Disadvantages of Dependency Inversion?
- From: topmind
- Re: Disadvantages of Dependency Inversion?
- From: Christian Brunschen
- Re: Disadvantages of Dependency Inversion?
- From: nas
- Re: Disadvantages of Dependency Inversion?
- From: Mark Nicholls
- Re: Disadvantages of Dependency Inversion?
- From: nas
- Re: Disadvantages of Dependency Inversion?
- From: Mark Nicholls
- Re: Disadvantages of Dependency Inversion?
- From: nas
- Re: Disadvantages of Dependency Inversion?
- From: Mark Nicholls
- Re: Disadvantages of Dependency Inversion?
- From: Mark Nicholls
- Re: Disadvantages of Dependency Inversion?
- From: nas
- Re: Disadvantages of Dependency Inversion?
- From: Mark Nicholls
- Re: Disadvantages of Dependency Inversion?
- From: Patrick May
- Disadvantages of Dependency Inversion?
- Prev by Date: Re: Disadvantages of Dependency Inversion?
- Next by Date: Re: Disadvantages of Dependency Inversion?
- Previous by thread: Re: Disadvantages of Dependency Inversion?
- Next by thread: Re: Disadvantages of Dependency Inversion?
- Index(es):
Relevant Pages
|