Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected variable?)
From: Mark Nicholls (Nicholls.Mark_at_mtvne.com)
Date: 09/09/04
- Next message: Phlip: "Re: dip Notions 2 Major Errors"
- Previous message: Robert C. Martin: "Re: Is abstract test pattern also stairway to heaven pattern?"
- In reply to: Robert C. Martin: "Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected variable?)"
- Next in thread: Mark Nicholls: "Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected variable?)"
- Reply: Mark Nicholls: "Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected variable?)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Sep 2004 07:14:40 -0700
expanded from Mr Martin....
> package a;
>
> public class A
> {
> public void f(IB b)
> {
> b.g();
> }
> }
>
> interface IB
> {
> void g();
> }
>
> package b;
>
> public class B implements a.IB
> {
> public void g()
> {
> ...
> }
> }
>
> Thus [a]----->[b] was changed to:
> [a]<-----[b] without changing the flow of control.
>
There is something even more fundamentally flawed with this.
In the example in you book you show 3 layers so in fact
interface IB
{
void g();
}
should read
interface IB
{
void g(IC c);
}
but where is the definition of the interface IC, by DIP it should be
in the client of the implementations of C i.e. package B so A must
reference B - *****contradiction****** A now depends on the
implementation of the interface IB
I belief that is a general ***proof*** that DIP is self contradictory
in systems with more than 3 layers (and interfaces that operate on
'lower' levels, as in your example).
not only does it contradict DIP it also usually impossible as it
creates a circular reference between A and B.
- Next message: Phlip: "Re: dip Notions 2 Major Errors"
- Previous message: Robert C. Martin: "Re: Is abstract test pattern also stairway to heaven pattern?"
- In reply to: Robert C. Martin: "Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected variable?)"
- Next in thread: Mark Nicholls: "Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected variable?)"
- Reply: Mark Nicholls: "Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected variable?)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|