Re: How to invert dependency?



Stefan Ram wrote:

I do not like it that the lion and the tigers now are aware of
another layer residing on top of them and prefer the first
implementation using »implementedby«. I prefer it, because
the lower levels should not depend on higher layers build
on top of them.

Does this requirement for layering make sense?

That really depends on what you mean by "on top of".

Possibly Ed is right that you are mislead by the way you draw the graph.

If Lion and Tiger really shouldn't know about Animal, one way to not have
them do that is using the Adapter pattern. But whether that really is a good
idea depends on details you didn't yet tell us, for example why you did
choose this kind of layering, what the responsibility of the layers is etc.

Cheers, Ilja


.



Relevant Pages

  • Re: A Layered Kernel: Proposal
    ... > Interesting that whole notion of layering and separation of concerns was ... hard to do proper error recovery, and it is much slower than it needs ... later on the higher layers try to do error recovery too. ... device driver behind a middle layer, ...
    (Linux-Kernel)
  • Re: A Layered Kernel: Proposal
    ... > layering can really ruin a system. ... > hard to do proper error recovery, and it is much slower than it needs ... > later on the higher layers try to do error recovery too. ... > device driver behind a middle layer, ...
    (Linux-Kernel)
  • Re: A Layered Kernel: Proposal
    ... >> hard to do proper error recovery, and it is much slower than it needs ... >> later on the higher layers try to do error recovery too. ... because of the strict layering it's not always possible ... >> possible to use the intelligent features of a smart SCSI controller ...
    (Linux-Kernel)
  • Re: How to start with OOP?
    ... I have yet to see how dip reduces module dependency. ... Structured programs, higher level layers ... errantly thinks that lower levels of a layered system should mainly depend ...
    (comp.object)
  • Re: Need to know the list of layers used in Virtuoso layout design
    ... what you want there is the list of layers that ... are used in the current hierarchy level, ... cells from other cells in lower levels down the hierarchy. ... design, but I only need the LIST OF USED layers in a design not the ...
    (comp.cad.cadence)