Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-incubator-e4-dev] layering and dependency reduction in e4

There are two very important design principle for good
architectures: layering and dependency reduction.
Strongly coupled components are bad in general.

Layered architectures are a very simple and powerful way to
structure a software system. Lower layers are not allowed to
call upper layers directly. In eclipse this means a lower layer
must not depend on a plugin of a higher layer. The eclipse
plugin mechanism allows lower layers to call upper layers
without directly depending on them.

Another equally important principle is dependency reduction. This
might sometimes lead to more components (plugins), but the
the advantage is a much cleaner structure. The simple
message is: Be very careful in adding new dependencies to
your plugins. Also make sure not to mix unrelated concepts
into one plugin. If you are at the and of the food-chain
(an application) it does not matter. But the lower you are,
the more any additional dependency hurts.

An interesting but painful exercise in eclipse must have been the
extraction of RCP. A major problem was the tight coupling of the
workbench with the resources, that was a tight coupling of unrelated
concepts. Now eclipse is in much better shape and there is a much
clearer set of plugins and layers. The prize was that the platform
has been split into more plugins.

A goal for e4 should be to minimize dependencies and to define clear
layers.

For example (sorry Ed, for picking EMF again): if we use EMF in the
presentation layer, then anything EMF depends on, the presentation
layer depends on. Today EMF has an optional dependency to
resources (bug 89453). Although one could argue that optional
dependencies are less problematic than real dependencies, I think
in a clean architecture the presentation layer of eclipse should
not depend on resource (and therefore on filesystem and jobs).

The options are clear:
1. we accept this dependency
2. we remove this dependency from EMF
3. we do not use EMF

So, we should not only be careful in selecting the minimal Execution
Environment (no idea why some people abbreviate it as BREE), but also
make sure the plugins have minimal dependencies.

e4 should have a cleanly layered structure where lower layers cannot
depend on upper layers. We have to be careful in defining those layers.

We have all this exciting technologies at our fingertips and is way too
easy to create dependencies that will become a major headache in the
future....


Michael


Back to the top