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/10/04
- Next message: Christopher Barber: "Re: Static vs. Dynamic typing"
- Previous message: Ilja Preuß: "Re: Static vs. Dynamic typing"
- In reply to: Mark Nicholls: "Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected variable?)"
- Next in thread: Universe: "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: 10 Sep 2004 07:52:16 -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.
I think it may be actually worse than that......
If the whole architecture of the software has been defined by the DIP
principle, now actually the methods of the interface can contain
***no*** parameters that reference an interfaces or implementations of
types defined in a lower level, because doing so would create a
circular module dependency.
So that's a pretty strict limitation.
So in a pure DIP world you could only reference data types defined in
a higher layer!
and you need an all seeing god.
and you this god must violate the very principle on which your
architecture is based!
formally.....
The set of integers starts at 1 and we inductively work upwards.
starting at an arbritary n and working downwards does not work, as DIP
attempts to do....
see
http://mathworld.wolfram.com/PrincipleofMathematicalInduction.html
and
http://mathworld.wolfram.com/PeanosAxioms.html.
- Next message: Christopher Barber: "Re: Static vs. Dynamic typing"
- Previous message: Ilja Preuß: "Re: Static vs. Dynamic typing"
- In reply to: Mark Nicholls: "Re: graph of behavior - was Re: State vs. Data (was Re: Fans of Template Method with protected variable?)"
- Next in thread: Universe: "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
|