Well it's not always optimal for higher levels to be directly dependent on lower layers but the higher level modules should instead depend on abstractions defined by interfaces/services defined in a mediator module. The interfaces services is then implementended
in terms of a lower level interface. This breaks the direct dependency between the higher level. The problem with a traditional approach is that dependencies is transitive and a change in the lower layer "leaks" and affects all the layers upwards. This can
of course happen anyway often as requirements change but thats kind of ineviteble. Having the middle man interface gives some increased complexity but often makes the architecture more losely coupled and makes it easier to make modules pluggable in the architecture.
This is also known as the dependency inversion principle (Google for it and you will find a lot of references. But basically this is kind of a service oriented architecture within your architecture. I think often we are to bound by strict layering and forget
some basic principles to reduce dependencies and quite often mix specifics with abstractions. /Michel
michel_andre
Member
410 Points
82 Posts
Re: Best Architecture
Oct 15, 2004 10:06 PM|LINK